After a few mails with Ferdinand I switched to a Tag plugin solution. This does the job perfectly.
So the solution was not to use an Object data solution but a TagData.
Thanx!
After a few mails with Ferdinand I switched to a Tag plugin solution. This does the job perfectly.
So the solution was not to use an Object data solution but a TagData.
Thanx!
Hi,
In short I build a plugin that's the same as the tiling camera in de C4D Lib. However the plugin does not update when it is not selected. Same thing when I render. How can I update / execute the plugin on every frame or change in the viewport like an xpresso tag for example.
Below a small part of the code. The tiling camera is just 1 function of many.
class RAARCGEN(plugins.ObjectData):
if licenpass:
include ('id')
include ('reninit')
include('iconchange')
include('initvar')
include('finalrender')
#include('proxy')
hashpass=False
def __init__(self):
self.SetOptimizeCache(True)
def Message(self, node, type, data):
data = node.GetDataInstance()
#for name in searchNames(type):
# print type, name
global doc
doc = c4d.documents.GetActiveDocument()
if type==c4d.MSG_MENUPREPARE:
InitVariables(doc,data)
elif type==1036465: #trigger for placing object in the include/exclude field
RelisInExc(doc, data)
elif type==1036464: #trigger for removing object in the include/exclude field
RelisInExc(doc, data)
#elif type==431000094 or type==c4d.MSG_DESCRIPTION_COMMAND:
#updatemodule(node,self)
return True
def Init(self, node):
print ("test")
return True
def GetDEnabling(self, node, id, t_data, flags, itemdesc):
data = node.GetDataInstance()
if data is None: return
ID = id[0].id
updatemodule(node,self)
#if (ID==FR_MAN):
# updatemodule(node,self)
if (ID in {RENDER_ENGINE , RENDER_Q , GI_ENABLED , AO_ENABLED,FR_RENDER_Q} ):
if data.GetBool(REN_BOOL) == False: return False
if (ID in {MY_SUBBOX} ):
if data.GetBool(ONOFF_ENABLED) == False: return False
if (ID in {FILELOC , FILENAME , FILESUB , DESKPATH, FILCUST, FILEPATH} ):
if data.GetBool(FILE_BOOL) == False: return False
if (ID in {CUSRENTEXT , RENDER_SIZE , CUSSIZEW , CUSSIZEH, CUSRATIOLOCK, CUSRENUNIT, CUSRESO , BACKRENFILE , BACKRENRES , BACKRENVIS, FR_RENDER_SET ,TILINGCAM,TILINGR,TCAMSRC,TCAMTAR,CAMAXIS,RENDER_SIZE_TILE,FRAME_SELEC,MFRAMESEL}):
if data.GetBool(SIZEMAN) == False: return False
if (ID in {ABOUT_TEXT} ):
return False
if (ID in {PROXY_BOOL}):
if data.GetBool(PROXY_BOOL)==False:
checkLayer = doc.GetLayerObjectRoot().GetDown()
while checkLayer:
if checkLayer.GetName() == 'Proxy viewport' or checkLayer.GetName() == 'Proxy render':
newLayer = checkLayer
newLayer.Remove()
checkLayer = checkLayer.GetNext()
if (ID in {FRPROXYFORCERENDER,PROXYFORCEVIEW,PROXYFORCERENDER,OBJECT1_BOOL,OBJECT2_BOOL,OBJECT3_BOOL,OBJECT4_BOOL,OBJECT5_BOOL,OBJECT6_BOOL,OBJECT7_BOOL,OBJECT8_BOOL,OBJECT9_BOOL,OBJECT10_BOOL,
PROXY1,PROXY2,PROXY3,PROXY4,PROXY5,PROXY6,PROXY7,PROXY8,PROXY9,PROXY10,
OBJECT1,OBJECT2,OBJECT3,OBJECT4,OBJECT5,OBJECT6,OBJECT7,OBJECT8,OBJECT9,OBJECT10}):
if data.GetBool(PROXY_BOOL)==False: return False
return True
return True
if __name__ == "__main__":
if licenpass:
path, file = os.path.split(__file__)
bmp = bitmaps.BaseBitmap()
bmp.InitWith(os.path.join(path, "res", "Fire_base.png"))
plugins.RegisterObjectPlugin(id=PLUGIN_ID, str=PLUGIN_NAME,
g=RAARCGEN,
description="raarc", icon=bmp,
info=c4d.OBJECT_GENERATOR)
Many thanx in advance