Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor VRM import to use bone names; change some properties #1

Merged
merged 2 commits into from Oct 20, 2020
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next
Save humanoid bone names instead of indices.
  • Loading branch information
lyuma committed Oct 18, 2020
commit d5cb948c413191877f3f7b643aa800eb0397799d
@@ -301,7 +301,7 @@ func _create_meta(root_node: Node, animplayer: AnimationPlayer, vrm_extension: D

var humanBoneDictionary: Dictionary = {}
for humanBoneName in human_bone_to_idx:
humanBoneDictionary[humanBoneName] = poolintarray_find(gltfskel.joints, human_bone_to_idx[humanBoneName])
humanBoneDictionary[humanBoneName] = skeleton.get_bone_name(poolintarray_find(gltfskel.joints, human_bone_to_idx[humanBoneName]))

var vrm_meta: Resource = load("res://addons/vrm/vrm_meta.gd").new()

@@ -322,9 +322,9 @@ func _create_meta(root_node: Node, animplayer: AnimationPlayer, vrm_extension: D
var gltftex: GLTFTexture = gstate.get_textures()[tex]
vrm_meta.texture = gstate.get_images()[gltftex.src_image]
vrm_meta.allowedUserName = vrm_extension["meta"].get("allowedUserName", "")
vrm_meta.violentUsage = vrm_extension["meta"].get("violentUssageName", "")
vrm_meta.sexualUsage = vrm_extension["meta"].get("sexualUssageName", "")
vrm_meta.commercialUsage = vrm_extension["meta"].get("commercialUssageName", "")
vrm_meta.violentUsage = vrm_extension["meta"].get("violentUssageName", "") # Ussage (sic.) in VRM spec
vrm_meta.sexualUsage = vrm_extension["meta"].get("sexualUssageName", "") # Ussage (sic.) in VRM spec
vrm_meta.commercialUsage = vrm_extension["meta"].get("commercialUssageName", "") # Ussage (sic.) in VRM spec
vrm_meta.otherPermissionUrl = vrm_extension["meta"].get("otherPermissionUrl", "")
vrm_meta.licenseName = vrm_extension["meta"].get("licenseName", "")
vrm_meta.otherLicenseUrl = vrm_extension["meta"].get("otherLicenseUrl", "")
ProTip! Use n and p to navigate between commits in a pull request.