ok! finally, it is imporant to use the doc to get the irs !
now it works.
irs = c4d.modules.render.InitRenderStruct(doc)
is this the only / best way to check if textures are missing?
an alternative would be to actually check if the file is existing somewhere in the given paths
I also just ran into this...
< R24 you dont have BaseList2D.IsNodeBased, but as a small hack you can do:
return True if op.GetType == c4d.Mmaterial and '[Node]' in op.GetBubbleHelp() else False
hi and thanks Maxime !
GetAllAssetsNew() is S22 only,
and I had problems with InitRender() and Vray Bitmaps
so I decided to manually check for the files...
I had it already, but GenerateTexturePath() shortens the code quite a bit, because I dont have to check all possible paths.
It seem GenerateTexturePath() returns the absolute path, if the file is found somewhere in the texture paths, otherwise it returns None.
needs some testing, but until now it seems to work well.
Just FYI ...
I just noticed, that a Quicktab Radio UserData change results in two Messages (with the same UserData ID)
If I change the interface to Cycle, I get only one Message as expected for an UserData change.
This might be a tiny miny Bug (?)
below is a simple CommandData plugin with a submenu to invoke different actions.
This works fine if more than one of these plugins (with unique Plugin Ids ofc) are in one plugin folder.
But there is no menu if there is only one plugin present in the folder.
Is there a way to create such a menu with one plugin, while not registering each menu point as separate command?
# encoding: utf-8
''' CommandData Plugin with Menu '''
PLUGIN_ID = 12345678 # Unique Plugin Id
MENUID_CMD0 = 1000
MENUID_CMD1 = 1001
id=PLUGIN_ID, str="Test", info=c4d.PLUGINFLAG_COMMAND_HOTKEY, icon=None, help=None, dat=MenuHandler())
def GetSubContainer(self, doc, submenu):
bc = c4d.BaseContainer()
bc.SetString(MENUID_CMD0, "Command 0")
bc.SetString(MENUID_CMD1, "Command 1")
def ExecuteSubID(self, doc, id):
if id == MENUID_CMD0:
if id == MENUID_CMD1:
def Execute(self, doc):
if __name__ == "__main__":