Skip to content

Instantly share code, notes, and snippets.

@SiunCyclone
Created March 16, 2024 14:31
Show Gist options
  • Save SiunCyclone/8719d730c90b83e5541bcd426cfec962 to your computer and use it in GitHub Desktop.
Save SiunCyclone/8719d730c90b83e5541bcd426cfec962 to your computer and use it in GitHub Desktop.
import bpy
import math
import os
for obj in bpy.context.selected_objects:
obj.rotation_euler[0] = math.radians(-90)
bpy.ops.object.transform_apply()
obj.rotation_euler[0] = math.radians(90)
path = bpy.path.abspath("//") # .blend existing path
name = bpy.context.active_object.name_full
dst = path + name
#bpy.ops.export_scene.gltf(filepath = dst + '.glb', use_selection = True)
bpy.ops.export_scene.fbx(filepath = dst + '.fbx', use_selection = True, apply_scale_options = 'FBX_SCALE_ALL', use_armature_deform_only = True)
for obj in bpy.context.selected_objects:
bpy.ops.object.transform_apply()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment