-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Hydra Generative Procedural Example of a simple Triangle
Signed-off-by: Seb Schmidt <[email protected]>
- Loading branch information
1 parent
aad3a75
commit 37fc7c4
Showing
10 changed files
with
464 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
usd_plugin(hdGpTri | ||
|
||
PUBLIC_HEADERS_INSTALL_PREFIX | ||
${ORGANIZATION} | ||
|
||
PYTHON_INSTALL_PREFIX | ||
${ORGANIZATION} | ||
|
||
LIBRARIES | ||
js | ||
plug | ||
tf | ||
sdf | ||
vt | ||
gf | ||
hdGp | ||
arch | ||
|
||
CPPFILES | ||
triGenerative.cpp | ||
debugCodes.cpp | ||
|
||
RESOURCE_FILES | ||
plugInfo.json | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Copyright © 2024 Weta Digital Limited | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#include "debugCodes.h" | ||
#include "pxr/base/tf/debug.h" | ||
#include <pxr/base/tf/registryManager.h> | ||
|
||
PXR_NAMESPACE_OPEN_SCOPE | ||
|
||
TF_REGISTRY_FUNCTION(TfDebug) | ||
{ | ||
TF_DEBUG_ENVIRONMENT_SYMBOL( | ||
USDTRI_GENERATIVE, "Debug symbol for the usdTri GenerativeProcedural."); | ||
} | ||
|
||
PXR_NAMESPACE_CLOSE_SCOPE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Copyright © 2024 Weta Digital Limited | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#pragma once | ||
|
||
#include <pxr/pxr.h> | ||
#include <pxr/base/tf/debug.h> | ||
|
||
PXR_NAMESPACE_OPEN_SCOPE | ||
|
||
TF_DEBUG_CODES(USDTRI_GENERATIVE); | ||
|
||
PXR_NAMESPACE_CLOSE_SCOPE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"Plugins": [ | ||
{ | ||
"Info": { | ||
"Types": { | ||
"TriProceduralPlugin": { | ||
"bases": [ | ||
"HdGpGenerativeProceduralPlugin" | ||
], | ||
"displayName": "triangle", | ||
"priority" : 0 | ||
} | ||
} | ||
}, | ||
"LibraryPath": "../../hdGpTri.so", | ||
"Name": "hdGpTri", | ||
"ResourcePath": "resources", | ||
"Root": "..", | ||
"Type": "library" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#usda 1.0 | ||
|
||
|
||
def Scope "World" | ||
{ | ||
def GenerativeProcedural "myGenerativeProc" ( | ||
prepend apiSchemas = ["HydraGenerativeProceduralAPI"] | ||
) | ||
{ | ||
token primvars:hdGp:proceduralType = "triangle" | ||
double primvars:sideLength = 1.0 | ||
} | ||
|
||
def Scope "leaf_transformed" | ||
{ | ||
|
||
def GenerativeProcedural "myGenerativeProcTransformed" ( | ||
prepend apiSchemas = ["HydraGenerativeProceduralAPI"] | ||
) | ||
{ | ||
token primvars:hdGp:proceduralType = "triangle" | ||
double primvars:sideLength = 1.0 | ||
|
||
matrix4d xformOp:transform:transform1 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (15, 15, 15, 1) ) | ||
uniform token[] xformOpOrder = ["xformOp:transform:transform1"] | ||
} | ||
} | ||
def Xform "transformed" | ||
{ | ||
matrix4d xformOp:transform:transform1 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (15, 15, 15, 1) ) | ||
uniform token[] xformOpOrder = ["xformOp:transform:transform1"] | ||
|
||
def GenerativeProcedural "myGenerativeProcTransformed" ( | ||
prepend apiSchemas = ["HydraGenerativeProceduralAPI"] | ||
) | ||
{ | ||
token primvars:hdGp:proceduralType = "triangle" | ||
double primvars:sideLength = 1.0 | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#usda 1.0 | ||
( | ||
startFrame = 1 | ||
endFrame = 10 | ||
) | ||
|
||
def Scope "World" | ||
{ | ||
def GenerativeProcedural "myGenerativeProcAnimated" ( | ||
prepend apiSchemas = ["HydraGenerativeProceduralAPI"] | ||
) | ||
{ | ||
token primvars:hdGp:proceduralType = "triangle" | ||
double primvars:sideLength = 1.0 | ||
double primvars:sideLength.timeSamples = { | ||
1: 1, | ||
10: 10 | ||
} | ||
|
||
matrix4d xformOp:transform:transform1 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (30, 30, 30, 1) ) | ||
uniform token[] xformOpOrder = ["xformOp:transform:transform1"] | ||
} | ||
} |
Oops, something went wrong.