Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. gheyret
    3. Posts
    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups

    Posts made by gheyret

    RE: Can i get global input event ?

    @ferdinand
    Wow~ Thank you so much bro

    posted in Cinema 4D SDK •
    Can i get global input event ?

    Hello everyone~
    I have a GeDialogwindow now. and i want to close it when my mouse click in anywhare.
    I can get the mouse click event in GeDialog.Message(), but it's just work inside of dialog.
    So i think maybe i need to get the global input event . But i can't find any method in SDK.
    How do i do that?

    posted in Cinema 4D SDK •
    RE: Material and Shader Questions

    @m_adam
    OK~ Thank you so much!

    posted in Cinema 4D SDK •
    Material and Shader Questions

    Hi guys!
    I want to get the shader preview image , but i can't find any method in Python SDK.

    So the question is :
    is there have some tricks to get shader preview image ?

    Another question is :
    Is that posible to change Material Preview size before i use BaseMaterial.GetPreview() ?
    Because i see the material preview image size is 90*90, it's small to me.

    posted in Cinema 4D SDK •
    RE: OpenGL in Cinema 4D

    @fwilleke80
    Yes, it's a solution. But it's can not to orbiting the scene or transforming the model.
    I think i need to make a desktop application, and make sure the window always on top.
    However, this will lead to more work for me.
    And thanks to your reply!
    cheers🥂

    posted in Cinema 4D SDK •
    RE: OpenGL in Cinema 4D

    @ferdinand
    Hi!
    Actually, i developed a simple model viewer using PyOpenGL and GLFW(for the window).
    And i don't know if i can use CINEMA 4D VIEWPORT(replace the GLFW) to show my own OpenGL things.
    So , clearly i need a dockable opengl window. is that possible?

    posted in Cinema 4D SDK •
    OpenGL in Cinema 4D

    hello everyone!
    is that posible to attach an OpenGL window to Cinema 4D GUI using python?
    if posible , how can i do that?

    posted in Cinema 4D SDK •
    RE: ShowBitmap() from website URL

    @ferdinand
    Wow! you perfectly solved my problem!
    Thank you! 🍻

    posted in Cinema 4D SDK •
    ShowBitmap() from website URL

    Hi! plugincafe~
    I try to get an image from website, And ShowBitmap() in C4D python.
    This is my simple code:

    import c4d
    from c4d import gui, bitmaps
    
    def main():
        img = "https://images.pexels.com/photos/10204089/pexels-photo-10204089.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
        bmp = bitmaps.BaseBitmap()
        a,b = bmp.InitWith(img)
        print(a,b)
        if a == c4d.IMAGERESULT_OK:
            bitmaps.ShowBitmap(bmp)
        bmp.FlushAll()
        
    # Execute main()
    if __name__=='__main__':
        main()
    

    Sometimes it can ShowBitmap() correctly like this:
    01.jpg

    Sometimes it's can show bitmap but the image is not loaded correctly:
    02.jpg

    And sometimes it's faild! And the InitWith() result is -6
    Is there have some right way to show an image from the URL?

    posted in Cinema 4D SDK •
    RE: How to Register "Hot key" plugin in python?

    Hi @ferdinand , Thank you very much for your detailed reply. I think it is very helpful to me.
    Cheers!

    posted in Cinema 4D SDK •
    RE: How to Register "Hot key" plugin in python?

    Hello !~~
    I'm waiting...

    posted in Cinema 4D SDK •
    RE: How to Register "Hot key" plugin in python?

    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:

    class Hotket(plugins.CommandData):
        def Execute(self, doc):
            print("Hotkey pressed")
    
            return True
    
    if __name__ == '__main__':
        plugins.RegisterCommandPlugin(1208170,"Hotkey Test",c4d.PLUGINFLAG_COMMAND_HOTKEY,None,"",Hotket())
    
    posted in Cinema 4D SDK •
    How to Register "Hot key" plugin in python?

    Hello !
    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)
    Snipaste_2021-09-16_15-32-35.jpg
    So how do i register the "hotkey" plugin in python?
    Actually i find some hotkey stuf like Command plugin flag in SDK;
    Snipaste_2021-09-16_15-41-49.jpg
    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 ?
    Thanks

    posted in Cinema 4D SDK •
    RE: c4d.BFH_LEFT is not work in menu line?

    @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!
    Cheers!

    posted in Cinema 4D SDK •
    c4d.BFH_LEFT is not work in menu line?

    Hello~
    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?

    Snipaste_2021-09-14_11-29-21.jpg

    Here is my code:

    def CreateLayout(self):
        self.GroupBeginInMenuLine()
        self.GroupBegin(2000, c4d.BFH_LEFT, 0, 1, "", 0, 0, 0)
        self.AddButton(id=1000, flags=c4d.BFH_LEFT, name="Btn")
        self.GroupEnd()
        self.GroupEnd()
        return True
    
    posted in Cinema 4D SDK •
    RE: ScrollGroupBegin() is not work in GeUserArea()

    @ferdinand I will handle it.
    Thanks for your help!
    Cheers~

    posted in Cinema 4D SDK •
    RE: ScrollGroupBegin() is not work in GeUserArea()

    @ferdinand Mmmm...I still don't get it... there have a GIF to my problem;
    p.gif

    I set the minimum value of height to 400 in the GetMinSize() like this:

    def GetMinSize(self):
        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?

    posted in Cinema 4D SDK •
    RE: ScrollGroupBegin() is not work in GeUserArea()

    Hello?is anyone here?😄

    posted in Cinema 4D SDK •
    RE: ScrollGroupBegin() is not work in GeUserArea()

    I'm trying to change GetMinSize like this;

    def GetMinSize(self):
        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!

    posted in Cinema 4D SDK •
    ScrollGroupBegin() is not work in GeUserArea()

    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:

    class MyUa(gui.GeUserArea):
    
        def DrawMsg(self, x1, y1, x2, y2, msg):
            self.OffScreenOn()
            self.SetClippingRegion(x1, y1, x2, y2)
            self.DrawSetPen(c4d.COLOR_BG)
            self.DrawRectangle(x1, y1, x2, y2)
            ...
    
        def GetMinSize(self):
            return self.GetWidth(), self.GetHeight()
        
    class MyDialog(gui.GeDialog):
        UA = MyUa() # UserArea
        
        def CreateLayout(self):
            self.ScrollGroupBegin(5555, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 
                                  c4d.SCROLLGROUP_VERT)
            self.AddUserArea(6666, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT)
            self.AttachUserArea(self.UA, 6666)
            self.GroupEnd()
            return True
    posted in Cinema 4D SDK •