Jump to content

Operator Type?


hoknamahn

Recommended Posts

How can I check a node type from script? I want to check is that object a Shader SOP, Attribute SOP or something else. Or to check the type of subnetwork. I see two solutions:

1. We can name all object type with necessary preffix for example for shops it is shop* (shop_aniso_metal or shop_crystal).

2. We can search the "unique" (for required operator type) parameter say for Shader SOP it can be quicksurface parameter.

First method is ugly and not automated. Other method does not give any guarantees of originality of our "unique" parameter. And it will not work in the case of subnets (they doesn't have any useful parameters in our case).

This is the first problem. Other question is how to determine the type of a shader from script. Is it the Mental Ray shader or PRman shader? Or maybe it is the Mantra shader? Is it the surface shader or shadow?

Link to comment
Share on other sites

not sure if this would help but check out optype( ) and optypeinfo( )

Eh! Laziness is a terrible thing. I saw optype() and optypeinfo() before but was lazy to check them (I thought that functions are designed for other type of job). I was wrong. That is what I am looking for. Thanks SpencerL :rolleyes:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...