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
# Starling Atlas generation: make_starling_atlas.py | |
# Recursively loads images from directory and arranges them into one big png file with xml decription | |
# Reqirement: PIL | |
# ported from https://github.com/Gamua/Sparrow-Framework/blob/master/sparrow/util/atlas_generator/generate_atlas.rb | |
# ********* ************* ******* | |
import sys | |
import os | |
from PIL import Image |
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
local function clamp(value, low1, high1) | |
if value<low1 then | |
return low1 | |
end | |
if value>high1 then | |
return high1 | |
end | |
return value | |
end |
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
def eliminateNG(self, node): | |
node_groups = bpy.data.node_groups | |
# Get the node group name as 3-tuple (base, separator, extension) | |
(base, sep, ext) = node.node_tree.name.rpartition('.') | |
# Replace the numeric duplicate | |
if ext.isnumeric(): | |
if base in node_groups: | |
print("- Replace nodegroup '%s' with '%s'" % (node.node_tree.name, base)) |
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
def get_object_by_name(name): | |
if name in bpy.data.objects: | |
return bpy.data.objects[name] | |
return None | |
def unselect_all(): | |
for obj in bpy.data.objects: | |
obj.select = False | |
def force_visible_object(obj): |