THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/09/2012 at 17:07, xxxxxxxx wrote:
I assume you are calling the doc the proper way?
(as some of your deformed tests seems to work at render)
via your own Generator i.e.such as:
doc = mypluginobject.GetDocument()
rather than:
doc = c4d.documents.GetActiveDocument()
Using GetActiveDocument() is not a safe way to get
the correct document at render time.
(As the document is duplicated)
You are using GetVirtualObjects(), right?
Then Execute() should not be needed.
Then, getting the correct Cache of an object can be a bit
convoluted and calls for some logistics as it
depends on what kind of object you are checking :)
The return options for checking a single object are:
None : Undeformed point/poly Object (or Something went wrong)
GetCache() : Undeformed Parametric Object
GetCache().GetDeformCache() : Deformed Parametric Object
GetDeformedCache() : Deformed Point/Poly Object
In the case of the object is an undeformed point/poly object,
you need to return the point/poly object itself.
By setting up a 2 by 2 function matrix ( 2 if else checks)
you can get the correct return.
So you have four different return options including the original object
plus the None if the two if else fail.
While the Cache return points (and polys for poly objects) as if
it is an object, afaik the returned cache is to be treated as "read only data".
I.e. the Cache return of a spline does not include proper variable tags.
Csto does return a valid object that you can treat as normal but it has problems
getting the deformed state if its deformer is not a child of it.
So if you want to treat a "real" object by Cache data, you would
first get the Cache Data, then Csto the object and finally set the
points from the Cache data to the object. (object.SetAllPoints(cachedata.GetAllPoints()) )
Then finally check if anywhere in your set ups there is a Deformer as the first child
of a Generator. As an example having a HyperNURB where the first child is a deformer
and then the objects you want to subdivide, both MakeEditable and CurrentStateToObject Commands
(the Icon/Key Commands as well as code) will fail.
I hope some of this might help.
Cheers
Lennart