0% found this document useful (0 votes)
280 views

RotatingVerts in Blender Python

This document contains Python code for manipulating objects in the Blender 3D modeling software. It imports several Blender modules, defines some variables like time and brush, and gets the current scene and a mesh object. It then loops through the vertices of a selected object, calculates the distance from each vertex to a defined center point, and rotates the vertex coordinates 30 degrees around the center point.

Uploaded by

api-26014369
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
280 views

RotatingVerts in Blender Python

This document contains Python code for manipulating objects in the Blender 3D modeling software. It imports several Blender modules, defines some variables like time and brush, and gets the current scene and a mesh object. It then loops through the vertices of a selected object, calculates the distance from each vertex to a defined center point, and rotates the vertex coordinates 30 degrees around the center point.

Uploaded by

api-26014369
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import blender

from blender import *


import math
from blender.draw import *
from blender.bgl import *
from math import *
from blender import mathutils
from blender.mathutils import *
time = 0
brush = []
scene = blender.scene.getcurrent()
obj = blender.mesh.new("freehand")
scene.objects.new(obj,"freehand") #<>
center = []
center.append([2.226,2.111,0])
sel = blender.object.getselected()
if sel:obj3=sel[0]
obj3 = obj3.getdata(mesh = 1)
verts = obj3.verts
faces = obj3.faces
edges = obj3.edges
for v in verts:
#v.co[0] =v.co[0]- v.co[0]*sin(60)
#v.co[1] =v.co[1]+ v.co[1]*sin(60)
xdist = v.co[0]-center[0][0]
ydist = v.co[1]-center[0][1]
dist = xdist/ydist
print "degrees sin :",(sin(radians(90)))
vx = v.co[0]
v.co[0] =(v.co[0]*(cos(radians(30))))+ v.co[1]*(sin(radians(30)))
v.co[1] =(v.co[1]*(cos(radians(30))))- vx*(sin(radians(30)))
blender.redraw()
#(center-raadius*sin(radians(stepz)),center+raadius*sin(radians(stepx)),0)

You might also like