PDA

View Full Version : renderlayer with Xpresso


mimo8
11-21-2010, 05:46 PM
Hello,

I am just trying to build something like renderlayers in cinema using Xpresso, but my xpresso and coffee scripting skills are too limited to manage it.
But I know very well what I need and how it should be done, so any help would be highly aprechiated. Here are the tasks I want to do:

1. Naming
I am using a Xref node to load and quickly exchange objets in the scene.
The name of the original file loaded through the Xref node should be in the render output format.
So lets say the objects name is "23charly" the rendering should be namend:
object_23charly_beauty_0000.exr
The orginal file is called "23charly.c4d" I can manage to get this name into the rendersettings output port, so I am getting "23charly.c4d" as a filename.
I do so by connecting the filename port from the Xref-node to the File... port of the rendersettings node.
What I am desperately searching now is an option to do some renaming in here,
so to kill the 4 last digits and ad "object_" in front and "_beauty_" at the end.
I believe this could be an easy task for anyone familiar with scripting, but for me I just wouldnt know how to solve it.

2.RenderSettings
I have several rendersettings saved with this scene.
So I have one rendersetting creating a beauty pass, another for a depthpass, another for normalmaps. I dont want to render this passes at one time using multipasses for certain reasons. (objects have to be hidden for those passes, normalmaps have to be rendered at double filesize to have good antialiasing).
Now I would love to create a switch, triggering between those rendersetting.
I just cannot find a port letting me adress those settings.
For sure the output name should change from "object_23charly_beauty_0000exr" to "object_23charly_normal_000.exr", but this should be easy once knowing how to do the renaming as asked above.

Perhaps there are some more little tasks I would like to get into this renderlayer-xpresso-switch but the two tasks above are certainly the most crucial points.

Thnx in advance for any help,
also for links to xpresso/coffee tutorials getting me closer to a solutions.

cheers
*m

mimo8
11-21-2010, 05:49 PM
Oh yes, and I am still on cinema10.5, so no python in here.

bandini
11-21-2010, 09:59 PM
What you are trying to do is admirable, but you may not be aware of tools out there already that might do what you are looking for.

I have a plugin, Render Elements, that save scene states and render setting so that you can create render layers. The most current version is for V11 and V11.5. There's an older version for 10.5, though, that you can get here (http://www.adamswaab.com/plugins/RenderElements_0_6_5.zip). (Keep in mind this is an older version, so there are bugs that were squashed in later builds).

There is another tool out there called TakeTool that may do what you need, as well.

If you want to code this tool yourself, you really can't do it with Xpresso. You can do some things with COFFEE, but you are limited quite a bit in terms of the data that COFFEE can access. It may be able to do what you need, but you may also run into roadblocks. (I don't think COFFEE can access XRefs in V 10.5, but I may be wrong).

To get at certain render settings, basically you need to access the current or first renderdata and then use functions like GetNext(), GetPrev(), etc. to move through the list. You can then query the name or baselink to see if it matches up with the data you are looking for. (Better to store baselinks, as they are not name-dependent).

For changing names of files, look into the COFFEE SDK and check out the string functions and the filename and basefile classes. They have example in there...

If you are confused, I know there are examples of this on plugincafe in COFFEE and C++.

Good luck!

mimo8
11-22-2010, 03:40 PM
thank you very much bandini
installed your plugin but didnt have the time to check it through yet
also thnx a lot for the COFFEE SDK and renaming hint
will update any success

mimo8
12-07-2010, 01:52 PM
is there a way to adresse saved render presets via expresso.
would be so great to switch presaved rendersettings.

bandini
12-07-2010, 04:11 PM
COFFEE tag.

CGTalk Moderation
12-07-2010, 04:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.