Create Mask Exporter

Author: 
el_bearduno
el_bearduno's picture
Assignee: 
Status: 
Priority: 

Create tool for exporting model mask with unity format. Here is an example of a mask used for the Space Pug:

%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1011 &101100000
AvatarMask:
  m_ObjectHideFlags: 0
  m_PrefabParentObject: {fileID: 0}
  m_PrefabInternal: {fileID: 0}
  m_Name: SpacePug - Mask (Legs Neg)
  m_Mask: 010000000100000001000000010000000100...
  m_Elements:
  - m_Path: 
    m_Weight: 1
  - m_Path: gun01_grp
    m_Weight: 1
  - m_Path: gun01_grp/gun01_geo_grp
    m_Weight: 1
  - m_Path: gun01_grp/gun01_geo_grp/gun01_geo

...

spacePug_rig_grp/rig_grp/global1Offset_grp/joints_grp/ground_jnt/pelvis_jnt/L_leg_01_FKjnt
    m_Weight: 0
  - m_Path: spacePug_rig_grp/rig_grp/global1Offset_grp/joints_grp/ground_jnt/pelvis_jnt/L_leg_01_FKjnt/L_leg_02_FKjnt
    m_Weight: 0
  - m_Path: spacePug_rig_grp/rig_grp/global1Offset_grp/joints_grp/ground_jnt/pelvis_jnt/L_leg_01_FKjnt/L_leg_02_FKjnt/L_leg_03_FKjnt
    m_Weight: 0
  - m_Path: 

...

(View Full File) Note that I renamed the file to .mask.txt so that I could uploade it here. Normally it is just .mask

Comments

2

- leg negative is the only mask used right now

- can't have a parent unchecked and a child checked, but can hav a child unchecked and a parent checked

- for reference (http://stackoverflow.com/questions/12470665/how-can-i-write-data-in-yaml-format-in-a-file)

Submitted by priimuse on Tue, 2016-09-13 20:17
priimuse's picture

Began looking into and implementing a solution to this task.

The tool is to be split into two parts.  one part to get it out of maya in the json format, and another part to get it from the json format into the yaml format for unity.  

Built the gui and basic functionality to have all the joints in the current maya scene be either in a mask ON list or a mask OFF list.  Next will be the exporting functionality.

I also installed a YAML library for visual studio's .net framework.  I plan on making this part of the solution in c#.  it will take an incoming JSON file as it's argument and then save out a duplicate file in the same directory with the ".mask" extension and YAML formatting.

Submitted by priimuse on Sun, 2016-12-11 16:40
priimuse's picture

Add new comment

Basic Editor

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain Text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.