Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

implemented filesize compression for jSkin and gSkin #28

Merged
merged 6 commits into from Mar 8, 2019
Merged

implemented filesize compression for jSkin and gSkin #28

merged 6 commits into from Mar 8, 2019

Conversation

chris-lesage
Copy link
Contributor

@chris-lesage chris-lesage commented Mar 1, 2019

Instead of a list of weights, it is now a dictionary of weights, with the vertex number as key. 0.0 weights are omitted from the data to save space. This can reduce the file size dramatically down to 3% of the size! When importing the missing keys, 0.0 skin weight is assumed.

Tested for backwards compatibility. This new functionality will still properly import older gSkin and jSkin files.

I made jSkin the default choice in the import and export fileDialog. Now that the file sizes are smaller, I believe jSkin is a superior choice, to give TDs the ability to edit the files directly.

Also updated to modern string formatting. And put all errors and warnings on single lines, instead of multi-line strings, for better readability.

miquelcampos and others added 4 commits February 28, 2019 15:53
… state to playingBackAuto Closes #26

(cherry picked from commit 06c510e)
(cherry picked from commit a862604887a9b18878db9ce043e63bdb8b359343)
Instead of a list of weights, it is now a dictionary of weights, with the vertex number as key. This can reduce the file size to 3% of the size.
1. Don't prune unless it is a polygon mesh. It is possible to prune on nurbs, but it needs more bug-testing. For example, on nurbs, you can't just specify the transform node. It will fail.

2. Don't use polyEvaluate on nurbsSurfaces or nurbsCurves. Count the CVs instead. By making this change, you can now export and import skinning on nurbs or polygons.

3. It now counts all the CVs or vtxs on multiple shape nodes. But the file format does NOT support multiple shape nodes yet! Each individual shape node under a transform would get a separate skinCluster.
@chris-lesage chris-lesage changed the base branch from master to develop March 3, 2019 16:27
Test for basestring instead of str. Skin weights are working fine because it uses dict.get(str(vtx))
I was checking the type of the key for binary vs. json. There is no need. Just cast the key as an int.
@miquelcampos miquelcampos merged commit dcd5004 into mgear-dev:develop Mar 8, 2019
@jdrese
Copy link
Member

jdrese commented Mar 8, 2019

Nice job !

@miquelcampos miquelcampos added this to In progress in mGear 3.1: To Do via automation Apr 2, 2019
@miquelcampos miquelcampos moved this from In progress to Done in mGear 3.1: To Do Apr 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants