tyFlow Forum
script access each operator - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: General Discussion (https://forum.tyflow.com/forum-2.html)
+--- Thread: script access each operator (/thread-2893.html)



script access each operator - Saca - 02-01-2022

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!


RE: script access each operator - tyFlow - 02-01-2022

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()
            )
        )
    )        
    
)



RE: script access each operator - Saca - 02-02-2022

thanks, your code.

It went well.


RE: script access each operator - Saca - 03-22-2023

how to check enabled-property  the each operators?
Code:
$.Event_002.Export_Particles1A.enabled
it's not work.


RE: script access each operator - tyFlow - 03-22-2023

Currently that is not exposed to MAXScript.


RE: script access each operator - Saca - 03-24-2023

thanks reply, i hope that supported.


RE: script access each operator - im.thatoneguy - 06-16-2025

Is there a newer better way to do this?  This is problematic with identical names like Rotation operators being used multiple times. I can't think of a way to get identical event names (sloppy but possible)

Code:
function GetTyFlowOperators TyEventObj = (
    local AllOperators = #()
    local Op
    local i = 1
    do
    (
        if TyEventObj[i] != undefined then (Op = TyEventObj[i]) else (exit)
        append AllOperators Op
        i += 1
    ) while tyEventObj[i] != undefined
    return AllOperators
)