Skip to content

Commit

Permalink
Used ScenePathPlugValueWidget for all appropriate plugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Apr 22, 2015
1 parent ab03f0a commit 6ee37e4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 28 deletions.
6 changes: 2 additions & 4 deletions python/GafferSceneUI/DuplicateUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import GafferUI

import GafferScene
import GafferSceneUI

##########################################################################
# Metadata
Expand Down Expand Up @@ -115,10 +116,7 @@
GafferUI.PlugValueWidget.registerCreator(
GafferScene.Duplicate,
"target",
lambda plug : GafferUI.PathPlugValueWidget(
plug,
path = GafferScene.ScenePath( plug.node()["in"], plug.node().scriptNode().context(), "/" ),
),
GafferSceneUI.ScenePathPlugValueWidget
)

GafferUI.PlugValueWidget.registerCreator( GafferScene.Duplicate, "transform", GafferUI.TransformPlugValueWidget, collapsed=None )
6 changes: 2 additions & 4 deletions python/GafferSceneUI/IsolateUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import GafferUI

import GafferScene
import GafferSceneUI

##########################################################################
# Metadata
Expand All @@ -61,8 +62,5 @@
GafferUI.PlugValueWidget.registerCreator(
GafferScene.Isolate,
"from",
lambda plug : GafferUI.PathPlugValueWidget(
plug,
path = GafferScene.ScenePath( plug.node()["in"], plug.node().scriptNode().context(), "/" ),
),
GafferSceneUI.ScenePathPlugValueWidget
)
20 changes: 16 additions & 4 deletions python/GafferSceneUI/MapProjectionUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,27 @@
#
##########################################################################

import IECore

import Gaffer
import GafferUI
import GafferScene
import GafferSceneUI

GafferUI.PlugValueWidget.registerCreator(
GafferScene.MapProjection,
"camera",
lambda plug : GafferUI.PathPlugValueWidget(
plug,
path = GafferScene.ScenePath( plug.node()["in"], plug.node().scriptNode().context(), "/" ),
),
GafferSceneUI.ScenePathPlugValueWidget
)

Gaffer.Metadata.registerPlugValue(
GafferScene.MapProjection,
"camera",
"scenePathPlugValueWidget:setNames", IECore.StringVectorData( [ "__cameras" ] )
)

Gaffer.Metadata.registerPlugValue(
GafferScene.MapProjection,
"camera",
"scenePathPlugValueWidget:setsLabel", "Show only cameras"
)
10 changes: 2 additions & 8 deletions python/GafferSceneUI/SceneNodeUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ def __noduleCreator( plug ) :
GafferUI.PlugValueWidget.registerCreator(
GafferScene.BranchCreator,
"parent",
lambda plug : GafferUI.PathPlugValueWidget(
plug,
path = GafferScene.ScenePath( plug.node()["in"], plug.node().scriptNode().context(), "/" ),
),
GafferSceneUI.ScenePathPlugValueWidget
)

# Group
Expand All @@ -124,10 +121,7 @@ def __noduleCreator( plug ) :
GafferUI.PlugValueWidget.registerCreator(
GafferScene.Constraint,
"target",
lambda plug : GafferUI.PathPlugValueWidget(
plug,
path = GafferScene.ScenePath( plug.node()["in"], plug.node().scriptNode().context(), "/" ),
),
GafferSceneUI.ScenePathPlugValueWidget
)

GafferUI.PlugValueWidget.registerCreator(
Expand Down
20 changes: 16 additions & 4 deletions python/GafferSceneUI/StandardOptionsUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@
#
##########################################################################

import IECore

import Gaffer
import GafferUI
import GafferScene
import GafferSceneUI

## \todo This is getting used in a few places now - maybe put it in one
# place? Maybe a static method on NumericWidget?
Expand Down Expand Up @@ -122,8 +125,17 @@ def __motionBlurSummary( plug ) :
GafferUI.PlugValueWidget.registerCreator(
GafferScene.StandardOptions,
"options.renderCamera.value",
lambda plug : GafferUI.PathPlugValueWidget(
plug,
path = GafferScene.ScenePath( plug.node()["in"], plug.node().scriptNode().context(), "/" ),
),
GafferSceneUI.ScenePathPlugValueWidget
)

Gaffer.Metadata.registerPlugValue(
GafferScene.StandardOptions,
"options.renderCamera.value",
"scenePathPlugValueWidget:setNames", IECore.StringVectorData( [ "__cameras" ] )
)

Gaffer.Metadata.registerPlugValue(
GafferScene.StandardOptions,
"options.renderCamera.value",
"scenePathPlugValueWidget:setsLabel", "Show only cameras"
)
5 changes: 1 addition & 4 deletions python/GafferSceneUI/SubTreeUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,5 @@
GafferUI.PlugValueWidget.registerCreator(
GafferScene.SubTree,
"root",
lambda plug : GafferUI.PathPlugValueWidget(
plug,
path = GafferScene.ScenePath( plug.node()["in"], plug.node().scriptNode().context(), "/" ),
),
GafferSceneUI.ScenePathPlugValueWidget
)

0 comments on commit 6ee37e4

Please sign in to comment.