Forum: Poser - OFFICIAL


Subject: Tutorial: Creating an EZMat plugin

Snarlygribbly opened this issue on Aug 05, 2014 ยท 13 posts


Snarlygribbly posted Tue, 05 August 2014 at 10:18 AM

Now find the code which creates the imagemap node and connects it to the HSV node.

In ez_Porcelain_04.py this is on line 138 and 146

Again, the mat.AddNode() and mat.ConnectNodes() methods are part of the undocumented EZMat API.

What we want to do is use the image map that already existed in the shader (if there was one) rather than create a new one. Also, we only want to try and connect it up if it actually exists :-)

Look at ez_Porcelain_05.py to see how these lines have been changed: we check to see if our diffusemap variable is initialised, and if so we use the node that it references and connect it to our shader.

This introduces a bug, though: the mat.RemoveOrphans() method used at or near line 87 gets rid of all the old nodes, but we want to keep the image map one. We'll address this bug soon.

Free stuff @ https://poser.cobrablade.net/