THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/10/2012 at 02:31, xxxxxxxx wrote:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
I don't know what my problem is
obj is Ocube.
const Vector *padr= ToPoint(obj)->GetPointR();
GePrint(RealToString(padr.x)); <--- crash point
what is problem? ..
On 01/10/2012 at 03:53, xxxxxxxx wrote:
obj should be PointObject and not BaseObject !
Use IsInstanceOf() to test this.
On 01/10/2012 at 04:04, xxxxxxxx wrote:
Exactly. A little addition:
To get your hands on the resulting point object, use the cache (obj->GetCache()). And if cache is NULL for some reason, try the modeling command MCOMMAND_CURRENTSTATETOOBJECT. In both cases, the result will be a point object (presumed, of course, that obj is a generator that creates point objects).
On 01/10/2012 at 06:06, xxxxxxxx wrote:
An even smaller addition:
Always check allocations and anything that returns a pointer for NULL as an error condition. It can let you know (if you use GePrint()) that something isn't doing what you expect without crashing.
On 02/10/2012 at 12:59, xxxxxxxx wrote:
Thank you very much, all
GetCache is useful for me.