• Creating a Clickable Floating GUI Dialog?

    Cinema 4D SDK python r21
    2
    0 Votes
    2 Posts
    370 Views
    B
    Stupid me. I already asked the same question a year ago here: https://developers.maxon.net/forum/topic/11472/dialogue-box-manager-through-plug-in-vs-vanilla-script/5 Anyhow, for anyone interested on the working plug-in code. Here it is import c4d from c4d import bitmaps, documents, gui, plugins, threading, utils PLUGIN_ID = 1011323 class MyDialog(gui.GeDialog): def CreateLayout(self): #self.SetTitle('Colorizer') # Prepare a red bitmap for the button. w = 50 h = 50 bmpRed = c4d.bitmaps.BaseBitmap() bmpRed.Init(w, h) for y in xrange(w): for x in xrange(h): bmpRed.SetPixel(x, y, 255, 0, 0) # BitmapButton configuration bcBitmapButton = c4d.BaseContainer() bcBitmapButton[c4d.BITMAPBUTTON_BUTTON] = True # Add a BitmapButton to the dialog. # _bitmapButton is a member variable of the dialog class buttonId = 2000 _bitmapButton = self.AddCustomGui(buttonId, c4d.CUSTOMGUI_BITMAPBUTTON, "", c4d.BFH_CENTER|c4d.BFV_CENTER, w, h, bcBitmapButton) if _bitmapButton is None: print "Handle this error!" # Assign the image to the button. # Note: Let it create an internal copy as the created bitmap will be free'd, when scope is left. _bitmapButton.SetImage(bmpRed, True) def Command(self, id, msg): if id==2000: # corresponds to the button ID used in the code snippet in the first answer in this thread print "My Bitmap Button" return True class MyMenuPlugin(plugins.CommandData): dialog = None def Execute(self, doc): # create the dialog if self.dialog is None: self.dialog = MyDialog() return self.dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC, pluginid=PLUGIN_ID, defaultw=200, defaulth=150, xpos=-1, ypos=-1) def RestoreLayout(self, sec_ref): # manage the dialog if self.dialog is None: self.dialog = MyDialog() return self.dialog.Restore(pluginid=PLUGIN_ID, secret=sec_ref) if __name__ == "__main__": okyn = plugins.RegisterCommandPlugin(PLUGIN_ID, "Cubey",0, None, "Cubey initialized", MyMenuPlugin()) if (okyn): print "Cubey initialized"
  • A Curl like POST using NetworkHttpHandlerRef?

    General Talk r21 c++
    8
    0 Votes
    8 Posts
    1k Views
    ManuelM
    hello, i'll be set this thread as resolved tomorrow if nothing to add. Cheers Manuel
  • Objects created in real time

    Cinema 4D SDK python r19 r21 r20
    6
    0 Votes
    6 Posts
    1k Views
    ManuelM
    Hello, For your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here. Q&A New Functionality. How to Post Questions especially the tagging part. @zipit and @Cairyn have already answer here (thanks a lot) nothing to add. Cheers, Manuel
  • python combobox get current value

    Cinema 4D SDK r21 r20 r19 python
    4
    0 Votes
    4 Posts
    841 Views
    ManuelM
    Hello, For your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here. Q&A New Functionality. How to Post Questions especially the tagging part. I've already done for this thread. I can just confirm what @zipit said. Nothing to add Cheers, Manuel
  • R21 Opencl issue

    Cinema 4D SDK r21
    3
    2
    0 Votes
    3 Posts
    441 Views
    ManuelM
    hello, I'll mark this thread as solved tomorrow if you have nothing to add. Cheers, Manuel
  • Interact with Plugin Dialog [R21][Win][python]

    Cinema 4D SDK python r21 r20 r19
    7
    0 Votes
    7 Posts
    1k Views
    ManuelM
    hello, I'll mark this thread as solved tomorrow if you have nothing to add. Cheers, Manuel
  • 0 Votes
    3 Posts
    519 Views
    CairynC
    @m_adam Thanks, yes, you're right, a timer may be my best choice here to avoid too much load on the system. Checking the project list every 3 seconds or so should suffice for the usecases. And since I'm in a GeDialog, the timer function is easy to implement. (I just have to take care that within the 3 seconds, the state of the dialog may be inconsistent with the actual system state.)
  • Python on Linux missing submodule?

    General Talk
    2
    0 Votes
    2 Posts
    630 Views
    r_giganteR
    Hi fyeng, thanks for reaching out us. With regard to your question, I confirm that the workflow you're trying to achieve using the python executable found among the Linux CLR modules is not possible since only c4dpy, as you've already seen, has access to all the needed modules. Best, Riccardo
  • Keyframe Selection Code from Cineversity

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    403 Views
    B
    @zipit Thanks for the clarification. Yea, I guess so but just learning as much as I can. Thanks again!
  • More Examples for GeUserArea?

    Cinema 4D SDK r21 python
    7
    0 Votes
    7 Posts
    1k Views
    B
    Hi @zipit Apologies for the late response. Your code sample looks interesting. And yep, close to what I was looking for. Stacking columns of clickable images/text I keep looking back at it every now and then but I have to admit, it's beyond me at the moment really beyond me at the moment. Maybe I was just a bit spoiled with other GUI interface such as tkinter or PyQT, where it is relatively easy to implement. Just copy some code and modify some parts. Or maybe there are just more available examples in tkinter and PyQT that fits my need. Will get back to this topic when I have the necessary skillset. Sorry for the trouble and thanks again.
  • 0 Votes
    3 Posts
    597 Views
    J
    @m_magalhaes thanks, looking forward to the next update
  • Vertical View of the Timeline

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    460 Views
    B
    RE: The only possible solution for you would be to develop your own timeline. Okay. Not going that route. Hahaha. Thanks for the confirmation!
  • One Liner Console?

    Cinema 4D SDK r21 python
    4
    0 Votes
    4 Posts
    537 Views
    M
    I can only confirm it's not possible in Cinema 4D. The thing that matches the more is the Command Line windows. Cheers, Maxime.
  • Plugin porting to R20(R21) MacOS problem.

    Cinema 4D SDK r20 c++ r21
    6
    0 Votes
    6 Posts
    1k Views
    WTools3DW
    So my problem was actually not related to OSX but to compatibility issues between minor releases. Thanks to your replies I sorted it out. And I finally understand your versioning concept. Thank you Manuel, good job! Regards, Viktor Veličko WTools3D s.r.o. www.lwcad.com
  • plugins folder, now you see me, now you don't.

    General Talk
    16
    0 Votes
    16 Posts
    11k Views
    ManuelM
    hello, I confirm it's strange. Could you use the g_console=true and g_logfile=d:\logfile.txt as said in this page (both will contain the same lines) Send us the logfile ([email protected]) if you don't want to share that in public. Cheers, Manuel
  • 0 Votes
    4 Posts
    861 Views
    G
    Thank You @m_magalhaes and @zipit Both your suggestions were very helpful. The controller works very well @m_magalhaes I just needed to convert my user data input to BaseTime and it works perfectly. I was able to solve the updating issue to work how I want. I only needed to add: c4d.GeSyncMessage(c4d.EVMSG_TIMECHANGED) Now my timeline markers update nicely as I change values. This topic can be marked solved.
  • R21 CommandData with option - not working on macOS

    Cinema 4D SDK
    11
    0 Votes
    11 Posts
    2k Views
    P
    Ok, thanks @r_gigante... I'll keeping going with the workaround.
  • Store a keyframe as a variable?

    Cinema 4D SDK r21 python
    10
    0 Votes
    10 Posts
    1k Views
    B
    Interesting. Thanks for the further clarification!
  • Is there a way to change the GvNode Port Index

    Cinema 4D SDK c++ r21
    6
    0 Votes
    6 Posts
    910 Views
    M
    @Jmelon I'm sorry there is no specific message sent to the GvOperatorData It's all handled in the UI. Cheers, Maxime.
  • BaseLink from maxon::Uuid

    Cinema 4D SDK r21 c++
    3
    0 Votes
    3 Posts
    688 Views
    A
    ok thanks for the info @m_adam.