Skip to content

Instantly share code, notes, and snippets.

View Begalov's full-sized avatar
🎯
Focusing

RUben Begalov

🎯
Focusing
View GitHub Profile
import bpy
for m in (m for m in bpy.data.materials if m.node_tree != None):
ps = m.node_tree.nodes['Material Output'].inputs['Surface'].links[0].from_node
ps.inputs[7].default_value = 0.
ps.inputs[9].default_value = 1.
# ##### 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
@Begalov
Begalov / blender-apply_modifiers_for_not_single_user_data.py
Last active August 13, 2020 10:28
Blender script to apply modifiers for not single user data
import bpy
for object in bpy.context.selected_objects:
bpy.context.view_layer.objects.active = object
bpy.ops.object.make_single_user(object=True, obdata=True, material=False, animation=False)
for mod in [m for m in object.modifiers]:
bpy.ops.object.modifier_apply(modifier=mod.name)
@Begalov
Begalov / knife_project.py
Last active November 1, 2020 20:35
Blender 3d 2.80 knife project from view operator
import bpy
class KnifeProjectOperator(bpy.types.Operator):
"""Knefe project from view selected objects to active"""
bl_idname = "object.knife_project_operator"
bl_label = "Knife Project Operator"
@classmethod
def poll(cls, context):
return context.active_object is not None \
@Begalov
Begalov / gist:8760d725e49c81ad7d98b7218752969b
Created March 29, 2016 16:44
Easiest PHP date operations
date('Y-m-d', strtotime('2015-06-01 + 60 month'));