THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/02/2003 at 21:33, xxxxxxxx wrote:
Cinema 4D Version: 8.012
Platform: Windows ;
Language(s) : C++ ;
Now I can say with certainty that there isn't a direct way to connect multiple polygonal objects into one object (per the Object Manager->Objects->Connect command), not even in the C++ SDK. I've checked every single entry in the HTML Help Index, every class, checked every example, looked through all of the API source code and resources and could find nothing remotely close to doing this. Don't even mention MCOMMAND_JOIN unless you can show working code that does this. Put another way, MCOMMAND_JOIN works with SendModelingCommand() which ONLY accepts one object - and a Parent Null Object will not suffice (try it if you don't believe me - I did). Connect requires multiple objects selected (this sounds like a broken record)...
If this has to be done the hard way (as compared to the simple way it can be done interactively), I want an algorithm. Hint: why do there seem to be no object-level commands available? I had to group my objects manually, which wasn't too difficult. But connecting them, with Texture tags, PolygonSelection tags, and whatnot, is going to be hell without some info about it. I mean, I don't have the source code to Cinema4D, so figuring out how to simulate existing operations from within the SDK is not exactly within my grasp.
Please provide a solution, thank you,
On 19/02/2003 at 03:31, xxxxxxxx wrote:
I am doing it just the way I have explained it to you, EVERY DAY in my current plugin!
One Nullobject that has objects as children. Here is the function I am using. You have to free the returned object yourself or insert it into a scene.
static BaseObject* GetConnectedObject(BaseDocument* doc,BaseObject* obj)
if (!obj) return NULL;
cd.doc = doc;
cd.op = obj;
if (!SendModelingCommand(MCOMMAND_JOIN,cd)) return NULL;
And don´t start telling me this doesn´t work. :)
P.S: Did the selectiontag thing work for you now?
On 19/02/2003 at 09:07, xxxxxxxx wrote:
Identical to the code that I used. You (and everyone else) forgot to mention this gem:
One would have figured that the object would be inserted automatically since it's calling a command, but I guess not.
Yes, the PolygonSelection tag is working. This is alot of work just to fix up an opened .obj file, most of which should not be necessary (such as proper names for the PS tags and their names added to their respective Texture tags' Restrictions.
Thanks for kicking me in the butt :)
On 19/02/2003 at 11:46, xxxxxxxx wrote:
No object is inserted automatically. In this case it is even stated in the docs.
btw. result1 doesn´t need to be casted. it´s already a baseobject.
On 19/02/2003 at 11:59, xxxxxxxx wrote:
Where? Not under SendModelingCommand() or in the mentioning of BaseObject and BaseDocument or in the Introduction. I mean, I haven't read every single word in this massive noodle of a doc and have only been doing this for about a week. That's why I'm asking questions. C++, I can program in my sleep with one arm severed. ;0) Just think, I haven't programmed C++ for at least two years, never used it extensively, and was up to speed in several days! This SDK, conversely, is going to require help to reach some understanding.
I just followed what was given in the doc (see first exampel [sic]).
Thanks for helping!! - it is appreciated!
On 19/02/2003 at 12:07, xxxxxxxx wrote:
in the ModelingCommandData.
I´m learning new things every day. And it´s good that way :)
On 19/02/2003 at 14:15, xxxxxxxx wrote:
"Creates undo and inserts newly created objects into SPAN title=ModelingCommandData::BaseDocument* doc"> color=#800080docSPAN class=silent/SPAN/SPAN, instead of returning in SPAN title=ModelingCommandData::BaseObject* result1"> color=#800080result1SPAN class=silent/SPAN/SPAN."
That's not very definitive and would only be of interest (reading about it) to someone implementing undo, which I am not doing here. Oh well...
Have become accustomed to the habit of tracing back through the base classes and method arguments to find things, so I guess that's a good start.
Definitely learning oodles of stull every day about the SDK. Further along than expected at this point and liking the results. :)
On 19/02/2003 at 14:22, xxxxxxxx wrote:
if you had the same code I had, then the flag (and therefore the description you are quoting) is not of interest! If you had looked a bit underneath you would have seen this note in result1 and even explains that it IS inserted only! if you have set the flag to .._CREATEUNDO:
Resulting object for commands that create a new object. Not u_<_a class=link href= "mk:@msitstore:d:\programme\microsoft%20visual%20studio\common\msdev98\addins\c4d_sdk_chm_reference.chm::/pages/operatingsystem/enum_modelingcommand366.html#modelingcommandflag_createundo0"_>_undo0">SPAN title=MODELINGCOMMAND_Flags::MODELINGCOMMANDFLAG_CREATEUNDO color=#0000ffMODELINGCOMMANDFLAG_CREATEUNDOSPAN class=silent/SPAN/SPAN_<_a class=link href= "mk:@msitstore:d:\programme\microsoft%20visual%20studio\common\msdev98\addins\c4d_sdk_chm_reference.chm::/pages/operatingsystem/struct_modelingcomma367.html#flags4"_>_ml#flags4">SPAN title=ModelingCommandData::LONG flags"> color=#606420flagsSPAN class=silent/SPAN/SPAN.
Note: You need to free this object yourself afterwards, or insert it into a document. <<<--------- you read this? :)
If you have to insert it into a document, the logical consequence is that it is not inserted automatically. ;)