ruba / cortex-vfx

Automatically exported from code.google.com/p/cortex-vfx
Other
2 stars 1 forks source link

MeshPrimitiveParameter in Op causes error when re-loading maya scene. #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. Create a python Op exposing a MeshPrimitiveParameter.
2. Create an Opholder node for this in a Maya scene.
3. Connect a Maya mesh. (Works as expected.)
4. Save the .ma file
5. Reload the .ma file

On reload of the file maya gives an error about incompatible parent attributes 
and does not make the connection between the mesh and the OpHolder node.

Cortex v5.

Rogier Fransen
rogier.fransen@drdstudios.com

Original issue reported on code.google.com by rogier.f...@gmail.com on 12 Nov 2010 at 1:20

GoogleCodeExporter commented 8 years ago
I'm seeing that here too. I'm not sure when I'll get a chance to look at this 
so I hope one of these workarounds will be acceptable. I find that using an 
ObjectParameter like this doesn't give me the problem :

IECore.ObjectParameter(
   name = "meshyMesh",
   description = "",
   defaultValue = IECore.MeshPrimitive.createBox( IECore.Box3f( IECore.V3f( -1 ), IECore.V3f( 1 ) ) ),
   types = [ IECore.MeshPrimitive.staticTypeId() ],
)

We also frequently use this form which gives a Group containing a bunch of 
geometry, along with some useful UI entries to help make connections etc :

IECore.ObjectParameter(
   name = "geometry",
   description = "",
   defaultValue = IECore.Group(),
   types = [ IECore.VisibleRenderable.staticTypeId() ],
   userData = {
      "maya" : {
         "useGeometryCombiner" : IECore.BoolData( True ),
       },
   },
),

Will either of those do the job for you? One other option may be to make the 
connection from outMesh rather than worldMesh - that seemed to work for me too.

Original comment by thehaddo...@gmail.com on 12 Nov 2010 at 6:20

GoogleCodeExporter commented 8 years ago
Attaching a simple Op which can be used to demonstrate the problem.

Original comment by thehaddo...@gmail.com on 12 Nov 2010 at 6:26

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by thehaddo...@gmail.com on 12 Nov 2010 at 6:26

GoogleCodeExporter commented 8 years ago

Original comment by andrewk....@gmail.com on 16 Nov 2010 at 1:44

GoogleCodeExporter commented 8 years ago
Yes, changing it to an ObjectParameter does the job perfectly fine.

Sorry, I should have mentioned that in the report. We actually started with 
that (ObjectParameter) probably as result of copy and paste from an existing Op.

It was only when we thought we were being smart that we changed it to 
MeshParameter. Turns out that was not such a smart move...

Original comment by rogier.f...@gmail.com on 16 Nov 2010 at 10:09

GoogleCodeExporter commented 8 years ago
This is fixed in r4298. See the comment in 
src/IECoreMaya/MeshParameterHandler.cpp for an explanation of the bug.

Original comment by andrewk....@gmail.com on 28 Jul 2011 at 11:54