THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/01/2012 at 09:43, xxxxxxxx wrote:
Cinema 4D Version: R12/13
Language(s) : C++ ;
Having struggled with this all day, I've come to the conclusion that CurrentStateToObject is a pig. Why does it do things so differently to different objects?
* create an extrude nurbs and put a tag on the nurbs object. Do CSTO and you get a poly object plus two subordinate objects, and the tag is on the top-level poly object.
* put a cube in a hypernurbs and drop a tag on the HN. Do CSTO and you get a single poly object (but see below for the exception) but the tag has vanished! What happened to the tag, and why can't CSTO always produce a single polygon object?
* with a cube in an HN, move the cube so that its world position is different to that of the HN. Now do CSTO and you get a null containing the poly object. Why is that necessary?
* with an extrude nurbs move the spline away from the nurbs in the scene and do CSTO, this time no null is created to hold the result. Why the difference?
CSTO looks like a function which got tinkered with over the years until what's left is an unholy mess. And then we have to code round it, testing for all kinds of possible outcomes, which takes forever (and then you still find something which doesn't work correctly).
Okay, rant over. I feel better now. But seriously, is this just me or is CSTO in dire need of an update?
On 31/01/2012 at 10:45, xxxxxxxx wrote:
Most of this has to do with Cinema 4D's cache build (see GetDeformCache() in the SDK docs, for instance). What is returned by CSTO depends upon the the cache build results basically. Yes, it is messy since sometimes you get a nice polygon object, other times you get a Null object with a bunch of objects underneath. I've made a little method which gets the polygon objects and ignores the Null object since, for my uses, it is not necessary - I want the polygon object result(s), not the Null object.
On 31/01/2012 at 10:48, xxxxxxxx wrote:
Yes, I've had to write a similar routine as well. What really got me was the missing tag on some objects processed by CSTO. Took me ages to figure out why a particular routine wasn't working.
On 31/01/2012 at 10:53, xxxxxxxx wrote:
Tags are a real pain with this. If I remember correctly, a HN will become a Null object and all of the Texture tags on the child polygon objects will be placed on the Null object (insane!). And, yes, I have a routine to move them back.
On 31/01/2012 at 15:06, xxxxxxxx wrote:
Same problem here ...
As I really just wanted to get 1 poly object and I do not care about tags, I thought why not select the whole hierarchy and do a "Connect&Delete" command.
But guess what ... that command is nowhere to find ??
So, stuck too.
On 01/02/2012 at 01:19, xxxxxxxx wrote:
Yes, that's an issue but a smaller one. After you do current state to object, get the topmost object in the returned hierarchy and do another SendModelingCommand but with MCOMMAND_JOIN. That seems to work for me. Note that it returns another new object in addition to the new object returned by CSTO.
On 01/02/2012 at 11:03, xxxxxxxx wrote:
ok, thank you, I will check if that works out for me too