Home Website Youtube GitHub

Changing export data extension

Hi,
I am trying to integrate mgear in our pipeline and would like to make data extensions in lowercase. I would like to know where can I change the settings so that the exported gSkinPack as gskinpack?

Thanks!

Have you tried just naming it whatever you want? The command just takes a file path, so it might attempt to open any name you give it.

Side note: You should use the ascii format, not binary. It will allow you to open and edit the files in plain text.

Thanks for the quick reply. Yes, I am using ascii format. I haven’t tried it yet.
But I renamed the extension in skin.py file and it kind a worked.


FILE_EXT = ".gskin"
#FILE_EXT = ".gSkin"
FILE_JSON_EXT = ".jskin"
#FILE_JSON_EXT = ".jSkin"
PACK_EXT = ".gskinpack"
#PACK_EXT = ".gSkinPack"

“kind a worked”. Were there still issues?

Oh I see. I just tested. When using the menu, it automatically renames the end extension to gSkinPack, even if you pick ascii. And when you use skin.exportJsonSkinPack(path) it validates the extension name and fails if you pick something custom. I wasn’t aware. You could also just remove that validation from the code.

But importing works without changing anything. You can call any file by code and it will open it up. Format the file path with your favourite path() method.

testing.foo is a test ascii file I exported.

import os
from mgear.core import skin

skinpath = os.path.abspath('/your/path/testing.foo')
skin.importSkinPack(skinpath)

It works when I am exporting/importing skin through menu. I get the skin pack with lower case extension names. I haven’t tested it with custom step yet.
After updating the script, I had to open new maya session. Then it worked.