Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
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.
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)
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!
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!
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.
Hi, thanks for the information. Hopefully it will get fixed in the future updates.
Cheers, Arttu
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.
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.
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)