Hi @ferdinand , Thank you very much for your detailed reply. I think it is very helpful to me.
I try to register a CommandDataPlugin with PLUGINFLAG_COMMAND_HOTKE flags,
and i assign a shortcut key like this ; .
But when i press the shortcut key anything doesn't happen.
I don't know is i did something is wrong?
How can i do it's work correctly?
And the examle code like this:
def Execute(self, doc):
if __name__ == '__main__':
I see the "hotkey" plugin in cinema 4d like "Move Parent", and the shortcut is "7", and i need to press and hold down the shortcut key to execute the plugin.
(You can see the Type is Hotkey)
So how do i register the "hotkey" plugin in python?
Actually i find some hotkey stuf like Command plugin flag in SDK;
But i am not sure it's what i want, if it's what i want, how do i use it ? and how do i bind the shortcut key for the plugin ?
@ferdinand Thanks to your replay, Some of the features I wanted seemed to be addressed in the R25!
Let's rock and roll for R25!
I put a button in the menu bar and a want the button align to left.
And i use c4d.BFH_LEFT, but the button is still align to right.
Am I using it wrong?
Here is my code:
self.GroupBegin(2000, c4d.BFH_LEFT, 0, 1, "", 0, 0, 0)
self.AddButton(id=1000, flags=c4d.BFH_LEFT, name="Btn")
@ferdinand I will handle it.
Thanks for your help!
@ferdinand Mmmm...I still don't get it... there have a GIF to my problem;
I set the minimum value of height to 400 in the GetMinSize() like this:
return 0, 400
It does create the scrollbar, but the vertical range of the scrollbar is limited to 400,this prevents me from using the scroll bar to scroll down to see my all sunjects in the UserArea.
So how do I set the GetMinSize() so that the scrollbar exactly matches UserArea?
Hello？is anyone here?
I'm trying to change GetMinSize like this;
return 800, 500
it does create the scrollbar, but the vertical range of the scrollbar is limited to the values in GetMinSize, the contents in UserArea are not fully displayed, I'm not quite sure how do I set GetMinSize?
Help me please!
I have custom user area for showing multiple images ( like content browser layout in c4d )
And i want to scroll the user area, so i use ScrollGroupBegin() in CreateLayout() but its not work
Here is example code:
def DrawMsg(self, x1, y1, x2, y2, msg):
self.SetClippingRegion(x1, y1, x2, y2)
self.DrawRectangle(x1, y1, x2, y2)
return self.GetWidth(), self.GetHeight()
UA = MyUa() # UserArea
self.ScrollGroupBegin(5555, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT,
self.AddUserArea(6666, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT)
Now i know how to solve my problem!
Thank you for your reply.
How can i binding a keyboard shortcut to my CommandData plugin.
I find c4d.gui.AddShortcut() in sdk , but it's add shortcut every time of start c4d.
I'm not clear exactly what's wrong.
here is the simple code:
from c4d import gui, plugins
def Execute(self, doc):
print "Hello Cinema"
bc = c4d.BaseContainer()
plugins.RegisterCommandPlugin( 121212, "Shortcut Test", 0, None, "", CMDData())
I just read this（Connect C4D with Tkinter） post，It does seem to help me
Thank you again！
Thanks to replying me!
And looks like i need to try it in "CommandData plugin ", hope it works~
Is anyone here？
I need to use pyside for my plugin's GUI.
And i run Pyside in another C4Dthread.
It is possible to successfully open the Pyside window in C4D.
but there seem to be some problems.
-1.When I opened the Pyside window in C4D, the main thread seemed to be blocked, which made it impossible for me to interact with the C4D scene.
-2.When I first open the Pyside window, it will open normally, but when I close it and open it again, it will flicker on the screen and open it again, that is to say; After closing the window for the first time, I need to click twice to open the window.
And this is my code example:
label = QLabel(self)
# Put in your code here
# which you want to run
# in another thread
app = QApplication.instance()
if not app:
app = QApplication()
win = Window()
thread = UIThread()
# Do some other operations here
thread.Wait(True) # Wait until the main method is done
print "Pyside for c4d"