Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    find out if generator object?

    PYTHON Development
    0
    3
    449
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post