瀏覽代碼

v0.12.15 fix rotation in obj export for older Blenders

Joseph Brandenburg 2 月之前
父節點
當前提交
c169b4a148
共有 3 個文件被更改,包括 7 次插入3 次删除
  1. 1 2
      __init__.py
  2. 1 1
      blender_manifest.toml
  3. 5 0
      utilities.py

+ 1 - 2
__init__.py

@@ -18,7 +18,7 @@ from .utilities import prRed
 
 MANTIS_VERSION_MAJOR=0
 MANTIS_VERSION_MINOR=12
-MANTIS_VERSION_SUB=14
+MANTIS_VERSION_SUB=15
 
 classLists = [module.TellClasses() for module in [
  link_nodes_ui,
@@ -355,7 +355,6 @@ def autoload_components(filename):
             bl_addon_object.preferences.MetaArmatureDefaultCollection)):
         context.scene.collection.children.unlink(armature_collection)
 
-
 # I'll need to do some fiddling here when it comes time to try
 #   and make rig definitions animatable.
 @persistent

+ 1 - 1
blender_manifest.toml

@@ -3,7 +3,7 @@ schema_version = "1.0.0"
 # Example of manifest file for a Blender extension
 # Change the values according to your extension
 id = "mantis"
-version = "0.12.14"
+version = "0.12.15"
 name = "Mantis"
 tagline = "Mantis is a rigging nodes toolkit"
 maintainer = "Nodespaghetti <josephbburg@protonmail.com>"

+ 5 - 0
utilities.py

@@ -400,6 +400,11 @@ def import_widget_obj(path,):
             # this is easier than setting the active collection before import.
             for other_collection in ob.users_collection:
                 other_collection.objects.unlink(ob)
+            from math import pi as PI
+            from mathutils import Matrix
+            m = ob.data
+            for v in m.vertices:
+                v.co = Matrix.Rotation(PI/2, 4, 'X') @ v.co
             collection.objects.link(ob)
             return ob # return the first one, that should be the one
         else: # no new object was found - fail.