Three in one: iray decal, an instance and find by type [SOLVED w/workarounds ~%83]
Hello, I've accidentally found script ide and it gave me an idea to speed things vastly. I'm completely new about it.
I've a few questions to get me started for my project:
1- How can I create an iray decal via script?
I've searched the forums quite a bit, but couldn't come to a hit for creating an iray decal via script. By also looking at object index doesn't ring any bells for object creation.
2- How can I create an instance of an existing object via script?
I need to create instance of an existing object. Then I will manipulate it (move-scale-etc I think I can handle this part).
3- How can I confirm a type of object is e.g. Null?
I need to filter or loop by type of objects. For example, what gives me back "Null" via script when I was iterating through objects?
I want to achieve something like: if ( typeof (itemBeingIterated) == "Null" ) { ... } or something like if ( typeof(selectedItem) == "Decal" ) { ... }
Any help will be appreciated, thanks!
Comments
For 3, if the node is a plain DzNode and doesn't return anything for node.GetObject() then I think you are safe to assume it's a null.
1) Rob says that the Iray Decal code is still a WIP, so will almost certainly change as he refines it.
2) There is a sample script for instances http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/nodes/create_instance/start
Thanks Richard for the answers.
So;
1- Decals are waiting for refinement from what I understand. Current workaround is to create a decal by hand and copy (duplicate) it via script. (See 2) [SOLVED w/workaround: %16,6]
2- That instance example is very helpful, thanks. [SOLVED %33,3]
3- Solved with logical assumption approach [SOLVED %33,3]
Rob did confirm my answer on 3 too.