Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    Character object access

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 424 Views
    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 Offline
      Helper
      last edited by

      On 30/10/2015 at 06:21, xxxxxxxx wrote:

      Hi
      I now how to access the Character Object and its methods from the different python tabs on the Character Object itself. (Character component tags python tab etc)

      But how do i access a Character Object from another python tag or a script in the script manager.

        
      #Get the BaseObject   
      myCharacterObject = doc.SearchObject("Character")   
      #Get the CharacterObject   
      ...   
      

      Any help is appreciated.

      -b

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

        On 02/11/2015 at 10:37, xxxxxxxx wrote:

        Hi Bonsak,

        the question is, what do you mean by accessing the Character object?

        For example in Script Manager you can simply do this (assuming Character object is selected, otherwise your SearchObject() should work as well), in order to access settings of the Character object:

        def main() :
          if op is None or not op.CheckType(c4d.Ocharacter) :
            print "No character object, please select a character object"
            return
          op[c4d.ID_CA_CHARACTER_TEMPLATE] = 0 # Switch to Advanced Quadruped
          c4d.EventAdd()
        

        If you want to "press" the buttons it gets a bit more complicated, as you can't simply use CallButton(). So it would be good to know, where you are heading?

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

          On 02/11/2015 at 12:15, xxxxxxxx wrote:

          Thanks Andreas. I need to use some of the methods in c4d.modules.character.builder on the Character object, but i can't figure out how to get there 🙂
          If i have a character object selected and do like this:

            
          import c4d   
          from c4d.modules.character import builder as BU   
            
          def main() :   
              char = BU.CharacterObject(op)   
              print char # Returns <c4d.modules.character.builder.CharacterObject object at 0x12f260288>   
              print char.GetObject() # Returns "None" ?   
                 
          if __name__=='__main__':   
              main()   
          

          Some of the methods i would like to use are: GetComponents(), PostInsertComponent(), IncludeObjects(), but i can't figure out how.

          -b

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

            On 03/11/2015 at 05:30, xxxxxxxx wrote:

            Hi Bonsak,

            I'm afraid that is not possible. The module you discovered (it's described in the User manual for the Character Component tag) can really only be used within the Character Component tag. Sorry.

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

              On 03/11/2015 at 05:34, xxxxxxxx wrote:

              Ok. Thanks anyway Andreas.

              -b

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