switching based on objects type?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/05/2009 at 12:38, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   r11 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    is there a way to determine wether an object is a polygonobject (be it a primitive or any mesh) or a spline object(of whatever kind)

    or do i need to check against every possible type (Ocube,Osphere,...) and (Ospline,Osplinecircle,...)

    thanks in advance for your tips...

    cheers



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/05/2009 at 14:01, xxxxxxxx wrote:

    Not all primitives will become polygon objects when made edible. Until then, it is an Ocube, Osphere, etc - these are not Opolygon derived. Every 'object' in the Object Manager is derived from Obase. A few are derived from other things (Obasedeform or Opoint). Be careful checking for spline types as the protocol is different than IsInstanceOf().

    One way, albeit the hard way, would be to clone the object in question, make it editable, and test for Opolygon or Ospline, not forgetting to free the clone afterwards.

    I should add that BaseObject has a method GetRealSpline() which will return a SplineObject if the object is indeed a real spline, otherwise NULL. This might be a good direction to go but still doesn't help determine between, say, Obone, Olayer, and Ocube as proper polygon object candidates (hint: the first two listed here aren't).



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/05/2009 at 19:26, xxxxxxxx wrote:

    Howdy,

    You can test for a spline object with:

    > if((op->GetInfo()&OBJECT;\_ISSPLINE))

    ... and you can check for a geometric primitive object with:

    > if((op->GetInfo()&OBJECT;\_GENERATOR) && !(op->GetInfo()&OBJECT;\_INPUT))

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 09/05/2009 at 02:01, xxxxxxxx wrote:

    thank you both! that was exactly what i needed to know
    and as i already created a clone i can test for Opolygon and Ospline

    cheers,
    ello


Log in to reply