This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import os | |
## resets transforms to 0, applies modifiers, exports them all based on file name and skips any with the suffix "-noimp" | |
# Get the blend file name (without extension) and its directory, all lowercase | |
blend_path = bpy.data.filepath | |
blend_name = os.path.splitext(os.path.basename(blend_path))[0].lower() | |
export_folder = os.path.join(os.path.dirname(blend_path), blend_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Simple script i use to convert larger files or GIFs to smaller MP4s for using in BlueSky or Discord. | |
## Change the 'SOURCE' to whatever path to your file. And change 'EXPORT.mp4' to whatever you want the final file to be. | |
## The 'trunc(iw/2)' gives you control of scale. '/2' is half size, '/4' is quater size, etc. | |
ffmpeg -i SOURCE -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" EXPORT.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
## Sometimes you add a LOT of NLA aniamtions to your blend file and want to add them to your model fast. | |
## OR you hate your animations being out of order, just remove them and re-add them for some quick | |
## alphabatising. | |
# Get the current object with an animation | |
obj = bpy.context.object | |
# Ensure the object has animation data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
## NLA editor is annoying, that strips and tracks have different names, and in Godot sometimes i see | |
## my strip names and not track names. Who knows why. This will rename all strips to match their track names. | |
# Get the current scene | |
scene = bpy.context.scene | |
# Iterate through all objects in the scene | |
for obj in scene.objects: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
## I can't remember why i wanted this, but i wanted the meshes to match their object names. | |
## In case that's useful for anybody else, here it is. | |
# Iterate through all objects in the scene | |
for obj in bpy.context.scene.objects: | |
# Check if the object is a mesh and its name ends with "-col" | |
if obj.type == 'MESH' and obj.name.endswith('-col'): | |
# Remove the "-col" suffix from the object name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
for obj in bpy.data.objects: | |
obj.name += "-col" |