Skip to content

Instantly share code, notes, and snippets.

@robgithub
robgithub / getBlender.sh
Created June 30, 2020 21:57
Script to get the latest linux version of blender
# Download the latest version of Blender for linux if not already in folder
# 2020-06-29
baseUrl=https://download.blender.org/release/
latest=$( curl -s $baseUrl \
| egrep "^<a" \
| sed -re 's/^[^"]+"([^"]+)">[^>]+>\s+([^-]+)-([^-]+)-([0-9]+).+/\4-\3-\2 \1/' \
-e 's/-Jan-/-01-/' \
-e 's/-Feb-/-02-/' \
-e 's/-Mar-/-03-/' \
@robgithub
robgithub / UV_unwrap_from_view.py
Created April 7, 2019 15:43
Blender UV unwrap from view all selected Meshes
#UV unwrap from view all selected Meshes
import bpy
def unwrap_from_view(TARGET):
bpy.context.scene.objects.active = bpy.data.objects[TARGET]
bpy.context.object.name = TARGET
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_all(action = 'SELECT')
for oWindow in bpy.context.window_manager.windows:
oScreen = oWindow.screen
@robgithub
robgithub / is_smooth.py
Created August 15, 2018 14:56
Blender list all meshes noting Smooth and Auto Smooth settings
import bpy, math
def is_smooth(polys):
smoothed=False
for poly in polys:
if not smoothed:
smoothed = poly.use_smooth
return smoothed
for mesh in bpy.data.objects.data.meshes: