This file contains hidden or 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
<?php the_post_thumbnail('post-thumbnail', array( 'class' => "grid_4 img-max attachment-post-thumbnail")); ?> |
This file contains hidden or 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 typecheck(obj): | |
return hasattr(obj, '__iter__') and not isinstance(obj, str) |
This file contains hidden or 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 | |
from random import choice | |
scene = bpy.context.scene | |
ob = bpy.context.object | |
random_group = choice(ob.users_group) | |
obs = random_group.objects[:] | |
obs.remove(ob) |
This file contains hidden or 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
bl_info = { | |
"name": "tester", | |
"description": "", | |
"author": "", | |
"version": (0, 0, 3), | |
"blender": (2, 70, 0), | |
"location": "3D View > Toolbox", | |
"warning": "", # used for warning icon and text in addons panel | |
"wiki_url": "", | |
"tracker_url": "", |
This file contains hidden or 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 | |
obj = bpy.context.object | |
bpy.ops.object.modifier_add(type='SUBSURF') | |
for mod in obj.modifiers: | |
if mod.type == "SUBSURF": | |
obj.modifiers[mod.name].levels = 1 | |
bpy.ops.object.modifier_apply(apply_as='DATA', modifier=mod.name) |
This file contains hidden or 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 http://blender.stackexchange.com/questions/32787/example-of-creating-and-setting-a-cycles-material-node-with-the-python-api | |
import bpy | |
# get the material | |
mat = bpy.data.materials['Material'] | |
# get the nodes | |
nodes = mat.node_tree.nodes | |
# clear all nodes to start clean |
This file contains hidden or 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
* { | |
background: #000 !important; | |
color: #0f0 !important; | |
outline: solid #f00 1px !important; | |
} |
This file contains hidden or 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 random | |
def random_floats(min, max, size): | |
return [random.uniform(min, max) for _ in range(size)] | |
# define a animation length | |
length = 10 | |
# create a list, which contains 10 random x values |
This file contains hidden or 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 http://blender.stackexchange.com/questions/42080/check-if-active-object-has-a-modifier | |
# check for specific modifier using any() | |
print ([m for m in bpy.context.object.modifiers if m.type == "SUBSURF"]) | |
# or as function | |
def check_modifier(obj, modifier_type): | |
for modifier in obj.modifiers: | |
if modifier.type == modifier_type: | |
return True |
This file contains hidden or 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 |
OlderNewer