-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
3dfb31c
commit 46ea6f2
Showing
8 changed files
with
247 additions
and
21 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
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,7 @@ | ||
Shaders exports should be bound to a material | ||
|
||
See #2047 | ||
|
||
author: sebastien ortega | ||
|
||
PARAMS: {'resaved':'usda'} |
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,127 @@ | ||
### exported: Thu Sep 12 08:53:34 2024 | ||
### from: Arnold 7.3.5.0 [6795639c] windows x86_64 clang-15.0.7 oiio-2.4.1 osl-1.13.0 vdb-11.0.0 adlsdk-8.0.7.50 clmhub-3.1.1.43 rlm-14.2.5 optix-8.0.0 2024/09/01 22:15:30 | ||
### host app: MtoA 5.4.5 41e56b38 (master) Maya 2024 | ||
### render_layer: defaultRenderLayer | ||
### user: blaines | ||
### scene: C:/arnold/mtoa/testsuite/test_0086/data/test.ma | ||
### meters_per_unit: 0.010000 | ||
|
||
|
||
|
||
standard_surface | ||
{ | ||
name aiStandard5 | ||
base 0.699999988 | ||
base_color 0 1 0 | ||
specular 0 | ||
specular_roughness 0.4669047 | ||
specular_IOR 10 | ||
subsurface_radius 0.100000001 0.100000001 0.100000001 | ||
coat_roughness 0 | ||
coat_IOR 10 | ||
declare material_surface constant STRING | ||
material_surface "aiStandard5SG" | ||
} | ||
|
||
range | ||
{ | ||
name displacementShader6 | ||
input checker3/cc.a | ||
output_min -1 | ||
output_max 0 | ||
contrast_pivot 0 | ||
declare material_displacement constant STRING | ||
material_displacement "aiStandard5SG" | ||
} | ||
|
||
checkerboard | ||
{ | ||
name checker3 | ||
color1 0 0 0 | ||
color2 1 1 1 | ||
u_frequency 16 | ||
v_frequency 16 | ||
u_offset 0 | ||
v_offset 0 | ||
filter_strength 0 | ||
uvset "" | ||
} | ||
|
||
color_correct | ||
{ | ||
name checker3/cc | ||
input checker3 | ||
alpha_is_luminance on | ||
} | ||
|
||
standard | ||
{ | ||
name aiStandard3 | ||
Kd_color 1 0 0 | ||
declare material_surface constant STRING | ||
material_surface "aiStandard3SG" | ||
} | ||
|
||
range | ||
{ | ||
name displacementShader4 | ||
input checker1 | ||
output_min 0 | ||
output_max 1 | ||
contrast_pivot 0 | ||
declare material_displacement constant STRING | ||
material_displacement "aiStandard3SG" | ||
} | ||
|
||
checkerboard | ||
{ | ||
name checker1 | ||
color1 0 0 0 | ||
color2 1 1 1 | ||
u_frequency 4 | ||
v_frequency 4 | ||
u_offset 0 | ||
v_offset 0 | ||
filter_strength 0 | ||
uvset "" | ||
} | ||
|
||
standard | ||
{ | ||
name aiStandard4 | ||
Kd_color 0 0 1 | ||
declare material_surface constant STRING | ||
material_surface "aiStandard4SG" | ||
} | ||
|
||
range | ||
{ | ||
name displacementShader5 | ||
input checker2/cc.a | ||
output_min 0 | ||
output_max 1 | ||
contrast_pivot 0 | ||
declare material_displacement constant STRING | ||
material_displacement "aiStandard4SG" | ||
} | ||
|
||
checkerboard | ||
{ | ||
name checker2 | ||
color1 0 0 0 | ||
color2 3 3 3 | ||
u_frequency 8 | ||
v_frequency 8 | ||
u_offset 0 | ||
v_offset 0 | ||
filter_strength 0 | ||
uvset "" | ||
} | ||
|
||
color_correct | ||
{ | ||
name checker2/cc | ||
input checker2 | ||
alpha_is_luminance on | ||
} | ||
|
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,46 @@ | ||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.join(os.environ['ARNOLD_PATH'], 'python')) | ||
from arnold import * | ||
|
||
AiBegin() | ||
universe = AiUniverse() | ||
|
||
usdScene = 'shaders_resaved.usda' | ||
AiSceneLoad(universe, 'shaders.ass', None) | ||
params = AiParamValueMap() | ||
AiParamValueMapSetInt(params, 'mask', AI_NODE_SHADER) | ||
AiSceneWrite(universe, usdScene, params) | ||
AiEnd() | ||
|
||
expectedLines = ['def Scope "mtl"', | ||
'def Material "aiStandard5SG"', | ||
'token outputs:arnold:displacement.connect = </displacementShader6.outputs:out>', | ||
'token outputs:arnold:surface.connect = </aiStandard5.outputs:out>', | ||
'def Material "aiStandard3SG"', | ||
'token outputs:arnold:displacement.connect = </displacementShader4.outputs:out>', | ||
'token outputs:arnold:surface.connect = </aiStandard3.outputs:out>', | ||
'def Material "aiStandard4SG"', | ||
'token outputs:arnold:displacement.connect = </displacementShader5.outputs:out>', | ||
'token outputs:arnold:surface.connect = </aiStandard4.outputs:out>'] | ||
|
||
expectedLinesCount = len(expectedLines) | ||
currentLine = 0 | ||
|
||
success = False | ||
with open(usdScene, 'r') as f: | ||
lines = f.readlines() | ||
for line in lines: | ||
if expectedLines[currentLine] in line: | ||
currentLine = currentLine + 1 | ||
if currentLine == expectedLinesCount: | ||
success = True | ||
break | ||
|
||
if not success: | ||
print('Line not found in the output usd file:') | ||
print(expectedLines[currentLine]) | ||
sys.exit(-1) | ||
|
||
print('SUCCESS') |