Created
April 30, 2015 16:41
-
-
Save hiroakioishi/b560e9fe9becdb68e0f3 to your computer and use it in GitHub Desktop.
[Blender:Python] シーン中に存在するタイプがMESHのオブジェクトの頂点を任意の範囲のランダム値でずらす
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 random | |
def offset_vertices_of_mesh_objects (vertOffsetRnd_): | |
for obj in bpy.context.scene.objects: | |
#print(obj.type) | |
if obj.type == 'MESH': | |
print(obj.name) | |
for vert in obj.data.vertices: | |
vert.co.x += random.uniform(-vertOffsetRnd_, vertOffsetRnd_) | |
vert.co.y += random.uniform(-vertOffsetRnd_, vertOffsetRnd_) | |
vert.co.z += random.uniform(-vertOffsetRnd_, vertOffsetRnd_) | |
offset_vertices_of_mesh_objects(0.01) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment