Skip to content

Fix a bug where newer RenderMan shading nodes would be skipped when exporting Usd from Maya#3999

Open
katpet wants to merge 4 commits intoAutodesk:devfrom
katpet:rman-nodes-export-update
Open

Fix a bug where newer RenderMan shading nodes would be skipped when exporting Usd from Maya#3999
katpet wants to merge 4 commits intoAutodesk:devfrom
katpet:rman-nodes-export-update

Conversation

@katpet
Copy link
Contributor

@katpet katpet commented Nov 14, 2024

Fix a bug where newer RenderMan shading nodes would be skipped when exporting Usd from Maya. There is a hardcoded map in maya-usd/lib/mayaUsd/fileio/shading/rfmShaderMap.h, and newer nodes that don't appear in that map were being skipped. I don't think the map is necessary for nodes that don't actually require a name mapping; it would be difficult to keep the list up to date. This change adds some code that falls back to assuming the rendermanForMaya writer is appropriate for nodes that would otherwise have been skipped.

Fix a bug where newer RenderMan shading nodes would be skipped when exporting Usd from Maya. There is a hardcoded map in maya-usd/lib/mayaUsd/fileio/shading/rfmShaderMap.h, and newer nodes that don't appear in that map were being skipped. I don't think the map is necessary for nodes that don't actually require a name mapping; it would be difficult to keep the list up to date. This change adds some code that falls back to assuming the rendermanForMaya writer is appropriate for nodes that would otherwise have been skipped.
@katpet
Copy link
Contributor Author

katpet commented Nov 14, 2024

This was my first time digging into this code, so there may be a better way to go about this. Or there may be some conditional necessary before going ahead and using the rendermanForMaya writer for unknown nodes. This change does fix the bug for my examples though. Let me know if you need advice on reproducing the problem.

@seando-adsk
Copy link
Collaborator

@katpet Thank you for submitting a pull-request, however before proceeding you will need to sign the Contributor License Agreement (CLA).

Sean

@seando-adsk seando-adsk added the do-not-merge-yet Development is not finished, PR not ready for merge label Nov 18, 2024
@seando-adsk seando-adsk closed this Feb 5, 2025
@seando-adsk
Copy link
Collaborator

@katpet Closing this PR as we never received a signed CLA from you. If you wish to continue please submit a signed CLA.

Sean

@katpet
Copy link
Contributor Author

katpet commented Apr 1, 2025

Hi, I believe a CLA has been submitted by my company. Can this pull request be reopened?

@seando-adsk
Copy link
Collaborator

@katpet Yes feel free to reopen. Can you verify if the CLA was sent (to email address). I haven't received any CLA yet.

Sean

@neilh-adsk neilh-adsk reopened this May 30, 2025
@neilh-adsk
Copy link
Collaborator

New updated CLA received, reopened the PR

@seando-adsk seando-adsk removed the do-not-merge-yet Development is not finished, PR not ready for merge label Sep 22, 2025
seando-adsk
seando-adsk previously approved these changes Sep 22, 2025
@seando-adsk seando-adsk added legacy rendering Related to draw override rendering import-export Related to Import and/or Export and removed legacy rendering Related to draw override rendering labels Sep 22, 2025
@seando-adsk
Copy link
Collaborator

@katpet Sorry for the delay. I missed that the CLA had been submitted and this PR was stuck in "do not merge" state. I've started the preflight.

@seando-adsk seando-adsk assigned katpet and unassigned katpet Sep 22, 2025
@seando-adsk
Copy link
Collaborator

@katpet Unfortunately there are test errors on every platform and version of Maya:

======================================================================
ERROR: testEditAndBatchMergeRigMayaRefs (testCacheToUsd.CacheToUsdTestCase)
Test editing then merge a Maya Reference to a complex animated rig.
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../maya-usd/test/lib/mayaUsd/fileio/testCacheToUsd.py", line 555, in testEditAndBatchMergeRigMayaRefs
    self.assertTrue(mayaUsd.lib.PrimUpdaterManager.mergeToUsd(rigMayaPathAndOptions))
pxr.Tf.ErrorException:
	Error in 'pxrInternal_v0_22__pxrReserved__::UsdMaya_RegistryHelper::AddUnloader' at line 354 in file .../maya-usd/lib/mayaUsd/fileio/registryHelper.cpp : 'Couldn't add unload function (was this function called from outside a TF_REGISTRY_FUNCTION block?)'

======================================================================
ERROR: testEditAndMergeRigMayaRef (testCacheToUsd.CacheToUsdTestCase)
Test editing then merge a Maya Reference to a complex animated rig.
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../maya-usd/test/lib/mayaUsd/fileio/testCacheToUsd.py", line 499, in testEditAndMergeRigMayaRef
    self.assertTrue(mayaUsd.lib.PrimUpdaterManager.mergeToUsd(aMayaPathStr, userArgs))
pxr.Tf.ErrorException:
	Error in 'pxrInternal_v0_22__pxrReserved__::UsdMaya_RegistryHelper::AddUnloader' at line 354 in file .../maya-usd/lib/mayaUsd/fileio/registryHelper.cpp : 'Couldn't add unload function (was this function called from outside a TF_REGISTRY_FUNCTION block?)'

======================================================================
FAIL: testUsdPreviewSurfaceRoundtripMetallic (testUsdExportImportRoundtripPreviewSurface.testUsdExportImportRoundtripPreviewSurface)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../maya-usd/test/lib/usd/translators/testUsdExportImportRoundtripPreviewSurface.py", line 65, in testUsdPreviewSurfaceRoundtripMetallic
    self.__testUsdPreviewSurfaceRoundtrip(metallic=True)
  File ".../maya-usd/test/lib/usd/translators/testUsdExportImportRoundtripPreviewSurface.py", line 218, in __testUsdPreviewSurfaceRoundtrip
    self.assertTrue(mark.IsClean())
AssertionError: False is not true

@seando-adsk
Copy link
Collaborator

@katpet Did you ever get a chance to look into the preflight test failures?

Sean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

import-export Related to Import and/or Export

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants