opscript

The opscript command (which is probably not used by many people, admittedly) has a small bug related to nested quotation marks.

here’s what it generates for a circle SOP inside of a Light COMP:

# Node circle1 opadd -n SOP:circle circle1 oplocate -x 266 -y -82 -w 90 -h 60 circle1 opparm circle1 rad ( 'mod.math.sin(mod.math.radians(me.parent().par.coneangle/2)) + mod.math.sin(mod.math.radians(me.parent().par.conedelta/2))' 'mod.math.sin(mod.math.radians(me.parent().par.coneangle/2)) + mod.math.sin(mod.math.radians(me.parent().par.conedelta/2))' ) t 0 0 '-op ('tube1').par.height' ) arc ( openarc ) opset -v on -z 0 circle1

this part in particular:

'-op('tube1').par.height' 

when re-evaluated, tube1 will not be enclosed in quotation marks any more and the operator will have an error

there might be a way for me to work around this using regex in the interim but it’ll be a really ugly solution :wink:

build 52440

Uhh…are you trying to mix python and tscript in one DAT? That’s not going to work.

Use the run command (in either python or tscript) to run a seperate DAT with your seperate code in, make sure that the two DATs are in python and tscript mode respectively.

this is code that’s generated by the opscript command, not code that i have written by hand.

regardless, the code does actually work, by the way. the only problem is that the nested quotation marks cause the string to evaluate incorrectly. instead of ‘tube1’ you end up with just tube.

Could you post your example of circle referencing tube. My guess is that you are using opscript command on an OP in python mode. I’d like to take a look at to see where its breaking.

Thanks

yes you’re right, it’s running opscript in a tscript. (i’m unaware of a python equivalent tbh)

it’s realy easy to replicate… just open a new scene, and place a light.

then, open a tscript textport and run this:

opscript -r -G -b /project1