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:07 AM

Ignore ez_Porcelain_03.py :-)

ez_Porcelain_04.py contains the next few changes you should make.

Right at the beginning of the MakeMat method (line 75ish) we add two assignments, to the variables diffusemap and diffusecol.

diffusemap will hold either the imagemap node being used in the shader for Diffuse colour, or None if no diffuse map can be found.

diffusecol will be set to the diffuse colour in the PoserSurface. In fact, we won't be using this - I added it in in case we needed to and never took it out again. Still, leave it in for now as it might prove useful if we do more work on the shader.

The mat.GetMap() and mat.Diffuse_Color() methods are part of the EZMat API, but are as yet undocumented. Work is being done to produce the docs right now :-)

You will notice that the MakeMat signature has also changed, to accommodate an extra parameter, p.

This parameter is passed in the Apply method of the EZPlugin class, as follows:

self.MakeMat(mat, self.pm)

BUT

It should read:

self.MakeMat(mat, self.pm.GetParameter)

Please use the corrected version, which does not appear in the tutorial files until ez_Porcelain_07.py!

You should now have the equivalent of ez_Porcelain_04.py, but with that correction in place.

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