forked from wetadigital/USDPluginExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
23 lines (15 loc) · 765 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from pxr import Tf
from pxr.Usdviewq.plugin import PluginContainer
def DefineChildTriangle(usdviewApi):
for selectedPath in usdviewApi.selectedPaths:
usdviewApi.stage.DefinePrim(selectedPath.AppendChild("triangle"), "Triangle")
class UsdviewTriPluginContainer(PluginContainer):
def registerPlugins(self, plugRegistry, usdviewApi):
self._defineChildTriangle = plugRegistry.registerCommandPlugin(
"UsdviewTriPluginContainer.DefineChildTriangle",
"Define Child Triangle",
DefineChildTriangle)
def configureView(self, plugRegistry, plugUIBuilder):
triMenu = plugUIBuilder.findOrCreateMenu("Tri")
triMenu.addItem(self._defineChildTriangle)
Tf.Type.Define(UsdviewTriPluginContainer)