filename object



  • 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



  • 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



  • 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.



  • 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!


Log in to reply