Usin BaseDraw::DrawObject to draw spline
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/09/2008 at 09:32, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.1
Platform: Windows ; Mac ;
Language(s) : C++ ;---------
I try to draw a spline in the HANDLES pass, using BaseDraw::DrawObject, but nothing is showing up. The result of DrawObject ir TRUE, so I guess it should have worked.Anything I have to be aware of?
Thanks for any help!
Greetings,
Jack -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/09/2008 at 07:08, xxxxxxxx wrote:
You have to pass an LineObject instead of a SplineObject. Also since the spline was probably a primitive it does not exist in a draw pipeline yet. You better use GenerateSplinePrimitive(). See attached code of the modified AtomObject example.
>
\> class AtomObject : public ObjectData \> { \> private: \> LineObject \*line; \> public: \> virtual Bool Init(GeListNode \*node); \> virtual void Free(GeListNode\* node); \> virtual Bool Draw(BaseObject\* op, LONG drawpass, BaseDraw\* bd, BaseDrawHelp\* bh); \> virtual BaseObject\* GetVirtualObjects(PluginObject \*op, HierarchyHelp \*hh); \> \> static NodeData \*Alloc(void) { return gNew AtomObject; } \> }; \> \> Bool AtomObject::Init(GeListNode \*node) \> { \> BaseObject \*op = (BaseObject\* )node; \> BaseContainer \*data = op->GetDataInstance(); \> \> BaseContainer bc; \> BaseObject \*spline = NULL; \> spline = GenerateSplinePrimitive(node->GetDocument(), Osplinestar, bc, 1.0, NULL); \> if(!spline) return FALSE; \> \> line = ToSpline(spline)->GetLineObject(node->GetDocument(), 1.0, NULL); \> if(!line) \> { \> BaseObject::Free(spline); \> spline = NULL; \> return FALSE; \> } \> \> return TRUE; \> } \> \> void AtomObject::Free(GeListNode \*node) \> { \> if(line) LineObject::Free(line); \> line = NULL; \> } \> \> Bool AtomObject::Draw(BaseObject \*op, LONG drawpass, BaseDraw \*bd, BaseDrawHelp \*bh) \> { \> if(drawpass != DRAWPASS_OBJECT) return TRUE; \> \> return bd->DrawObject(bh, line, drawpass); \> } \> \> BaseObject \*AtomObject::GetVirtualObjects(PluginObject \*op, HierarchyHelp \*hh) \> { \> return NULL; \> } \>
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/09/2008 at 09:05, xxxxxxxx wrote:
Thanks! That sure looks like a good tip, should be included in the SDK.
Unfortunately, still nothing is drawn
Anyway, I guess I have done something else wrong. Will work on this some more.
Thanks again
Greetings,
Jack