THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/10/2011 at 16:45, xxxxxxxx wrote:
What about triggering a hidden UserData field in your code to update it instead?
Here's the GetContour() method of the Py-DoubleCircle.pyp SDK example. But with some code added to it that will hide the first UD entry. So the user never sees you using it:
def GetContour(self, op, doc, lod, bt) :
bc = op.GetDataInstance()
bp = self.GenerateCircle(bc.GetReal(c4d.PYCIRCLEOBJECT_RAD))
if not bp: return None
bb = bp.GetDataInstance()
bb.SetLong(c4d.SPLINEOBJECT_INTERPOLATION, bc.GetLong(c4d.SPLINEOBJECT_INTERPOLATION))
bb.SetLong(c4d.SPLINEOBJECT_SUB, bc.GetLong(c4d.SPLINEOBJECT_SUB))
bb.SetReal(c4d.SPLINEOBJECT_ANGLE, bc.GetReal(c4d.SPLINEOBJECT_ANGLE))
bb.SetReal(c4d.SPLINEOBJECT_MAXIMUMLENGTH, bc.GetReal(c4d.SPLINEOBJECT_MAXIMUMLENGTH))
DoubleCircleData.OrientObject(bp, bc.GetLong(c4d.PRIM_PLANE), bc.GetBool(c4d.PRIM_REVERSE))
UD = op.GetUserDataContainer() #Get the the container for all UD entries
for descId, container in UD: #Loop through all the id's in the container
if descId[1].id == 1: #Gets the first UD entry
container[c4d.DESC_HIDE] = True #Set it to hidden in memory only
op.SetUserDataContainer(descId, container) #Execute that hidden setting from memory
c4d.EventAdd()
return bp
-ScottA