Skip to content

Instantly share code, notes, and snippets.

@batFINGER
batFINGER / add_mesh_spiral_thingy.py
Created January 23, 2020 10:56
Add Mesh Spiral Thingy
bl_info = {
"name": "Spiral Mesh",
"author": "batFINGER",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "View3D > Add > Mesh > Spiral Mesh",
"description": "Adds a Spiral Thingy",
"warning": "",
"wiki_url": "",
"category": "Add Mesh",
@batFINGER
batFINGER / mesh_origin_to_selected.py
Last active November 2, 2023 17:24
2.80 bse examples
bl_info = {
"name": "Set mesh origin to selected geometry",
"author": "batFINGER",
"version": (1, 0),
"blender": (2, 80, 0),
"description": "Set mesh origin to selected geometry",
"warning": "",
"wiki_url": "",
"category": "Add Mesh",
}
@batFINGER
batFINGER / osm_road_stroke.py
Created March 21, 2018 13:26
OSM bits and pieces.
import bpy
from bpy import context
from mathutils import Vector
import bmesh
up = Vector((0, 0, 1)) # z axis
north = Vector((0, 1, 0)) # y axis
def stroke(bm, v, n, w):
v1 = bm.verts.new(v + w / 2 * n)
@batFINGER
batFINGER / uv_mercator_project.py
Created September 6, 2017 21:57
Mercator UV Projection
bl_info = {
"name": "Mercator Project",
"author": "batFINGER",
"version": (1, 0),
"blender": (2, 79, 0),
"location": "View3D > Mesh > UV UnWrap > Mercator Project",
"description": "UV Mercator Projection",
"warning": "",
"wiki_url": "",
"category": "UV",
@batFINGER
batFINGER / __init__.py
Created December 13, 2016 01:25
C3D addon with modal "animation" operator removed
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@batFINGER
batFINGER / fold_triangular_corners.py
Created December 10, 2016 19:01
Fold triangular corners
import bpy
import bmesh
from bpy.props import FloatProperty
from math import radians
from mathutils.geometry import intersect_point_line
from mathutils import Matrix
class BMeshTriangularFold(bpy.types.Operator):
"""Fold Triangle on edge"""
@batFINGER
batFINGER / process_files.py
Created November 24, 2016 13:05
Process multi files (ImportHelper) in blender.
import bpy
def process_files(context, directory, files):
import os
for file in files:
path = os.path.join(directory, file.name)
print("process %s" % path)
return {'FINISHED'}
# ImportHelper is a helper class, defines filename and
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@batFINGER
batFINGER / add_mesh_sphere_torus_space.py
Last active January 2, 2021 11:10
Spaces Spherical, Torus, Cylindrical
bl_info = {
"name": "Math Surface Shape",
"author": "batFINGER",
"version": (1, 0),
"blender": (2, 78, 0), # and most prior
"location": "View3D > Add > Mesh > New Object",
"description": "Adds a new Mesh Object",
"warning": "",
"wiki_url": "",
"category": "Add Mesh",
@batFINGER
batFINGER / import_osm.py
Created September 8, 2016 17:54
Blender GEO OSM import tweak
# This is the release version of the plugin file io_import_scene_osm_dev.py
# If you would like to make edits, make them in the file io_import_scene_osm_dev.py and the other related modules
# To create the release version of io_import_scene_osm_dev.py, execute:
# python plugin_builder.py io_import_scene_osm_dev.py
bl_info = {
"name": "Import OpenStreetMap (.osm)",
"author": "Vladimir Elistratov <vladimir.elistratov@gmail.com> and gtoonstra",
"version": (1, 1, 0),
"blender": (2, 7, 4),
"location": "File > Import > OpenStreetMap (.osm)",