I need more nulls in my hierarchy with self icons



  • On 02/04/2017 at 17:34, xxxxxxxx wrote:

    Hi, everyone. I build preset for the cinema4d and now i trying convert this in plugin. I just start it! And i need some help!!! 
    What i have now
    http://drive.google.com/open?id=0B9-1-IWvbdKyWld1QXVvdFNFQkU

    What i need
    I need more nulls in my hierarchy with self icons 
    http://drive.google.com/open?id=0B9-1-IWvbdKyRnlWOG9nV1NqRms

    Code:
    import c4d
    from c4d import gui, plugins
    import os

    class NamePlugin(c4d.plugins.ObjectData) :
        
        def __init__(self) :
            self.SetOptimizeCache(True)
        
        def GetVirtualObjects(self, op, hierarchyhelp) :
            dirty = op.CheckCache(hierarchyhelp) or op.IsDirty(c4d.DIRTY_DATA)
            if dirty is False:
                return op.GetCache(hierarchyhelp)
        
        def Execute(self, op, doc, bt, priority, flags) :
            return True
            
     
    if __name__ == '__main__':
        #main()
        dir, file = os.path.split(__file__)
        bmp = c4d.bitmaps.BaseBitmap()
        bmp.InitWith(os.path.join(dir, "res", "Icon.png"))
        plugins.RegisterObjectPlugin(
            id = PLUGIN_ID,
            # название плагина, которое выводится в скобках
            str = "NamePlugin",
            g = NamePlugin,
            description = "NamePlugin",
            info = c4d.OBJECT_GENERATOR,
            icon = bmp
        )

    Please!!!!!!!!!!!!
    What i`m doing wrong?
    Please give me examples



  • On 03/04/2017 at 02:24, xxxxxxxx wrote:

    Hi,

    welcome to the Plugin Café forums 🙂

    I think, there's a misunderstanding, although I'm not hundred percent sure, as your screenshots could be interpreted in several ways.

    In general an ObjectData generator plugin is there for creating "virtual objects". So it creates an object (or an entire hierarchy of objects) based on input parameters and optionally also input objects (OBJECT_INPUT flag, when registering the plugin). In case of a created hierarchy, this will still not be visible to the user until the generator is "made editable". Also the generator can not create the input objects it needs, as it is not allowed to change the current scene, only the user can.

    By "only the user can", I also mean plugins that imitate user interaction, like CommandData plugins or scripts in Script Manager. Here you can build an arbitrary hierarchy of objects in a scene (of cause also creating ObjectData generators, like your custom one).



  • On 03/04/2017 at 02:35, xxxxxxxx wrote:

    Sorry. I need more nulls in my hierarchy with self icons . I don't understand how it work. )))))))))))))))


Log in to reply