PDA

View Full Version : custom file prefix


noiseOfId
03-08-2011, 10:48 AM
Hi!
I would like to create a custom file name prefix in the render settings.
So if the scene is called eg "shot01_sphere_V001", I would like to have a procedure "tokenizing" me a "shot01" from that, which i can then use to specify a folder when rendering.
Or maybe making me a s1_sp_beauty_001 from that.
I have a feeling this isnt possible, but maybe anyone knows...

thx!

fantasizer
03-08-2011, 11:23 AM
Try to think in Python.

noiseOfId
03-08-2011, 11:29 AM
hm, havent looked into that much...
Does it mean that <RenderPass> or <RenderLayer> is basically python code?

earlyworm
03-08-2011, 12:15 PM
You could use the <Version> tag to insert your custom naming prefix...

//get scene name
string $getCurrentScene = `file -q -sn`;

//do tokenize stuff here

//set custom name
setAttr -type "string" defaultRenderGlobals.renderVersion $customPrefix;

jschieck
03-08-2011, 03:09 PM
well doing something like:

%s/%l/%l_V001

will give you the path:

untitled/masterLayer/masterLayer_V001.0001.iff

%s being the scene and %l being the layer

i usually find that works well enough for me, otherwise you need to do something like earlyworm suggested

fantasizer
03-09-2011, 01:54 AM
hm, havent looked into that much...
Does it mean that <RenderPass> or <RenderLayer> is basically python code?
I'm trying to point out that Python is way more efficient than MEL in terms of string manipulation. I've thrown away MEL for 3 years. I really don't know MEL now.

noiseOfId
03-09-2011, 04:13 AM
You could use the <Version> tag to insert your custom naming prefix...

//get scene name
string $getCurrentScene = `file -q -sn`;

//do tokenize stuff here

//set custom name
setAttr -type "string" defaultRenderGlobals.renderVersion $customPrefix;

I Yeah I looked into the version tag but somehow it always got inserted at the wrong position.
I think it happens when you have too many of these tags.
Got it working now I think...
thx!

@fantasizer
yeah, "python", it's on my list.
for quite a while :blush:

CGTalk Moderation
03-09-2011, 04:13 AM
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.