question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maya 2016 Export All: # RuntimeError: (kInvalidParameter): Object is incompatible with this method //

See original GitHub issue
Description of the problem
  • I’m unable to export an animated bound mesh from within Maya 2016.
  • I’m using “Export All” and selecting all the options.
  • I can “Export All” the scene just fine when the mesh isn’t bound.
  • This is happening in Dev and Master branches.

It looks like the getWeights method isn’t passing a proper argument on line 381 in _exportSkins: for weights in skin.getWeights(mesh.vtx):. There seems to be a None value getting passed into the function, I can’t find where it’s coming from though. Using a Try: statement prevents the passing of the None. I haven’t been able to verify if the JSON file output animates correctly in a browser, but the output file seems to look fine.

Here’s the error:

// Error: line 0: (kInvalidParameter): Object is incompatible with this method Traceback (most recent call last): File “S:/path/to/threeJsFileTranslator.py”, line 422, in writer writer.write(path, optionString, accessMode) File “S:/path/to/threeJsFileTranslator.py”, line 63, in write self._exportSkins() File “S:/path/to/threeJsFileTranslator.py”, line 381, in _exportSkins for weights in skin.getWeights(mesh.vtx): File “C:\Program Files\Autodesk\Maya2016\Python\lib\site-packages\pymel\core\nodetypes.py”, line 3570, in getWeights self.apimfn().getWeights(geometry.apimdagpath(), components, weights, index()) File “S:\Maya_2016_DI\build\Release\runTime\Python\Lib\site-packages\maya\OpenMayaAnim.py”, line 1415, in getWeights RuntimeError: (kInvalidParameter): Object is incompatible with this method // // Error: line 0: Could not save file “S:/STUDIO_TEAMSPACE/Episodes/Mike_Bourbeau/Maya/Production/RandomTest/ColorVertexBasedOnJointInfluence/Maya/assets/testing.json”. //

Full log here: export_error_log.txt

Three.js version
  • Dev
  • r81
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
jimmyfelixcommented, Sep 16, 2017

I ran into this problem with Maya 2018 and figured out a quick fix – Maya is creating an intermediate mesh when it binds the skin. This mesh is getting scooped up by threeJsFileTranslator.py which is causing the error with skin.getWeights(mesh.vtx). It’s also adding unnecessary vertices, faces, etc.

To fix this, you’ll need to change the filter on line 105 to not grab intermediate objects.

self.__allMeshes = filter(lambda m: len(m.listConnections()) > 0 and m.isIntermediate() == False, ls(type='mesh'))

Another issue is that the bones are not being generated. On lines 299, 300 and 329, 330 the list of joints is being grabbed by looking at listHistory with the future flag set true and then by looking at the connections. If we grab the default listHistory (without the future flag) we can filter out the joints.

joints = filter(lambda o: o.type() == "joint", listHistory( self._allMeshes() ))

The script needs more work but these changes should allow you to export animated bound meshes… just make sure your model is in the bind pose!

1reaction
inearcommented, Apr 6, 2017

@colinfizgig I don’t have Maya, so could not look into that, but ended up requesting fbx from the 3d department and import it to Blender as that exporter worked fine®. Tricky with rotations though. Not a solution, but at least a last way out if you are on a tight schedule. One good thing with the Blender exporter is to export the animations as separate files. Good if there is lots of animations that need selective loading per character.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: OpenMaya.MSpace.kWorld kInvalidParameter Object ...
setTranslation(myMVector, OpenMaya.MSpace.kWorld). RuntimeError: (kInvalidParameter): Object is incompatible with this method.
Read more >
(kInvalidParameter): Object is incompatible with this method
Hi I am using maya with python in standalone mode. I get an error, but I don´t know what i am doing wrong....
Read more >
json - Exporting mesh with animation (keyframes or bones ...
Exporting a mesh with bones using the Three.js plugin for Maya. ... 1415: (kInvalidParameter): Object is incompatible with this method //.
Read more >
Maya Render Setup errors out while re-importing the same ...
Hi, I am extremely new to Maya programming and I am trying a tool around Render Setup but I am facing this issue...
Read more >
Maya c++ Plugin error: (kInvalidParameter): Object is ... - CGTalk
I get the following runtime error: Plugin error: (kInvalidParameter): Object is incompatible with this method.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found