Rop> scripts tab variables

   3646   6   1
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
Hi ,
You can make a global variable like $RENDERPASS. in a switch shop

Then create in a ROP > scripts tab

:- pre render set $RENDERPASS = 1 ; varchange

:- post render set $RENDERPASS = 0 ; varchange

This is in a few rops were I want objects rendered using different shaders. All seems good but every now and then after making changes I notice the $RENDERPASS variable seems to stick and the ROPs ignore the post script values. Has anyone else had this weirdness or am I going insane believing this could happen ?
Gone fishing
User Avatar
スタッフ
1450 posts
Joined: 7月 2005
Offline
perhaps a bit unrelated but you may be better off specifying the variable name in ‘varchange’ command:

set $RENDERPASS = 1 ; varchange RENDERPASS

This way Houdini does not attempt to dirty nodes that use other variables (ie, it's a bit more efficient). But, that should not be related to your problem (though it might).
User Avatar
Member
665 posts
Joined: 7月 2005
Offline
Hi Circus,

I have always had to use ‘setenv’, set seems to be a bit flakey at times.


cheers,
-j
User Avatar
Member
1532 posts
Joined: 7月 2005
Offline
It might also be worth your while to have a look at takes for this very purpose.

Create a take.
Make your shader assignments in the take.
Set rop to render your take.

Presto.

G
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
Thanks for the suggestions, I did think of using takes but then there might some issues created with the farm and rendering.

It has been suggested that opparm could really help as this can be used in the pre/post render scripts tab to hard wire the shader in.Then I can just do away with the variables . Yet to test it though , something like below might work

opparm /obj/Geo_In shop_materialpath (../shopnet1/simpleLambert)


r
Gone fishing
User Avatar
スタッフ
1072 posts
Joined: 7月 2005
Offline
circusmonkey
All seems good but every now and then after making changes I notice the $RENDERPASS variable seems to stick and the ROPs ignore the post script values. Has anyone else had this weirdness or am I going insane believing this could happen ?

I'm not sure, but the scripts may be executed in their own context, and variables set via the ‘set’ command are local by default. You might try the -g option.
User Avatar
Member
47 posts
Joined: 12月 2008
Offline
i've been using these little scripts for a while now, except i do it slightly differently.

i use:
opset -r ON “../../render_null1”

or something to that effect, then for the object i'm rendering i assign different shaders using material sops and point to a null. that script just sets the render flag on one of those nulls.

you can also use the `opparm` command in render scripts to avoid using takes.
to a man with only a hammer every problem looks like a nail.
  • Quick Links