Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. aturtur
    A

    aturtur

    @aturtur

    1
    Reputation
    6
    Posts
    91
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    aturtur Follow

    Best posts made by aturtur

    Removing color picker from ColorField

    Hello!

    I'm creating simple GeDialog and I'm wondering is it possible to remove color picker that is now default in ColorField in C4D R20?

    For my use what I'm trying to achieve there is no need for color picker and it is taking too much space from my dialog.

    alt text

    Script:

    import c4d
    from c4d.gui import GeDialog
    
    class Dialog(GeDialog): 
        def __init__(self):
            super(Dialog, self).__init__()
     
        def CreateLayout(self):
            self.SetTitle("Dialog")
            self.GroupBegin(1000, c4d.BFH_LEFT, 0, 0)
            self.AddColorField(1001, c4d.BFH_CENTER)
            self.GroupEnd()
            return True
      
    dlg = Dialog()
    dlg.Open(c4d.DLG_TYPE_ASYNC, 0, -2, -2)
    
    posted in Cinema 4D SDK •

    Latest posts made by aturtur

    RE: ShowInFinder function in Cinema 4D S26

    Hi, not sure how I missed the solution from your first post. I need to be more careful. Thanks and sorry for the confusion.

    storage.ShowInFinder(folder, True)
    

    Works prefectly. Cheers!

    posted in Cinema 4D SDK •
    RE: ShowInFinder function in Cinema 4D S26

    Hi, sorry I totally forgot to tell the system specs. I did just a couple tests. Looks like it just was a Windows - Mac difference before.

    Windows 11 and Cinema 4D R26.013 -> Opens parent folder
    Windows 11 and Cinema 4D R25.117 -> Opens folder itself
    Windows 11 and Cinema 4D R21.207 -> Opens folder itself

    MacOS 12.3.1 (2018 MBP) and R26.013 -> Opens parent folder
    MacOS 12.3.1 (2018 MBP) and R21.207 -> Opens parent folder

    I'm gonna use following code to open straight to the folder location

    import os
    import c4d
    from c4d import storage
    
    def main():
    
        f = storage.GeGetC4DPath(c4d.C4D_PATH_PREFS) # Get preference folder path
        f = os.path.dirname(r''+f+'') # Go up
        f = os.path.join(f, '_bugreports') # Bug reports folder
        storage.ShowInFinder(f) # Open folder
    
        if c4d.GeGetCurrentOS() == c4d.OPERATINGSYSTEM_WIN: # If operating system is Windows
            os.startfile(folder)
        else: # If operating system is Mac
            os.system('open "%s"' % folder)
            
    if __name__=='__main__':
        main()
    

    Thanks for pointing out!

    posted in Cinema 4D SDK •
    ShowInFinder function in Cinema 4D S26

    Hi, just noticed that ShowInFinder function in Cinema 4D S26 opens the parent directory instead of the given directory, like in previous C4D versions. Is this a known change or a bug?

    Here is an example script that should open the _bugreports folder

    import os
    import c4d
    from c4d import storage
    
    def main():
        folder = storage.GeGetC4DPath(c4d.C4D_PATH_PREFS)
        folder = os.path.dirname(folder)
        folder = os.path.join(folder, '_bugreports')     
        storage.ShowInFinder(folder)
    
    if __name__=='__main__':
        main()
    

    It works in Cinema 4D R25 (and older versions) but in S26 it opens the parent directory of _bugreports instead.

    posted in Cinema 4D SDK •
    RE: R25 - Modal dialog's Color Chooser issue

    Hi, thanks for the information. Hopefully it will get fixed in the future updates.

    Cheers,
    Arttu

    posted in Cinema 4D SDK •
    R25 - Modal dialog's Color Chooser issue

    Hello. I recently hopped from R21 to R25 and noticed some weird behaviors with R25.

    If I create a modal dialog with a color field in it and try to open the color picker window by clicking the color field, it doens't open in R25. This works in R21.

    dialog_modal.jpg

    Code for the modal dialog setup:

    import c4d
    from c4d import gui
    from c4d.gui import GeDialog
    
    # Classes
    class Dialog(GeDialog):
        def __init__(self):
            super(Dialog, self).__init__()
            self.res = c4d.BaseContainer()
    
        # Create Dialog
        def CreateLayout(self):
            self.SetTitle("Dialog")
            self.GroupBegin(1000, c4d.BFH_CENTER, cols=1, rows=1, groupflags=1, initw=125, inith=0)
            self.GroupBorderSpace(5, 5, 5, 5)
            self.AddColorField(2002, c4d.BFH_FIT, initw=70, inith=13, colorflags=c4d.DR_COLORFIELD_POPUP)
            self.SetColorField(2003, c4d.Vector(0,0,0), 1, 1, c4d.DR_COLORFIELD_ENABLE_COLORWHEEL)
            self.GroupEnd()
            return True
    
    # Functions
    def main():
        dlg = Dialog() # Create dialog object
        dlg.Open(c4d.DLG_TYPE_MODAL, 0, -1, -1, 0, 0) # Open dialog
    
    # Execute main()
    if __name__=='__main__':
        main()
    

    When creating an asynchronous dialog, the color chooser window will pop up correctly.

    dialog_async.jpg

    Code for the async dialog setup:

    import c4d
    from c4d import gui
    from c4d.gui import GeDialog
    
    # Classes
    class Dialog(GeDialog):
        def __init__(self):
            super(Dialog, self).__init__()
            self.res = c4d.BaseContainer()
    
        # Create Dialog
        def CreateLayout(self):
            self.SetTitle("Dialog")
            self.GroupBegin(1000, c4d.BFH_CENTER, cols=1, rows=1, groupflags=1, initw=125, inith=0)
            self.GroupBorderSpace(5, 5, 5, 5)
            self.AddColorField(2002, c4d.BFH_FIT, initw=70, inith=13, colorflags=c4d.DR_COLORFIELD_POPUP)
            self.SetColorField(2003, c4d.Vector(0,0,0), 1, 1, c4d.DR_COLORFIELD_ENABLE_COLORWHEEL)
            self.GroupEnd()
            return True
    
    # Open async dialog
    dlg = Dialog() # Create dialog object
    dlg.Open(c4d.DLG_TYPE_ASYNC, 0, -1, -1, 0, 0) # Open dialog
    

    Is this a known bug or is something changed in the SDK that I should accomplish this an another way?

    Btw, also the color picker doesn't work in the R25's color chooser window.

    I'm running
    Cinema 4D R25.010
    Windows 10 (21H1)

    Cheers,
    Arttu

    posted in Cinema 4D SDK •
    Removing color picker from ColorField

    Hello!

    I'm creating simple GeDialog and I'm wondering is it possible to remove color picker that is now default in ColorField in C4D R20?

    For my use what I'm trying to achieve there is no need for color picker and it is taking too much space from my dialog.

    alt text

    Script:

    import c4d
    from c4d.gui import GeDialog
    
    class Dialog(GeDialog): 
        def __init__(self):
            super(Dialog, self).__init__()
     
        def CreateLayout(self):
            self.SetTitle("Dialog")
            self.GroupBegin(1000, c4d.BFH_LEFT, 0, 0)
            self.AddColorField(1001, c4d.BFH_CENTER)
            self.GroupEnd()
            return True
      
    dlg = Dialog()
    dlg.Open(c4d.DLG_TYPE_ASYNC, 0, -2, -2)
    
    posted in Cinema 4D SDK •