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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    filename object

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 417 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 08/04/2013 at 05:46, xxxxxxxx wrote:

      Hey Guys,

      I have a problem with the Filename object - i can't find it.

      i have this entry in .res:

        
            FILENAME SERVERPATH {DIRECTORY;}  
      

      I would like to initialize it like so:

        
            self.InitAttr(op, c4d.Filename, [c4d.SERVERPATH])  
      

      But apparently Filename doesn't exist.

      How do i initialize a 'Filename' object?

      Any help is appreciated!

      Aurel

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

        On 08/04/2013 at 05:54, xxxxxxxx wrote:

        There is no filename object in Python. In dialogs, there is Get/SetFilename(). You could try
        to use SetFilename() on your objects container to initialize the attribute. I can not garuantee
        that it will work, but it may be a try worth.

        data = op.GetDataInstance()
        data.SetFilename(c4d.MYOBJECTPLUGIN_SERVERPATH, "")
        

        Please see the following post about naming conventions why I prefixed the SERVERPATH name.

        Best
        -Niklas

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

          On 08/04/2013 at 06:10, xxxxxxxx wrote:

          try string as type. if string does not work, you cannot use the filename customgui. 
          many custom guis require a certain datatype class which has to be wrapped for 
          python. the custom data types which have been wrapped for python can all be 
          found under c4d.CustomDataType.

          the same goes basically for the gui itself. if the customgui class is not wrapped 
          for python you might be not able to retrieve the desired data from the gui element,
          as the class and therefore the interface/methods are missing.

          c4d.Filename does obviously not work, because it is a type you just made up.

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

            On 10/04/2013 at 00:09, xxxxxxxx wrote:

            Hey,

            Thanks for the answers! I tried NiklasR's idea, and it works like a charm 😉 thanks!

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