Update parameters scripting syntax

   573   2   0
User Avatar
Member
156 posts
Joined: July 2005
Offline
Am modifying simple rendering scripts previously used with Sops/Mantra, but cannot find the correct syntax for Lops/Karma.

For example:

To change the render visibility of an object to "phantom" in a Render Geometry Settings LOP, (primvars:karma:object:rendervisibilty), I've been reduced to using...

opparm RGS_lop_for_object xn__primvarskarmaobjectrendervisibility_4xbfg ( "-primary" )

It works, but it's nasty.

What is the proper syntax to set this example parameter?
Should I be using something other than "opparm" in LOPs?
Edited by fgillis - Dec. 21, 2023 09:29:31
Floyd Gillis
User Avatar
Staff
4438 posts
Joined: July 2005
Offline
hscript has the encodeparm() function. So you could make this more legible by doing:

opparm RGS_lop_for_object `encodeparm("primvars:karma:object:rendervisibility")` ( "-primary" )
Edited by mtucker - Dec. 21, 2023 19:28:44
User Avatar
Member
156 posts
Joined: July 2005
Offline
Thank you Mark.

Works great, and much easier than hunting through opscript outputs for (bizarre) variable names.
Floyd Gillis
  • Quick Links