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

    I need more nulls in my hierarchy with self icons

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 408 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 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

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

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

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

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

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