Making a basic sphere
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/04/2008 at 20:06, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.5
Platform: Mac OSX ;
Language(s) : C++ ;---------
Could someone help me insert a simple sphere into the scene? Here's what I've got, but obviously it's not correct...>
\> Bool MyMenuPlugin::Execute(BaseDocument \*doc) \> { \> GePrint("Menu Executed!!"); \> \> BaseObject\* obj; \> obj->Alloc(LONG Onull); \> \> Vector hpb = Vector(0,2,4); \> obj->SetRot(hpb); \> \> //GePrint(hpb.x); \> \> return TRUE; \> } \>
Thanks!!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/04/2008 at 20:27, xxxxxxxx wrote:
You have to call the base classes Alloc() method to allocate an object, tag etc. Then you have to insert it into the document with the documents' Insert() method.
>
\> Bool MenuTest::Execute(BaseDocument \*doc) \> { \> StopAllThreads(); \> \> BaseObject \*obj = NULL; \> obj = BaseObject::Alloc(Osphere); \> if(!obj) goto Error; \> \> if(!obj->MakeTag(Tphong)) goto Error; \> \> doc->StartUndo(); \> \> doc->InsertObject(obj, NULL, NULL); \> \> doc->AddUndo(UNDO_NEW, obj); \> \> doc->EndUndo(); \> \> doc->Message(MSG_UPDATE); \> \> EventAdd(); \> \> return TRUE; \> \> Error: \> BaseObject::Free(obj); \> return FALSE; \> } \>
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/04/2008 at 23:05, xxxxxxxx wrote:
That is awesome, exactly what I needed to get things going. Thanks again!