Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2020-10-08 20:19:20 +0300
committerJulien Duroure <julien.duroure@gmail.com>2020-10-08 20:19:20 +0300
commit6cef5e013e54da23990ebb26ef9bbc15f3977c8d (patch)
treec5c8cc710b6c9184d97f013a92f0309241cb6840
parentd3100f5f71ce71691b6d72bdc70ae3698a5e86ac (diff)
glTF importer: use bpy.utils.escape_identifier to escape names for action paths
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_animation_node.py6
-rw-r--r--io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py3
3 files changed, 6 insertions, 5 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index a13ef211..2599fa21 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 4, 33),
+ "version": (1, 4, 34),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
index d41b7892..6cbc85f4 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import json
import bpy
from mathutils import Vector
@@ -90,7 +89,10 @@ class BlenderNodeAnim():
if vnode.type == VNode.Bone:
# Need to animate the pose bone when the node is a bone.
group_name = vnode.blender_bone_name
- blender_path = "pose.bones[%s].%s" % (json.dumps(vnode.blender_bone_name), blender_path)
+ blender_path = 'pose.bones["%s"].%s' % (
+ bpy.utils.escape_identifier(vnode.blender_bone_name),
+ blender_path
+ )
# We have the final TRS of the bone in values. We need to give
# the TRS of the pose bone though, which is relative to the edit
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py
index 1bf67213..ac36904a 100644
--- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import json
import bpy
from ...io.imp.gltf2_io_binary import BinaryData
@@ -75,7 +74,7 @@ class BlenderWeightAnim():
if pymesh.shapekey_names[sk] is not None: # Do not animate shapekeys not created
coords[1::2] = (values[offset + stride * i + sk][0] for i in range(len(keys)))
kb_name = pymesh.shapekey_names[sk]
- data_path = "key_blocks[" + json.dumps(kb_name) + "].value"
+ data_path = 'key_blocks["%s"].value' % bpy.utils.escape_identifier(kb_name)
make_fcurve(
action,