On 07/11/2017 at 14:48, xxxxxxxx wrote:
I'm stumbling a bit over a new problem. :) I'm using a Python Generator to generate a polygon object. It all works well and the object's mesh is nicely generated. The only problem I have is that the object doesn't seem to have a proper Phong setup. Adding the Phong tag to the "Python Generator" object doesn't do anything.
import c4d def main() : # [cut] # ... some working code... # [cut] polyobj = c4d.BaseObject(c4d.Opolygon) polyobj.ResizeObject(vertexcnt,polycnt) # [cut] # ... some more working code here (polyobj.SetPoint() and .SetPolygon() calls) # [cut] polyobj.SetPhong(True, True, c4d.utils.Rad(80)) return polyobj
After quite some searching I found out about the SetPhong() function. Adding it (see above code) seems to fix the visuals at least (the object now as a proper Phong setup), but the added Phong tag still doesn't do a thing.
How would one add proper handling of the Phong tag in this situation? Do I need to manually look up the tag, read its options and apply those values via the SetPhong method? Or is there a better recommended method?