Skip to content
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 3 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pxr/usd/plugin/usdAbc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pxr_test_scripts(
testenv/testUsdAbcConversionSubdiv.py
testenv/testUsdAbcFaceset.py
testenv/testUsdAbcIndexedProperties.py
testenv/testUsdAbcIndexedGeomArb.py
testenv/testUsdAbcInstancing.py
testenv/testUsdAbcIsConstant.py
testenv/testUsdAbcP_OldEncoding.py
Expand Down Expand Up @@ -113,6 +114,11 @@ pxr_install_test_dir(
DEST testUsdAbcIndexedProperties
)

pxr_install_test_dir(
SRC testenv/testUsdAbcIndexedGeomArb
DEST testUsdAbcIndexedGeomArb
)

pxr_install_test_dir(
SRC testenv/testUsdAbcInstancing
DEST testUsdAbcInstancing
Expand Down Expand Up @@ -205,6 +211,15 @@ pxr_register_test(testUsdAbcIndexedProperties
USD_ABC_TESTSUFFIX=def
)

pxr_register_test(testUsdAbcIndexedGeomArb
PYTHON
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdAbcIndexedGeomArb"
DIFF_COMPARE bad_primvars_namespace_before_fix.usda
Copy link
Member

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 !

Copy link
Author

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.

EXPECTED_RETURN_CODE 0
ENV
USD_ABC_TESTSUFFIX=def
)

pxr_register_test(testUsdAbcInstancing
PYTHON
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdAbcInstancing"
Expand Down
3 changes: 3 additions & 0 deletions pxr/usd/plugin/usdAbc/alembicReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ _CleanName(
name = attempt;
}

if (name == "vals")
return "";

return name;
}

Expand Down
38 changes: 38 additions & 0 deletions pxr/usd/plugin/usdAbc/testenv/testUsdAbcIndexedGeomArb.py
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()
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"]
}

Loading