Navigation

    • Register
    • Login
    • Search
    1. Home
    2. Ling
    3. Posts
    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups

    Posts made by Ling

    RE: can I have a callback when I close the c4d?

    @ferdinand Thank for your suggestions!

    posted in Cinema 4D SDK •
    RE: can I have a callback when I close the c4d?

    @ferdinand I think what I want is:
    import c4d
    import os

    def PluginMessage(id, data):
    if id == c4d.C4DPL_ENDPROGRAM:
    path="T:\PythonDeveopment\test.txt"
    with open(path, "w") as file:
    file.write("test")
    return True
    return False

    it gets me a callback when c4d is being closing as Python SDK said

    posted in Cinema 4D SDK •
    RE: can I have a callback when I close the c4d?

    @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.

    posted in Cinema 4D SDK •
    can I have a callback when I close the c4d?

    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.

    posted in Cinema 4D SDK •
    update background color of bitmap button and static text

    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!

    posted in Cinema 4D SDK •
    RE: interactions between two or more plugins which are in a single Python file

    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.

    posted in Cinema 4D SDK •
    RE: interactions between two or more plugins which are in a single Python file

    @c4ds Thanks! I had changed my solution. Thank you to reply me!

    posted in Cinema 4D SDK •
    RE: interactions between two or more plugins which are in a single Python file

    @c4ds I had got a try.
    I write codes:

    commandPlugin=c4d.plugins.FindPllugin(the plugin id, c4d.PLUGINTYPE_ANY)
    commandPlugin.Message(the integer)
     in GetCursorInfo() called back function of toolData.
    and, codes:
    if type== the integer:
       print(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:
    print(the integer)
    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

    posted in Cinema 4D SDK •
    interactions between two or more plugins which are in a single Python file

    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!

    posted in Cinema 4D SDK •
    How to Highlight a Button

    @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)

    posted in Cinema 4D SDK •
    RE: how can I make popup like snap popup

    @m_adam I know the PLUGINFLAG_COMMAND_STICKY, but i do not know how can I judge the key down and key up in execute() called back function of the command data. Do you know a way to do this?
    Thanks!

    posted in Cinema 4D SDK •
    RE: how can I make popup like snap popup

    @m_adam is it possible to add a gadget like the top controller of a palette ?but not a window gadget like object manager window on the right-top corner.
    think you very much!

    posted in Cinema 4D SDK •
    RE: how can I make popup like snap popup

    @m_adam thanks, i would have a try

    posted in Cinema 4D SDK •