Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to get the camera view Matrix of each frame during playblast in the VP 2.0 viewport plugin?

How to get the camera view Matrix of each frame during playblast in the VP 2.0 viewport plugin?

zxl120125
Explorer Explorer
400 Views
1 Reply
Message 1 of 2

How to get the camera view Matrix of each frame during playblast in the VP 2.0 viewport plugin?

zxl120125
Explorer
Explorer

I wrote a viewport plugin for a custom effect and wanted to preview it in playblast with a moving camera view. But I found that the video generated by playblast is always the first frame.
I checked the plug-in code and found that the problem lies in the cameraOverride function of MHWRender::MSceneRender I wrote. M3dView cannot get the modelViewMatrix of each frame during playblast, and it always returns the data of the first frame.
The examples in devkit also have no related cases to refer to.
I tried to call the refresh method of M3dView before getting the matrix, maya will be stuck.
Does anyone have experience with this? What is the solution to this problem?

0 Likes
Accepted solutions (1)
401 Views
1 Reply
Reply (1)
Message 2 of 2

zxl120125
Explorer
Explorer
Accepted solution

My solution: I gave up using M3dView to dynamically obtain viewMatrix, and used MFnCamera to calculate. It works fine so far.

0 Likes