THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/01/2006 at 08:08, xxxxxxxx wrote:
Cinema 4D Version: 9.52
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
Maybe I forget anythinks ... but, if:
// Create new obj
BaseObject *op = BaseObject::Alloc(Osphere); //<------- !!
if (!op) return FALSE;
doc->InsertObject(op, NULL, NULL, TRUE);
make me "happy", because everytime C4D draws a new Sphere by clickin mouse ... in other side if I put
BaseObject *op = BaseObject::Alloc(Ospline); //<------- !!
ONLY ONE SPline at time, it is possible to Draw ...
On 24/01/2006 at 09:24, xxxxxxxx wrote:
mmmm... I can better explain:
in the sdk liquid example (in mouseinput(...) routine) exist
op = BaseObject::Alloc(Osphere) and
null = BaseObject::Alloc(Ometaball) .
If I substitude Osphere with Ospline nothing appair in edit win.
Ergo, Ospline is not like to create SplineObject.
My question: how it is possible to create really SplineObject (visible) with the same procedure ?
PS. If I add a Line3D(...) command in Draw(...) routine, Edit win show me only ONE line at time, not all in queue in a document.
On 24/01/2006 at 09:43, xxxxxxxx wrote:
Unlike a SphereObject, a SplineObject (and PointObject and PolygonObject) requires some information. You need to set up points on the spline, otherwise it doesn't have any by default.
For instance, this is code taken from my Wavefront object import class:
if (!(baseObject = SplineObject::Alloc(spnum, Tbspline))) return FALSE;
baseDocument->InsertObject(baseObject, NULL, NULL, FALSE);
if (!(vertex = (Vector* )GeAlloc(spnum*sizeof(Vector)))) return FALSE;
if (!(padr = ToPoint(baseObject)->GetPoint())) return FALSE;
if (!(sadr = ToSpline(baseObject)->GetSegment())) return FALSE;
for (n = 0; subreader->SetLine(treader->GetTokenBuffer()); n++)
a = subreader->GetTokenLong(DELIM_FACET);
if (a > 0) a--;
else a += vnum;
padr->x = vertex[a].x;
padr->y = vertex[a].y;
padr->z = vertex[a].z;
sadr->closed = FALSE;
sadr->cnt = n;
Note that the points here are pulled from the .obj file, but any data source is adequate.
On 26/01/2006 at 04:25, xxxxxxxx wrote:
thx kuro for your answer. ^_-
My big problems are to understand How, When and WhatIsNecessary (and correctly setting) any millions C4D features....
I had study the examples, but for a beginner with C4D developer (not like programmer ...) without to know the histories (flags, functions, calls, classes...) is NOT quite simple.
Why don't exists a User Manual (not the Help Docs) for Programmer where explain the variuos flags and what they doing if somebody want to create a simple SPline (for example) ?
On 26/01/2006 at 07:38, xxxxxxxx wrote:
The examples are scant, but the documentation is one of the best resources for how the SDK works and what's available to the developer. Beyond that, there are several other places to look.
One is here. My method is to come to this forum (SDK Help), select All for "Show Topics" and do searches by Subject and Message Body. There is also an archive search which might provide answers for pre-8.0 features.
Another place you will need to get used to searching is the Resource folder in Cinema 4D. Under the _api, modules, and res folders are almost all of the missing answers, although very cryptic for the uninitiated. The headers and descriptions contain the entire framework.
Failing these, experimentation and asking here for answers.
Surprisingly, there are no books (maybe some in German; don't know) and just one website, which is more introductory, related to Cinema 4D C++ SDK plugin development.
Just keep trying and asking. Eventually the murky waters clear.