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