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

[EMSUSD-1783] mayaUSDExport with append=True not behaving as expected #3336

Open
noahbindertaylor opened this issue Sep 19, 2023 · 4 comments
Assignees
Labels
bug Something isn't working reproduced Issue has been reproduced

Comments

@noahbindertaylor
Copy link

The behavior of mayaUSDExport(append=True) does not seem useful for animation, so I’m a bit unclear what its use case is. 

Reference behavior

If we specify multiple frames in the args for mayaUSDExport, not using append, we get the expected timeSamples in the USD

cmds.mayaUSDExport(...., frameRange=(1, 4), append=False)

here’s an example snippet from the results with 4 timeSamples we’d expect:

float3 xformOp:rotateXYZ.timeSamples = { 
1: (, 92.013664, 0), 
2: (0, 88.858185, 0), 
3: (0, 80.40151, 0), 
4: (0, 68.158264, 0) 
}

This is the output we expect to get when using append=True

Actual behavior 

If we timestep ourselves and call mayaUSDExport(append=True, …) on each timeSample, we see that subsequent timeSamples have channelX added (one per frame, numbered 1 to numTimeSamples) - which doesn’t result in usable animated USD

for frame in range(1,5):
    cmds.mayaUSDExport(...., frameRange=(frame, frame), append=True)
float3 xformOp:rotateXYZ.timeSamples = { 1: (0, 92.013664, 0), } 
float3 xformOp:rotateXYZ:channel1.timeSamples = { 2: (0, 88.858185, 0), } 
float3 xformOp:rotateXYZ:channel2.timeSamples = { 3: (0, 80.40151, 0), } 
float3 xformOp:rotateXYZ:channel3.timeSamples = { 4: (0, 68.158264, 0), }

Above shows an xformOp after Opening a USD on frame 1, then appending to the same USD on frames 2, 3 & 4.  We expect to see the same result as in the first example.

The same .channelX results for any USD feature that accepts timeSamples when using append within mayaUSDExport command.  

Is this behavior intended or is it a bug?

Background 

We would like to export different subsets of a scene with different settings, potentially to different files, using one timeline evaluation for efficiency.   Our hope is that the append flag of mayaUSDExport could allow the caller to take complete control of the timeline evaluation, appending samples to existing USD files in whatever manner they choose.  

Example use cases

  • Oversample Rates Per Node: tag objects within a hierarchy to receive more time samples, but still have all the objects in the hierarchy exported to the same file

  • Export different “fragments” to different files (e.g. primvars to one file, P, N, faceIndices, UVs to another, etc), then layer them together in a post process. 

The key thing is to do this efficiently, without resorting to multiple evaluations of the timeline, which can be very slow for multiple computationally heavy rigs or heavy scenes

Can you clarify what the intended behavior is for append mode? If there is interest in making append mode work with animation as we expect, we would be willing to do some of the heavy lifting to make it happen.  

@noahbindertaylor noahbindertaylor added the bug Something isn't working label Sep 19, 2023
@neilh-adsk neilh-adsk moved this to Needs triage in maya-usd Nov 6, 2023
@Autodesk Autodesk deleted a comment from maya-usd-git-sync bot Feb 13, 2024
@womanyoyoyo-adsk
Copy link
Collaborator

Hi @noahbindertaylor,

I am not able to reproduce this. I do not get the channelX in the export when I use the append flag with a frame range. What version of Maya and MayaUSD are you on? Can you send through a Maya file that I can repro this bug with?

The append flag should work as you expect it to. The behavior you're seeing is a bug from what I see now. Thank you for the uses cases.

Thanks,
Natalia

@noahbindertaylor
Copy link
Author

the version of mayaUSDExporter was 0.21.0 in maya 2022.2

no special Maya scene required - we used a Create->Polygon->Cube for the test shown above

I'll try 0.27.0 mayaUSDPlugin to see if it's the same result

@noahbindertaylor
Copy link
Author

noahbindertaylor commented Jul 30, 2024

OK - I've tried ALL the available versions of the mayaUSDExporter within maya2022.5

  • they ALL result in the described behaviour in the ticket

STEPS TO REPRODUCE

  1. Create a poly cube - keyframe its position (i added a key on frame 1 and another on frame 100)

  2. Select the cube

  3. run this python :
    `for frame in range(1,5):

    cmds.mayaUSDExport(file='C:/temp/myCubeTest.usda', frameRange=(frame, frame), append=True)
    `

this results in the usda containing :

double3 xformOp:translate.timeSamples = { 1: (0, 0, 0), } double3 xformOp:translate:channel1.timeSamples = { 2: (0.003040299948778675, 0, 0), } double3 xformOp:translate:channel2.timeSamples = { 3: (0.012078750982944437, 0, 0), } double3 xformOp:translate:channel3.timeSamples = { 4: (0.02699167988424187, 0, 0), }

see the channelX : channel1, channel2, channel3 ?

maybe you didn't run the python controlled framestepping? eg for frame in range(1, 5) part ? which is the crux of the issue - we want to framestep the timeline ourselves appending to the USD, building it up overtime - so that we can export more than one USD file per scene timeline

@womanyoyoyo-adsk
Copy link
Collaborator

Thanks for the info. I've logged this internally as EMSUSD-1783.

@womanyoyoyo-adsk womanyoyoyo-adsk added the reproduced Issue has been reproduced label Nov 7, 2024
@womanyoyoyo-adsk womanyoyoyo-adsk changed the title mayaUSDExport with append=True not behaving as expected [EMSUSD-1783] mayaUSDExport with append=True not behaving as expected Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working reproduced Issue has been reproduced
Projects
Status: Needs triage
Status: Needs triage
Development

No branches or pull requests

3 participants