script access each operator
#1
hi,
please tell me, how to access each operator has the tyflow via maxscript.
example, the tyflow has two events 'Export_Left' and 'Export_Right', it has 'Export_Particles' operator.

--export script code
ty.Ev_Export.Export_Particles.tycacheFilename = @"C:\tyCache\export_.tyc"
ty.Ev_Export.Export_Particles.exportTyCache()

it's go well.

but the problem is on some exports.
I do't know how to access each operator has the tyflow.
the script needs each operator name in this code,
thus i want to each them automatically, instead of hard-coding.


thanks

congratulations tyFlow-Pro release!


Attached Files Thumbnail(s)
   
  Reply
#2
Hey, you can iterate object properties and then determine if they are events and such, then further iterate property names to figure out if the operator matches the naming scheme of the export operator you want as well.

Example code:

Code:
obj = $tyFlow001

names = getPropNames obj
for name in names do
(
    prop = getproperty obj name
    if iskindof prop tyEvent then
    (
        OPnames = getPropNames prop
        for OPname in OPnames do
        (
            if findstring (OPname as string) "export" != undefined then
            (
                exportOperator = getProperty prop OPname
                exportOperator.exportTycache()
            )
        )
    )        
    
)
  Reply
#3
thanks, your code.

It went well.
  Reply


Forum Jump: