Browse Source

added Print to log for rgbPanel

Dave Schuyler 24 years ago
parent
commit
9c29b6037d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      direct/src/tkwidgets/EntryScale.py

+ 5 - 0
direct/src/tkwidgets/EntryScale.py

@@ -490,6 +490,11 @@ def rgbPanel(nodePath, callback = None):
             esg.set((color[0], color[1], color[2], esg.getAt(3)))
             esg.set((color[0], color[1], color[2], esg.getAt(3)))
     menu.insert_command(index = 4, label = 'Popup Color Picker',
     menu.insert_command(index = 4, label = 'Popup Color Picker',
                         command = popupColorPicker)
                         command = popupColorPicker)
+    def printToLog(nodePath=nodePath):
+        c=nodePath.getColor()
+        print "Vec4(%.3f, %.3f, %.3f, %.3f)"%(c[0], c[1], c[2], c[3])
+    menu.insert_command(index = 5, label = 'Print to log',
+                        command = printToLog)
     
     
     # Set callback
     # Set callback
     def onRelease(r,g,b,a, nodePath = nodePath):
     def onRelease(r,g,b,a, nodePath = nodePath):