hoknamahn Posted September 18, 2006 Share Posted September 18, 2006 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? Quote Link to comment Share on other sites More sharing options...
SpencerL Posted September 18, 2006 Share Posted September 18, 2006 not sure if this would help but check out optype( ) and optypeinfo( ) Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted September 19, 2006 Author Share Posted September 19, 2006 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 Quote Link to comment Share on other sites More sharing options...
SpencerL Posted September 19, 2006 Share Posted September 19, 2006 no problem, that happens to me all the time as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.