Navigation

    • Register
    • Login
    • Search
    1. Home
    2. César Vonc
    César Vonc

    César Vonc

    @César Vonc

    2
    Reputation
    14
    Posts
    142
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Website code.vonc.fr Location France

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    César Vonc Follow

    Best posts made by César Vonc

    Preset option with shortcut or custom layout in CommandData plugin

    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,

    posted in Cinema 4D SDK •
    RE: RenderDocument flags and return values?

    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)
    
    posted in Cinema 4D SDK •

    Latest posts made by César Vonc

    RE: RenderDocument flags and return values?

    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)
    
    posted in Cinema 4D SDK •
    RE: Plugins limitation count

    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

    posted in Cinema 4D SDK •
    Plugins limitation count

    Hello,

    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 ?

    posted in Cinema 4D SDK •
    RE: Preset option with shortcut or custom layout in CommandData plugin

    Thank you very much ! 🙂

    posted in Cinema 4D SDK •
    Preset option with shortcut or custom layout in CommandData plugin

    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,

    posted in Cinema 4D SDK •
    RE: Send Message to CommandData

    Aah ok, I misunderstood indeed. Thanks a lot for your complete answer. 🙂
    I take a look on all of this.

    posted in Cinema 4D SDK •
    RE: Send Message to CommandData

    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'}
    
    posted in Cinema 4D SDK •
    Send Message to CommandData

    Hello,

    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 ?

    posted in Cinema 4D SDK •
    RE: Falloff on Python deformer

    Amazing ! Thanks !

    posted in Cinema 4D SDK •
    Falloff on Python deformer

    Hello,

    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++ ?

    posted in Cinema 4D SDK •