@ferdinand Thank for your suggestions!
@ferdinand I think what I want is:
def PluginMessage(id, data):
if id == c4d.C4DPL_ENDPROGRAM:
with open(path, "w") as file:
it gets me a callback when c4d is being closing as Python SDK said
@c4ds thanks. I can not find pluginEnd() in Python.
why I want to rewrite res files is that I want to make the plugin name with multiple languages can be changed in the UI by users.
with a lot of difficults, finally I choose to use a json file with string plugin name. it means that plugin name with only one language can be created.
I can use json file with multiple languages too.but it is not more flexible than c4d strings file in res.
can I have a callback when I close the c4d ?
I want to rewrite c4dsymbols file and strings files in res folder when closing c4d.
because I don't know whether c4d would crash for the changes of c4dsymbols file and strings files in res folder when c4d is running.
I guess that c4d should not crash for changes.
but I don't want to risk changing text of files above when c4d is running if I have other solutions.
how can I update background color of bitmap button and static text when dialog have opened.update backgroundcolor in class 'commandData', but not in the class 'c4d.gui.Gialog'.
I know how to change the color of the gui elements, but I don't know how to update the background color after opening dialog. I have got a try with 'c4d.gui.GeUpateUI()', but I think it not suitable.
or can I use the userArea to replace the bitmap button and static text?
can you guys tell me the ways or get me an example. Thanks guys!
I just use 'global value' to settle this problem. it is not good way or good solution for coding. but I have to solve this problem in a short time because it is just a little part of my plugin. I have so many problems to deal with that I can not waste my time.I think the message of commandData will update or call back when this command gui updates, or message maybe update with other conditions.sorry! I just a newbie for programming.
@c4ds Thanks! I had changed my solution. Thank you to reply me!
@c4ds I had got a try.
I write codes:
commandPlugin=c4d.plugins.FindPllugin(the plugin id, c4d.PLUGINTYPE_ANY)
in GetCursorInfo() called back function of toolData.
if type== the integer:
in Message() called back function of commandData.
but the codes can't print "the integer" when I move the mouse with the toolData.
actually, I change codes like that:
in Message() called back function of commandData. .
but I still can not receive a message.
I want to change a value or execute a function in the commandData baesd on the mouse movement of toolData or a message from toolData
how can I make interactions between two or more plugins which are created in a single Python file, including the commandData plugin and the toolData plugin. now, I want to send a message from a toolData plugin to two or more commandData plugins if the 'if' conditions is Ture. but, I don't want to use global values in Python. How can I realize that. Thank guys!
@ferdinand and, do you know how to make a button hightight with a blue background like the attributes manager when selecting a panel？
edit: Forked form Add a GUI Button (by @ferdinand)