diff --git a/__init__.py b/__init__.py index 01bda99..5c58cd0 100644 --- a/__init__.py +++ b/__init__.py @@ -236,12 +236,6 @@ class OBJEX_OT_export_base(): default=export_objex.ObjexWriter.default_options['KEEP_VERTEX_ORDER'], ) - global_scale = FloatProperty( - name='Scale', - soft_min=0.01, soft_max=1000.0, - default=1.0, - ) - # logging logging_level_console = IntProperty( name='Log level', @@ -285,7 +279,6 @@ class OBJEX_OT_export_base(): check_extension = True def draw(self, context): - self.layout.prop(self, 'global_scale') if self.use_selection: box = self.layout.box() box.prop(self, 'use_selection') @@ -352,11 +345,10 @@ def draw(self, context): box.prop(self, 'logging_file_path') self.layout.prop(self, 'path_mode') - def execute(self, context): + def execute(self, context:bpy.types.Context): from mathutils import Matrix keywords = self.as_keywords(ignore=('axis_forward', 'axis_up', - 'global_scale', 'check_existing', 'filter_glob', 'logging_level_console', @@ -366,7 +358,7 @@ def execute(self, context): )) global_matrix = blender_version_compatibility.matmul( - Matrix.Scale(self.global_scale, 4), + Matrix.Scale(context.scene.objex_bonus.blend_scale, 4), axis_conversion(to_forward=self.axis_forward, to_up=self.axis_up, ).to_4x4()) diff --git a/interface.py b/interface.py index 98d7146..6fa7225 100644 --- a/interface.py +++ b/interface.py @@ -478,6 +478,10 @@ def draw(self, context): box.prop(armature.data.objex_bonus, "joint_sphere_header_filepath") box.prop(armature.data.objex_bonus, "joint_sphere_scale") box.operator("objex.export_joint_sphere_header") + + box = self.layout.box() + if foldable_menu(box, context.scene.objex_bonus, "menu_global"): + box.prop(context.scene.objex_bonus, 'blend_scale') # material diff --git a/properties.py b/properties.py index 8fa4fc3..ba826c3 100644 --- a/properties.py +++ b/properties.py @@ -63,6 +63,12 @@ class SavedPose(bpy.types.PropertyGroup): class ObjexSceneProperties(bpy.types.PropertyGroup): is_objex_scene = bpy.props.BoolProperty() + + blend_scale = bpy.props.FloatProperty( + name='Export Scale', + soft_min=0.01, soft_max=1000.0, + default=1.0, + ) colorspace_strategy = bpy.props.EnumProperty( # if modifying these items, also edit __init__.OBJEX_AddonPreferences.colorspace_default_strategy @@ -102,6 +108,7 @@ class ObjexSceneProperties(bpy.types.PropertyGroup): menu_bone = bpy.props.BoolProperty(name='Bone') menu_joint = bpy.props.BoolProperty(name='Joint Sphere') menu_mesh = bpy.props.BoolProperty(name='Mesh') + menu_global = bpy.props.BoolProperty(name='Export Settings') mode_menu = bpy.props.EnumProperty( items=[ ('menu_mode_combiner', 'Combiner', '(A-B)*C+D', 'SHADING_RENDERED', 0),