Skip to content

Commit

Permalink
USD to SDF: Initial commit (#827)
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <[email protected]>
Co-authored-by: Ashton Larkin <[email protected]>
  • Loading branch information
ahcorde and adlarkin authored Mar 9, 2022
1 parent 41d370d commit 346f3ae
Show file tree
Hide file tree
Showing 17 changed files with 2,155 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
204 changes: 204 additions & 0 deletions test/usd/upAxisY.usda
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
#usda 1.0
(
metersPerUnit = 1.0
upAxis = "Y"
)

def "shapes"
{
def PhysicsScene "physics"
{
vector3f physics:gravityDirection = (0, 0, -1)
float physics:gravityMagnitude = 9.8
}

def Xform "ground_plane"
{
float3 xformOp:rotateXYZ = (0, 0, 0)
double3 xformOp:translate = (0, 0, -0.125)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ"]

def Xform "link"
{
float3 xformOp:rotateXYZ = (0, 0, 0)
double3 xformOp:translate = (0, 0, 0)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ"]

def Xform "visual"
{
float3 xformOp:rotateXYZ = (0, 0, 0)
double3 xformOp:translate = (0, 0, 0)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ"]

def Cube "geometry" (
prepend apiSchemas = ["PhysicsCollisionAPI"]
)
{
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
rel material:binding = </Looks/Material_0>
double size = 1
float3 xformOp:scale = (100, 100, 0.25)
uniform token[] xformOpOrder = ["xformOp:scale"]
}
}
}
}

def Xform "box"
{
float3 xformOp:rotateXYZ = (0, 0, 0)
double3 xformOp:translate = (0, 0, 0.5)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ"]

def Xform "box_link" (
prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"]
)
{
point3f physics:centerOfMass = (0, 0, 0)
float3 physics:diagonalInertia = (0.16666, 0.16666, 0.16666)
float physics:mass = 1
float3 xformOp:rotateXYZ = (0, 0, 0)
double3 xformOp:translate = (0, 0, 0)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ"]

def Xform "box_visual"
{
float3 xformOp:rotateXYZ = (0, 0, 0)
double3 xformOp:translate = (0, 0, 0)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ"]

def Cube "geometry" (
prepend apiSchemas = ["PhysicsCollisionAPI"]
)
{
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
rel material:binding = </Looks/Material_1>
double size = 1
float3 xformOp:scale = (1, 1, 1)
uniform token[] xformOpOrder = ["xformOp:scale"]
}
}
}
}

def Scope "Looks"
{
def Material "Material_0"
{
token outputs:mdl:displacement.connect = </Looks/Material_0/Shader.outputs:out>
token outputs:mdl:surface.connect = </Looks/Material_0/Shader.outputs:out>
token outputs:mdl:volume.connect = </Looks/Material_0/Shader.outputs:out>

def Shader "Shader"
{
uniform token info:implementationSource = "sourceAsset"
uniform asset info:mdl:sourceAsset = @OmniPBR.mdl@
uniform token info:mdl:sourceAsset:subIdentifier = "OmniPBR"
color3f inputs:diffuse_color_constant = (0.8, 0.8, 0.8) (
customData = {
float3 default = (0.2, 0.2, 0.2)
dictionary range = {
float3 max = (100000, 100000, 100000)
float3 min = (0, 0, 0)
}
}
displayGroup = "Albedo"
displayName = "Base Color"
doc = "This is the base color"
)
color3f inputs:emissive_color = (0, 0, 0) (
customData = {
float3 default = (1, 0.1, 0.1)
dictionary range = {
float3 max = (100000, 100000, 100000)
float3 min = (0, 0, 0)
}
}
displayGroup = "Emissive"
displayName = "Emissive Color"
doc = "The emission color"
)
float inputs:emissive_intensity = 1 (
customData = {
int default = 40
dictionary range = {
int max = 100000
int min = 0
}
}
displayGroup = "Emissive"
displayName = "Emissive Intensity"
doc = "Intensity of the emission"
)
bool inputs:enable_emission = 1 (
customData = {
int default = 0
}
displayGroup = "Emissive"
displayName = "Enable Emissive"
doc = "Enables the emission of light from the material"
)
token outputs:out
}
}

def Material "Material_1"
{
token outputs:mdl:displacement.connect = </Looks/Material_1/Shader.outputs:out>
token outputs:mdl:surface.connect = </Looks/Material_1/Shader.outputs:out>
token outputs:mdl:volume.connect = </Looks/Material_1/Shader.outputs:out>

def Shader "Shader"
{
uniform token info:implementationSource = "sourceAsset"
uniform asset info:mdl:sourceAsset = @OmniPBR.mdl@
uniform token info:mdl:sourceAsset:subIdentifier = "OmniPBR"
color3f inputs:diffuse_color_constant = (1, 0, 0) (
customData = {
float3 default = (0.2, 0.2, 0.2)
dictionary range = {
float3 max = (100000, 100000, 100000)
float3 min = (0, 0, 0)
}
}
displayGroup = "Albedo"
displayName = "Base Color"
doc = "This is the base color"
)
color3f inputs:emissive_color = (0, 0, 0) (
customData = {
float3 default = (1, 0.1, 0.1)
dictionary range = {
float3 max = (100000, 100000, 100000)
float3 min = (0, 0, 0)
}
}
displayGroup = "Emissive"
displayName = "Emissive Color"
doc = "The emission color"
)
float inputs:emissive_intensity = 1 (
customData = {
int default = 40
dictionary range = {
int max = 100000
int min = 0
}
}
displayGroup = "Emissive"
displayName = "Emissive Intensity"
doc = "Intensity of the emission"
)
bool inputs:enable_emission = 1 (
customData = {
int default = 0
}
displayGroup = "Emissive"
displayName = "Enable Emissive"
doc = "Enables the emission of light from the material"
)
token outputs:out
}
}
}
}
Loading

0 comments on commit 346f3ae

Please sign in to comment.