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
# for https://blender.stackexchange.com/q/46848/3710 | |
# ##### 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, |
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 os | |
file_prefix = None # If set to None read node file path is used | |
color_space = None # Read node colorspace "sRGB", "Cineon", "Gamma2.4" ... | |
file_types = ("exr", "jpg") # Set of file types to convert | |
rotate = False # If set to True, another reformat node will be created | |
rotation_props = ("center", "turn") # clockwise: ("flip", "flop", "turn") | |
selection = nuke.selectedNodes() |
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 | |
data = {} | |
for obj in bpy.data.objects: # bpy.context.selected_objects | |
mat_slots = obj.material_slots.keys() | |
if mat_slots: | |
data_key = "-".join(mat_slots) | |
else: | |
data_key = "None" | |
data.setdefault(data_key, []).append(obj) |
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 | |
data = {} | |
for obj in bpy.data.objects: # bpy.context.selected_objects | |
if obj.type == 'MESH': | |
data.setdefault(len(obj.data.vertices), []).append(obj) | |
for key, value in data.items(): | |
group_name = "{} Vertices".format(key) | |
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 addon_utils | |
# Set Addon Tab | |
bpy.context.user_preferences.active_section = 'ADDONS' | |
# Set Filter | |
bpy.context.window_manager.addon_search = "Addon Name" | |
# Get a module reference by 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
#https://blender.stackexchange.com/q/99989/3710 | |
import bpy | |
class FrameSelection(bpy.types.Operator): | |
"""Add a frame to all selected Nodes""" | |
bl_idname = "node.frame_selection" | |
bl_label = "Add Frame" | |
bl_options = {'REGISTER', 'UNDO'} | |
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
# ##### 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 |
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
set cut_paste_input [stack 0] | |
version 11.0 v1 | |
Read { | |
inputs 0 | |
file Untitled-1.psd | |
format "3881 1081 0 0 3881 1081 1 " | |
origset true | |
name Read6 | |
selected true | |
xpos 1335 |
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 | |
vgroup_A_name = "Group" | |
vgroup_B_name = "Group.001" | |
ob = bpy.context.active_object | |
if vgroup_A_name and vgroup_B_name in ob.vertex_groups: | |
vgroup = ob.vertex_groups.new(name=vgroup_A_name+"+"+vgroup_B_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 | |
group_input = {"Group", "Group.001", "Group.002"} | |
ob = bpy.context.active_object | |
group_lookup = {g.index: g.name for g in ob.vertex_groups} | |
group_candidates = {n for n in group_lookup.values() if n in group_input} | |
# test whether all candidates components of group_lookup | |
if all(n in group_lookup.values() for n in group_candidates): |