Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hello,
I have a CommandData Python plugin that contains different options.
When I assign a shortcut to my CommandData, or add it to a custom layout, it opens with the default options.
Is is possible to define different shortcuts or custom layout icons that pass parameters to my CommandData plugin and then preset different options ?
For example, imagine a shortcut that execute the Optimize command with the Unused Points checked, and an other one unchecked. Is it possible ?
Thanks,
Just for the info, calling the command to open the PictureViewer and RenderDocument with both c4d.RENDERFLAGS_CREATE_PICTUREVIEWER and c4d.RENDERFLAGS_OPEN_PICTUREVIEWER works just fine for me :
c4d.CallCommand(430000700) # Picture Viewer c4d.documents.RenderDocument(doc, rdData, bmp, c4d.RENDERFLAGS_EXTERNAL | c4d.RENDERFLAGS_CREATE_PICTUREVIEWER | c4d.RENDERFLAGS_OPEN_PICTUREVIEWER)
Hello, it's indeed about Python plugins on S24 and R25 and OSX, and I guess other C4D version and OS.
It's a shame that it is limited to 50 ObjectData, 50 TagData, etc.., the common user will not check the console window and will think it's a bug from the plugin.
I hope it wil change one day.
Thanks for your answer
I have a customer that can't install a plugin, I check his console and I see the message :
OSError : cannot handle more than 50 object plugins.
As it's tagged with "OSError", I guess it depends of the OS, what can we do to increase this limitation ?
Thank you very much !
Aah ok, I misunderstood indeed. Thanks a lot for your complete answer. I take a look on all of this.
Mm, it did not work for me, the message was still not triggered even with a message ID higher than ID_TREEVIEW_FIRST_NEW_ID.
I managed in a different way with PluginMessage and c4d.GePluginMessage
But contrarely to what say doc, it's not the easiest way if you want to pass some data lol, the data received from PluginMessage is not an object but a PyCapsule object.
Here is how I retreived the original data object, it's not very elegant but it works :
import ctypes import _ctypes def getObjectFromCapsule(capsule): ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p ctypes.pythonapi.PyCapsule_GetPointer.argtypes = [ctypes.py_object, ctypes.c_char_p] pointer = ctypes.pythonapi.PyCapsule_GetPointer(capsule, None) return _ctypes.PyObj_FromPtr(pointer) def PluginMessage(id, data): if id == MY_UNIQUE_ID : o = getObjectFromCapsule(data) o['foo'] = 'bar' return True return False
And then in my other plugin :
o = {} print(c4d.GePluginMessage(MY_UNIQUE_ID, o)) # {'foo': 'bar'}
I try to send a message to a CommandData plugin like this :
class MyPlugin(plugins.CommandData): def Message(self, type, data): print("test", type, data) return True if __name__ == "__main__" : plugins.RegisterCommandPlugin(id=1057321, str="test", info=0, help="", dat=MyPlugin(), icon=None )
And then send the message like this in the console :
c4d.plugins.FindPlugin(1057321).Message(123)
It returns True but nothing print. Do you know why ?
Amazing ! Thanks !
The question was posted some years ago but I would like to know if with all the last updates there is now a possibility to add a falloff tab on a Python deformer plugin like in C++ ?