Home Website Youtube GitHub

Copy Skin // Import-Export Skin

hi,

sometimes the copy skin and the export skin doesnt work and it gives a “invalid deformer” error…
i found out that this mostly occures when meshes comes from other modelling apps (like blender) as alembic or other export formats.
in this case the shape naming convention doesnt follow that of maya (maya seems to like “Shape” on the end of the name).
if this is the case, then simple rename the shape, so maya likes it again (i.e. if the shape name is “mesh” then rename it to “meshShape”).
then the copy skin or export skin works as expected…
(maybe these commands assume a “Shape” string in the meshes?)

hope this helps everybody who has this errors when using copy skin and export skin…

When you say “mesh” as an example, does the shape have the same name as the transform “mesh”? If that’s the case, I bet changing the name to anything unique would work. I am somewhat certain the script does not require “Shape” in the name.

Do you have an example file you can send me, to bug fix this? Otherwise I’ll test the identical name hypothesis today.

yes i mean that the shape has the same name as the transform…
(the unique name for the shape makes sense…)

Ok thanks, that should be simple to fix.

:+1: (didnt test it with another naming convention, i expected that maya needs this “Shape” name, since every shape name in maya has this…)

If you don’t mind helping me bug test. Are you on Windows?

Can you attempt to name a file with a pipe (vertical bar character) in it?

For example create or rename any file to “|mesh.jSkin” or “|mesh.txt” or whatever. Are you allowed to do this on Windows? It does work on Mac, and I assume on Linux.

I’ve already fixed the skinCopy command. But exporting skins will still attempt to output skinning files with pipes in the filename, if the mesh name is not unique. I’m wondering if that is physically allowed on Windows?

Thanks if you have the time to help.

yes i am on windows 10.
but i dont quite understand the pipe question…do you mean when exporting the skin file by giving it a pipe in front of the save file? or inside the ascii-file, so windows can read it back?
(btw. i am still on v2.54, but can test out earliest monday…not infront of my workstation now…)

Simpler than that. I just mean manually make a file, or take an existing text file, or any file. And just try to name it |mesh.txt

I just want to know if Windows gives you an error, or tries to automatically rename it as _mesh.txt or mesh.txt or something.

hi chris, i just tested it out and windows does you NOT allow to use pipe in a filename…
it says that a filename does not be allowed to have: “\ /*:|?<>”

(maybe it would be easier to check if the shape name isnt unique and give the user the ability to autorename the shape node…?)

Ok thanks for checking! Renaming geo isn’t always a possibility in a production pipeline (without triggering 8 departments worth of bureaucracy and emails). It would be great to find a fix to just support non-unique names.

In the meantime, I sent a Pull Request to fix it so the skinCopy() command will work again with non-unique names. https://github.com/mgear-dev/mgear_core/pull/64

@soulcage On an unrelated note, I recommend you upgrade mgear_core/scripts/mgear/core/skin.py to a later version. You could download the latest release of mGear and grab skin.py. It should be safely backwards compatible with mGear 2.54.

Around mGear version 3.0 or 3.1, I submitted a change that compresses the skin files down to 4% to 2% of the size! So for example one skin file in my characters went from 178.5 MB down to 5.7 MB.

thanx chris…
dont know how often in a production this happens that the shape name is the same as the transform. found it out, because our modellers use blender with alembic export for a current project…(maybe there is a special option in blender alembic export that has to be enable for maya to import unique shape names? i will try to export obj to check if maya then gives unique names on import…but we made bad experiance with obj export, always changing vertex orders…)
i thought the copy skin would be the same as the maya command packed in the mgear menue, isnt it? also the mgear export skin command would stop exporting as soon as non-unique name appears (this happens right now, but without a message why…)
and why these commands check names and not types?

skinCopy makes a new skinCluster then copies weights. Maya’s copySkin just copies weights. The place where mGear’s skinCopy() fails is when it chooses a new name for the new skinCluster. If you try to pass it a longName with a pipe character it fails.

If you try to make a new skinCluster in Maya cmds or Pymel and name the skinCluster “|whatever”, you’ll get the same error. The fix is to remove pipes from the names in mGear’s skinCopy.

I’m sorry I don’t know why this happens. I can’t test this because it just works on MacOS and Linux. Pipes are allowed in names, so it works. I would have expected you would get an error.

Because:

  1. The exported file needs a name, not a scene object.
  2. The new skinCluster needs a name, not a scene object.

Everything else in the commands uses Pymel objects (or OpenMaya data).

1 Like