-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removes redundant "vals" namespace from the primvars namespace when r… #1635
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,6 +302,9 @@ _CleanName( | |
name = attempt; | ||
} | ||
|
||
if (name == "vals") | ||
return ""; | ||
|
||
return name; | ||
} | ||
|
||
|
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,38 @@ | ||
#!/pxrpythonsubst | ||
# | ||
# Copyright 2017 Pixar | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
# with the following modification; you may not use this file except in | ||
# compliance with the Apache License and the following modification to it: | ||
# Section 6. Trademarks. is deleted and replaced with: | ||
# | ||
# 6. Trademarks. This License does not grant permission to use the trade | ||
# names, trademarks, service marks, or product names of the Licensor | ||
# and its affiliates, except as required to comply with Section 4(c) of | ||
# the License and to reproduce the content of the NOTICE file. | ||
# | ||
# You may obtain a copy of the Apache License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the Apache License with the above modification is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the Apache License for the specific | ||
# language governing permissions and limitations under the Apache License. | ||
|
||
import unittest, os, sys | ||
|
||
class TestUsdAbcIndexedGeomArb(unittest.TestCase): | ||
def test_IndexedGeomArb(self): | ||
name = "hasColorSet.abc" | ||
abcFile = os.path.join("testUsdAbcIndexedGeomArb", name) | ||
cmd = 'usdcat' | ||
if sys.platform.startswith('win'): | ||
cmd = 'usdcat.exe' | ||
|
||
os.system("%s %s" % (cmd, abcFile)) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
227 changes: 227 additions & 0 deletions
227
...usd/plugin/usdAbc/testenv/testUsdAbcIndexedGeomArb/bad_primvars_namespace_before_fix.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,227 @@ | ||
#usda 1.0 | ||
( | ||
defaultPrim = "hasColorSet" | ||
doc = "Exported from: /home/belal/maya/projects/default/untitled" | ||
endTimeCode = 0 | ||
startTimeCode = 0 | ||
upAxis = "Y" | ||
) | ||
|
||
def Mesh "hasColorSet" | ||
{ | ||
float3[] extent.timeSamples = { | ||
0: [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)], | ||
} | ||
int[] faceVertexCounts.timeSamples = { | ||
0: [4, 4, 4, 4, 4, 4], | ||
} | ||
int[] faceVertexIndices.timeSamples = { | ||
0: [2, 3, 1, 0, 4, 5, 3, 2, 6, 7, 5, 4, 0, 1, 7, 6, 3, 5, 7, 1, 4, 2, 0, 6], | ||
} | ||
normal3f[] normals ( | ||
interpolation = "faceVarying" | ||
) | ||
normal3f[] normals.timeSamples = { | ||
0: [(0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, -1, 0), (0, -1, 0), (0, -1, 0), (0, -1, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0)], | ||
} | ||
uniform token orientation = "leftHanded" | ||
point3f[] points ( | ||
interpolation = "vertex" | ||
) | ||
point3f[] points.timeSamples = { | ||
0: [(-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (-0.5, 0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5)], | ||
} | ||
custom color3f[] primvars:colorSet:vals ( | ||
interpolation = "faceVarying" | ||
) | ||
color3f[] primvars:colorSet:vals.timeSamples = { | ||
0: [(1, 1, 1)], | ||
} | ||
custom uint[] primvars:colorSet:indices | ||
uint[] primvars:colorSet:indices.timeSamples = { | ||
0: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | ||
} | ||
custom int[] primvars:rman_subdivFacevaryingInterp | ||
int[] primvars:rman_subdivFacevaryingInterp.timeSamples = { | ||
0: [3], | ||
} | ||
custom int[] primvars:rman_subdivInterp | ||
int[] primvars:rman_subdivInterp.timeSamples = { | ||
0: [1], | ||
} | ||
custom int[] primvars:rman_subdivScheme | ||
int[] primvars:rman_subdivScheme.timeSamples = { | ||
0: [0], | ||
} | ||
texCoord2f[] primvars:st ( | ||
interpolation = "faceVarying" | ||
) | ||
texCoord2f[] primvars:st.timeSamples = { | ||
0: [(0.375, 0), (0.625, 0), (0.375, 0.25), (0.625, 0.25), (0.375, 0.5), (0.625, 0.5), (0.375, 0.75), (0.625, 0.75), (0.375, 1), (0.625, 1), (0.875, 0), (0.875, 0.25), (0.125, 0), (0.125, 0.25)], | ||
} | ||
int[] primvars:st:indices ( | ||
interpolation = "faceVarying" | ||
) | ||
int[] primvars:st:indices.timeSamples = { | ||
0: [2, 3, 1, 0, 4, 5, 3, 2, 6, 7, 5, 4, 8, 9, 7, 6, 3, 11, 10, 1, 13, 2, 0, 12], | ||
} | ||
custom color3f[] primvars:vary | ||
color3f[] primvars:vary.timeSamples = { | ||
0: [(0.6061388, 0.80782884, 0.73636574)], | ||
} | ||
uniform token subdivisionScheme = "none" | ||
custom string userProperties:ast | ||
string userProperties:ast.timeSamples = { | ||
0: "usdAttr", | ||
} | ||
custom vector3d userProperties:astPos | ||
vector3d userProperties:astPos.timeSamples = { | ||
0: (-0.291868483303249, 0.04075033237193182, 0), | ||
} | ||
custom string userProperties:born | ||
string userProperties:born.timeSamples = { | ||
0: "TASK00016161", | ||
} | ||
custom string userProperties:category | ||
string userProperties:category.timeSamples = { | ||
0: "props", | ||
} | ||
custom string userProperties:context | ||
string userProperties:context.timeSamples = { | ||
0: "model", | ||
} | ||
custom string userProperties:mat | ||
string userProperties:mat.timeSamples = { | ||
0: "", | ||
} | ||
custom string userProperties:name | ||
string userProperties:name.timeSamples = { | ||
0: "hasColorSet", | ||
} | ||
custom string userProperties:phz | ||
string userProperties:phz.timeSamples = { | ||
0: "TASK00016161.usdAttr.model.v001", | ||
} | ||
custom string userProperties:shd | ||
string userProperties:shd.timeSamples = { | ||
0: "", | ||
} | ||
custom string userProperties:version | ||
string userProperties:version.timeSamples = { | ||
0: "001", | ||
} | ||
matrix4d xformOp:transform.timeSamples = { | ||
0: ( (4.13739892044428, 0, 0, 0), (0, 4.13739892044428, 0, 0), (0, 0, 4.13739892044428, 0), (3.0579145030432717, 2.109449792594072, 0, 1) ), | ||
} | ||
uniform token[] xformOpOrder = ["xformOp:transform"] | ||
} | ||
|
||
def Mesh "hasColorSetCalledVals" | ||
{ | ||
float3[] extent.timeSamples = { | ||
0: [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)], | ||
} | ||
int[] faceVertexCounts.timeSamples = { | ||
0: [4, 4, 4, 4, 4, 4], | ||
} | ||
int[] faceVertexIndices.timeSamples = { | ||
0: [2, 3, 1, 0, 4, 5, 3, 2, 6, 7, 5, 4, 0, 1, 7, 6, 3, 5, 7, 1, 4, 2, 0, 6], | ||
} | ||
normal3f[] normals ( | ||
interpolation = "faceVarying" | ||
) | ||
normal3f[] normals.timeSamples = { | ||
0: [(0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, -1, 0), (0, -1, 0), (0, -1, 0), (0, -1, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0)], | ||
} | ||
uniform token orientation = "leftHanded" | ||
point3f[] points ( | ||
interpolation = "vertex" | ||
) | ||
point3f[] points.timeSamples = { | ||
0: [(-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (-0.5, 0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5)], | ||
} | ||
custom int[] primvars:rman_subdivFacevaryingInterp | ||
int[] primvars:rman_subdivFacevaryingInterp.timeSamples = { | ||
0: [3], | ||
} | ||
custom int[] primvars:rman_subdivInterp | ||
int[] primvars:rman_subdivInterp.timeSamples = { | ||
0: [1], | ||
} | ||
custom int[] primvars:rman_subdivScheme | ||
int[] primvars:rman_subdivScheme.timeSamples = { | ||
0: [0], | ||
} | ||
texCoord2f[] primvars:st ( | ||
interpolation = "faceVarying" | ||
) | ||
texCoord2f[] primvars:st.timeSamples = { | ||
0: [(0.375, 0), (0.625, 0), (0.375, 0.25), (0.625, 0.25), (0.375, 0.5), (0.625, 0.5), (0.375, 0.75), (0.625, 0.75), (0.375, 1), (0.625, 1), (0.875, 0), (0.875, 0.25), (0.125, 0), (0.125, 0.25)], | ||
} | ||
int[] primvars:st:indices ( | ||
interpolation = "faceVarying" | ||
) | ||
int[] primvars:st:indices.timeSamples = { | ||
0: [2, 3, 1, 0, 4, 5, 3, 2, 6, 7, 5, 4, 8, 9, 7, 6, 3, 11, 10, 1, 13, 2, 0, 12], | ||
} | ||
custom color3f[] primvars:vals:vals ( | ||
interpolation = "faceVarying" | ||
) | ||
color3f[] primvars:vals:vals.timeSamples = { | ||
0: [(1, 1, 1)], | ||
} | ||
custom uint[] primvars:vals:indices | ||
uint[] primvars:vals:indices.timeSamples = { | ||
0: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | ||
} | ||
custom color3f[] primvars:vary | ||
color3f[] primvars:vary.timeSamples = { | ||
0: [(0.07901141, 0.01605987, 0.87536705)], | ||
} | ||
uniform token subdivisionScheme = "none" | ||
custom string userProperties:ast | ||
string userProperties:ast.timeSamples = { | ||
0: "usdAttr", | ||
} | ||
custom vector3d userProperties:astPos | ||
vector3d userProperties:astPos.timeSamples = { | ||
0: (-0.291868483303249, 0.04075033237193182, 0), | ||
} | ||
custom string userProperties:born | ||
string userProperties:born.timeSamples = { | ||
0: "TASK00016161", | ||
} | ||
custom string userProperties:category | ||
string userProperties:category.timeSamples = { | ||
0: "props", | ||
} | ||
custom string userProperties:context | ||
string userProperties:context.timeSamples = { | ||
0: "model", | ||
} | ||
custom string userProperties:mat | ||
string userProperties:mat.timeSamples = { | ||
0: "", | ||
} | ||
custom string userProperties:name | ||
string userProperties:name.timeSamples = { | ||
0: "hasColorSetCalledVals", | ||
} | ||
custom string userProperties:phz | ||
string userProperties:phz.timeSamples = { | ||
0: "TASK00016161.usdAttr.model.v001", | ||
} | ||
custom string userProperties:shd | ||
string userProperties:shd.timeSamples = { | ||
0: "", | ||
} | ||
custom string userProperties:version | ||
string userProperties:version.timeSamples = { | ||
0: "001", | ||
} | ||
matrix4d xformOp:transform.timeSamples = { | ||
0: ( (4.13739892044428, 0, 0, 0), (0, 4.13739892044428, 0, 0), (0, 0, 4.13739892044428, 0), (-3.641651469649769, 2.109449792594072, 0, 1) ), | ||
} | ||
uniform token[] xformOpOrder = ["xformOp:transform"] | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we be comparing to the "good" , after-fix baseline, here? And I don't think we need the "bad" version included in the PR - I only mentioned it so that you could have an extra validation that your fix works by running the test against the good baseline, without your fix, to see that the test fails, a la test-driven development.
Thanks, @BSalem !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest, I didn't ever work with tests modules, so I'm not familiar with their dependencies and how it work... I blindly followed the example you shared.
I just pushed an updated one though.