Skip to content

Commit

Permalink
Passing id to the shapes created in the reader. (#734)
Browse files Browse the repository at this point in the history
Fixes #724
  • Loading branch information
sirpalee authored Apr 1, 2021
1 parent c1e352e commit 59628ca
Show file tree
Hide file tree
Showing 8 changed files with 401 additions and 0 deletions.
1 change: 1 addition & 0 deletions procedural/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ procedural_init
data->SetFrame(AiNodeGetFlt(node, "frame"));
data->SetDebug(AiNodeGetBool(node, "debug"));
data->SetThreadCount(AiNodeGetInt(node, "threads"));
data->SetId(AiNodeGetUInt(node, "id"));

AtNode *renderCam = AiUniverseGetCamera();
if (renderCam &&
Expand Down
5 changes: 5 additions & 0 deletions testsuite/test_0176/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Testing setting the id parameter on the procedural.

See usd#730

author: Pal Mezei
46 changes: 46 additions & 0 deletions testsuite/test_0176/data/builtin_shapes.usda
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#usda 1.0
(
defaultPrim = "cube"
)

def Cube "cube"
{
double size=2
float3 xformOp:translate= (4.8,0, 0)
uniform token[] xformOpOrder = ["xformOp:translate"]
}

def Sphere "sphere"
{
double radius=1.8
float3 xformOp:translate= (-4.8,0, 0)
uniform token[] xformOpOrder = ["xformOp:translate"]
}

def Cylinder "cylinder"
{
double radius=1.1
double height=3
token axis="Y"
float3 xformOp:translate= (0,0, 0)
uniform token[] xformOpOrder = ["xformOp:translate"]
}

def Cone "cone"
{
double radius=1.6
double height=2.7
token axis="X"
float3 xformOp:translate= (0,5, 0)
uniform token[] xformOpOrder = ["xformOp:translate"]
}

def Capsule "capsule"
{
double radius=1.6
double height=2.7
token axis="X"
float3 xformOp:translate= (4,5, 0)
uniform token[] xformOpOrder = ["xformOp:translate"]
}

162 changes: 162 additions & 0 deletions testsuite/test_0176/data/test.ass
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
### exported: Tue Dec 18 15:45:58 2018
### from: Arnold 5.2.2.0 [30b8ba14] windows icc-17.0.2 oiio-2.0.1 osl-1.10.1 vdb-4.0.0 clm-1.0.3.513 rlm-12.4.2 2018/12/04 22:02:04
### host app: MtoA 3.1.3.wip 7d48f6c4 (develop) Maya 2018
### bounds: -1 -1 -1 1 1 1
### user: blaines
### render_layer: defaultRenderLayer
### scene: D:/arnold/scenes/usd_builtin.ma



options
{
AA_samples 3
AA_samples_max 8
outputs "RGBA RGBA myfilter mydriver"
xres 960
yres 540
texture_per_file_stats on
texture_automip off
camera "perspShape"
frame 1
GI_diffuse_depth 1
GI_specular_depth 1
GI_transmission_depth 8
declare render_layer constant STRING
render_layer "defaultRenderLayer"
}

gaussian_filter
{
name myfilter
}

driver_tiff
{
name mydriver
filename "testrender.tif"
color_space "sRGB"
}

persp_camera
{
name perspShape
matrix
0.99999392 -1.08420217e-19 0.00349065149 0
0.000781565788 0.974611521 -0.223901182 0
-0.00340202916 0.223902553 0.97460562 0
-0.949623287 7.26941013 21.0998859 1
near_clip 0.100000001
far_clip 10000
screen_window_min -1 -1
screen_window_max 1 1
shutter_start 0
shutter_end 0
shutter_type "box"
rolling_shutter "off"
rolling_shutter_duration 0
motion_start 0
motion_end 0
exposure 0
fov 54.4322243
uv_remap 0 0 0 1
declare maya_full_name constant STRING
maya_full_name "|persp|perspShape"
}

usd
{
name aiUsdShape1
visibility 255
matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
use_light_group off
override_nodes off
filename "builtin_shapes.usda"
object_path "/cube"
frame 1
shader "myshader"
id 1
}

usd
{
name aiUsdShape2
visibility 255
matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
use_light_group off
override_nodes off
filename "builtin_shapes.usda"
object_path "/sphere"
frame 1
shader "myshader"
id 2
}

usd
{
name aiUsdShape3
visibility 255
matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
use_light_group off
override_nodes off
filename "builtin_shapes.usda"
object_path "/cylinder"
frame 1
shader "myshader"
id 3
}

usd
{
name aiUsdShape4
visibility 255
matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
use_light_group off
override_nodes off
filename "builtin_shapes.usda"
object_path "/cone"
frame 1
shader "myshader"
id 4
}

usd
{
name aiUsdShape5
visibility 255
matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
use_light_group off
override_nodes off
filename "builtin_shapes.usda"
object_path "/capsule"
frame 1
shader "myshader"
id 5
}

utility
{
name myshader
color_mode "id"
shade_mode "flat"
}
Loading

0 comments on commit 59628ca

Please sign in to comment.