Finding custom operators in a scene

19 views
Skip to first unread message

Matt Lind

unread,
Jun 22, 2012, 8:37:24 PM6/22/12
to soft...@listproc.autodesk.com

Tricky problem I’m trying to solve. 

 

I know I can find all the custom operators in the scene with FindObjects() and traverse operator output ports to find out where the operator is connected, but in this particular case I need to go the opposite direction.

 

The problem I need to solve is:

Given an arbitrary object in the scene, determine if it has a custom operator applied to it.

 

 

In my test cases I have used FindObjects() to locate the custom operators and print out their output port connections.  In nearly all instances the custom operator doesn’t show up in the scene explorer where the output port claims it should be.

 

Example:

 

                A custom operator which drives the translation U and V (projtrsu, projtrsv) parameters of a texture projection Def property.  When I query those parameters for their sources, they return a reference to the custom operator driving them.  When I query the custom operator’s output ports, they say the operator lives on the texture projection def property.  Yet when I open the scene explorer and navigate to the texture projection def property, no operator is found.  Instead an instance is nested below each parameter connected to the output ports.  Illustration from scene explorer:

 

PolygonMesh

    Primitive

        Clusters

            SampleCluster

                Texture_Projection

                    Texture_Projection_Def

                        (CustomOperator.FullName points here)

                        Projscl

                        Projrot

                        Projtrs

                            Projtrsu

                                CustomOperator (actual location)

                            Projtrsv

                                CustomOperator (actual location)

 

When I query the Texture Projection Def’s various collections (Properties, NestedObjects, …), the custom operator is nowhere to be found.

 

So given an arbitrary scene object, how do I determine if it has a custom operator other than resorting to FindObjects()?

 

 

 

Matt

 

 

 

Bradley Gabe

unread,
Jun 22, 2012, 9:22:21 PM6/22/12
to soft...@listproc.autodesk.com
You might find some utility in the subroutines inside the Sanity Checker Plugin:

It's in Python, but OM is OM.

Matt Lind

unread,
Jun 22, 2012, 9:30:43 PM6/22/12
to soft...@listproc.autodesk.com

Correct me if I’m wrong, but it appears your code only deals with the construction history.  It doesn’t consider cases where the custom operator lives elsewhere such as my example.

 

Matt

Bradley Gabe

unread,
Jun 22, 2012, 9:35:07 PM6/22/12
to soft...@listproc.autodesk.com
I'm pretty sure there's code in there that finds operators living on clusters and such, outside the scope of the stack.
Reply all
Reply to author
Forward
0 new messages