find out if generator object?



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

    On 08/11/2012 at 08:28, xxxxxxxx wrote:

    Hi There,

    generator objects have a green hooklet next to the visibility indikator lights in the object manager. (for exapmle array, cloner but also cube or deformer).
    I found out that you can activate and deactivate them with:
    BaseObject.SetDeformMode(mode)
    and read them with
    BaseObject.GetDeformMode(mode)

    I was surprised to see that you also can set and read this parameters if an object doesnt habe the hooklet (for example a polygonobject)

    2 questions:
    - is it bad to set the deformmode to False (standard is True) if the object has no hooklet (for example a polygonobject)
    and if so:
    - is there a easier way do distinguish between them (generator not generator) than to compare it to a list of object types?

    thanks a lot
    Jops



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

    On 08/11/2012 at 11:31, xxxxxxxx wrote:

    1. I don't know but shouldn't think so
    2. call GetInfo() on the object and test for the flag OBJECT_GENERATOR

    In C++:

      
    if(obj->GetInfo( ) & OBJECT_GENERATOR)   
    {   
    // it is a generator...   
    }   
    else   
    {   
    // it isn't a generator   
    }   
    

    Note that primitive objects such as the Cube are also generators so the flag is set for such objects. If this matters you will have to test against a range of objects to exclude those you don't want. Or, you can also test for the flag OBJECT_INPUT - any generator which accepts another object as its input will have this set (e.g. the HyperNURBS) but the Cube etc. primitives will not.



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

    On 09/11/2012 at 01:55, xxxxxxxx wrote:

    Hi Spedler,

    thanks a lot your C++ code is nearly exactly the python code:

      
    if obj.GetInfo() & c4d.OBJECT_GENERATOR:   
        print "a generator"   
      
    else:   
        print "not a generator"   
    

    works perfect as far as I can see

    thanks again.
    Jops


Log in to reply