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 | |
mylist = bpy.context.selected_objects | |
for each in mylist: | |
bpy.ops.object.select_all(action='DESELECT') | |
each.select=True | |
bpy.ops.object.duplicate() | |
dup = bpy.data.objects[len(bpy.data.objects)-1] | |
dup.layers=each.layers | |
dup.parent = each | |
dup.location = [0,0,2] |
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 | |
selectionDictionary = {} | |
newSelection = [] | |
selection = bpy.context.selected_objects | |
for each in selection: | |
loc = str(each.location) | |
if loc not in selectionDictionary: | |
selectionDictionary[loc] = each | |
else: | |
newSelection.append(each) |
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 | |
for each in bpy.context.selected_objects: | |
each.location=each.location.to_tuple(1) |
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 | |
for i in bpy.context.selected_objects: | |
name = "" | |
name += str(i.data.type) | |
name += "_" | |
name += str(int(i.data.energy*1000)) | |
name += "_" | |
name += str(int(i.data.distance*1000)) | |
name += "_" | |
name += str(int(i.data.color[0]*1000)) |
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 | |
print("---------------------------------------------------") | |
print("Auto-running blender-internal text block!") | |
print("---------------------------------------------------") | |
def DoRunScript (scriptName): | |
bpy.ops.text.run_script({'edit_text':bpy.data.texts[scriptName]}) | |
class renderLayerButtonOperator(bpy.types.Operator): |
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 | |
# SETTING DATA VALUES: LIST[VISIBLE LAYERS], STRING(WORLD NAME) | |
animRange=[0,250] | |
singleFrame=[0,0] | |
#ob_bg = bpy.data.objects['Environment_proxy'] | |
#material_shad = bpy.data.materials['LightingPass_Shadow'] |
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 | |
def createDuplicate(ob): | |
bpy.ops.object.select_all(action = 'DESELECT') | |
ob.select = True | |
bpy.ops.object.duplicate() # uses selected | |
dup = bpy.data.objects[len(bpy.data.objects)-1] | |
return dup | |
def applyModifiers(ob): | |
bpy.context.scene.objects.active = ob |
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 | |
scene = bpy.context.scene | |
current = scene.frame_current | |
start = scene.frame_start | |
end = scene.frame_end | |
div = 10 | |
ob1 = bpy.context.selected_objects[1] | |
ob2 = bpy.context.selected_objects[0] | |
bpy.context.scene.objects.active = ob2 |
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
-- CONVERT FOCAL LENGTH TO FOV | |
-- this conversion method copied from: | |
-- http://math.stackexchange.com/questions/148719/calculate-field-of-view-from-focal-length | |
function ConvertFocalLengthToFOV (FocalLength) | |
local filmWidth = 1.672 | |
local FocalLength_mm = FocalLength * 0.03937 | |
return_fov = math.deg(2 * math.atan(filmWidth / (2 * FocalLength_mm))) |
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 | |
def enum(*sequential, **named): | |
enums = dict(zip(sequential, range(len(sequential))), **named) | |
return type('Enum', (), enums) | |
EnumMode=enum('Toggle','ForceUnique','ForceInstance') | |
mode=EnumMode.Toggle |
OlderNewer