Continuation of my last message:
So a .target file is the index of changes that are made to the vertices when you use the slider for the shape key that is the .target data.
This can be imported directly onto your model in blender by use of MakeTarget/MakeShapes plugins. Or it can be used directly in MakeHuman. The information in these .target files is the information that is read when you move a slider within MakeHuman. As i said earlier, although you can directly apply these targets/shapkeys to you model in blender, they will only move the 'Body' mesh. not the teeth, eyebrows, tongue, etc.
So what we will focus on is getting a shape key that you have made into the .mxa file for reusability, and for the added function the MHX2 workflow supplies, which is applying the shape key data to the teeth, eyebrows, tongue, etc. as well as the Body mesh.
I will assume your are using windows. If not, just adapt the following procedure to your operatioing system.
You will need to have the MakeTarget plugin installed.
Open blender with a pipe to a text file output. In windows, this simply means open a command prompt in the folder that the blender.exe file is.
Then, run blender with a pipe.
- Code: Select all
blender > AFileName.txt
This will allow us to use the MakeTarget plugin to Print our shape key values to the console, which is now being captured as a text file of the name we specified. At this point, we will go one by one and click on our shape keys in blender, in the list of the shape keys, and use the MakeTarget plugin option to 'Print shape keys'. You will notice an option to 'save your faceshape.mxa file' This is not really functioning right now, but would have been awesome if it was, as it would have saved us many steps. Since that is not working, i am telling you how to get around all of that. At this point, you should have printed all of your shape keys to the console. close blender. Open the AFileName.txt
- Code: Select all
******* Here we go... << Eye catcher
"NamedShapeKeyWeCreated" : [ [0, [-17.1579833984375,-17.1579833984375,17.1579833984375 ]] , [1, [-17.1579833984375,17.1579833984375,17.1579833984375 ]] , [2, [-17.1579833984375,-17.1579833984375,-17.1579833984375 ]] , [3, [-17.1579833984375,17.1579833984375,-17.1579833984375 ]] , [4, [17.1579833984375,-17.1579833984375,17.1579833984375 ]] , [5, [17.1579833984375,17.1579833984375,17.1579833984375 ]] , [6, [17.1579833984375,-17.1579833984375,-17.1579833984375 ]] , [7, [17.1579833984375,17.1579833984375,-17.1579833984375 ]] ]
Selected Shape Key 'Key 1' printed to console, #8 verts
You can see that the data there is the same format as the .mxa file data. Well, after we remove the 'garbage' that is. So, that is the next step. remove all of the information that is not needed. You can see the "eye catcher" that the programmer kindly put in to help us. Once all the garbage data is removed, you are left with a compatible data format for the faceshapes.mxa
- Code: Select all
"NamedShapeKeyWeCreated" : [ [0, [-17.1579833984375,-17.1579833984375,17.1579833984375 ]] , [1, [-17.1579833984375,17.1579833984375,17.1579833984375 ]] , [2, [-17.1579833984375,-17.1579833984375,-17.1579833984375 ]] , [3, [-17.1579833984375,17.1579833984375,-17.1579833984375 ]] , [4, [17.1579833984375,-17.1579833984375,17.1579833984375 ]] , [5, [17.1579833984375,17.1579833984375,17.1579833984375 ]] , [6, [17.1579833984375,-17.1579833984375,-17.1579833984375 ]] , [7, [17.1579833984375,17.1579833984375,-17.1579833984375 ]] ]
At this point, you can copy/paste this as an entry in the faceshapes.mxa file, and it will be imported the next time you use the mhx2 importer on you model. Keep in mind, unless this is the Last entry in the list os keys in the .mxa, you will need to add a comma after the last bracket.
- Code: Select all
"NamedShapeKeyWeCreated" : [ [0, [-17.1579833984375,-17.1579833984375,17.1579833984375 ]] , [1, [-17.1579833984375,17.1579833984375,17.1579833984375 ]] , [2, [-17.1579833984375,-17.1579833984375,-17.1579833984375 ]] , [3, [-17.1579833984375,17.1579833984375,-17.1579833984375 ]] , [4, [17.1579833984375,-17.1579833984375,17.1579833984375 ]] , [5, [17.1579833984375,17.1579833984375,17.1579833984375 ]] , [6, [17.1579833984375,-17.1579833984375,-17.1579833984375 ]] , [7, [17.1579833984375,17.1579833984375,-17.1579833984375 ]] ],
then you can add further keys underneath.
As i said, this is a long involved process as it stands at the moment, but it can be done.
What i have written may be a bit confusing. Feel free to let me know if something is not understood.
So, basically, use the shapekeys that get imported when you select faceshapes when importing using MHX. Then, using these shapekeys, make your own shapekeys that match the apple structure you want. Then convert these shapekeys into data that can be used by the MHX importer, and implant that data into the faceshapes.mxa file. Then, at the end of all of this, you will have the apple ar shapes available for Any of your models that use the MHX workflow.
Best of luck, and a request.. If you do get this daunting task done, please share those shape keys with the community. I know that many people are interested in them.
Be well!