Re: Follow Path Python constraint
9件表示
すべてのコメント一覧へ
投稿ツリー
-
Follow Path Python constraint (tsurubaso, 2007/12/29 9:02)
-
Re: Follow Path Python constraint (yamyam, 2007/12/29 12:39)
-
Re: Follow Path Python constraint (tsurubaso, 2007/12/29 13:28)
-
Re: Follow Path Python constraint (yamyam, 2007/12/29 13:54)
-
Re: Follow Path Python constraint (tsurubaso, 2007/12/30 0:06)
-
Re: Follow Path Python constraint (yamyam, 2007/12/30 1:57)
-
Re: Follow Path Python constraint (tsurubaso, 2008/1/1 2:42)
«
-
Re: Follow Path Python constraint (tsurubaso, 2008/1/3 1:21)
- Re: Follow Path Python constraint (yamyam, 2008/1/3 12:17)
-
Re: Follow Path Python constraint (tsurubaso, 2008/1/3 1:21)
-
Re: Follow Path Python constraint (tsurubaso, 2008/1/1 2:42)
«
-
Re: Follow Path Python constraint (yamyam, 2007/12/30 1:57)
-
Re: Follow Path Python constraint (tsurubaso, 2007/12/30 0:06)
-
Re: Follow Path Python constraint (yamyam, 2007/12/29 13:54)
-
Re: Follow Path Python constraint (tsurubaso, 2007/12/29 13:28)
-
Re: Follow Path Python constraint (yamyam, 2007/12/29 12:39)
tsurubaso
投稿数: 17
yahooo
akeomeeeeeeeeeeeeeeeeeee
Bonne annee,
happy new year!!
akemashiteomedetogozaimasuuuu
Every things looks find but it's not working.
引用:
akeomeeeeeeeeeeeeeeeeeee
Bonne annee,
happy new year!!
akemashiteomedetogozaimasuuuu
Every things looks find but it's not working.
引用:
import Blender
from Blender import *
from Blender import Camera,Object, Scene, Ipo,Window, Curve, BezTriple, Mathutils, BezTriple, Mathutils
# script author 80% enhzflep 20% tsurubaso
#isolate the selected object
cur = Scene.getCurrent()
object = cur.objects.active
#change the position of the moved object to (0,0,0)in order to be in the center of the circle
#this is not working!
object.setLocation (0.0,0.0,0.0)
#create a new camera and set it active
c = Camera.New('ortho','Camera-Vue01')
ob = Object.New('Camera','Vue01')
ob.link(c)
cur.link(ob)
cur.setCurrentCamera(ob)
c.setLens(35.00)
c.setClipStart(0.10)
c.setClipEnd(200.00)
ob.Layer = 2
#put the active object in an empty layer
StartLayer = 1
EndLayer = 2
ObList = Blender.Object.GetSelected()
for Object in ObList:
if Object.Layer == StartLayer:
Object.Layer = EndLayer
#add a circle
cu = Curve.New() # create new curve data
scn = Scene.GetCurrent() # get current scene
obcurve = scn.objects.new(cu) # make a new curve from the curve data
obcurve.link(cu) # link curve data with this object
obcurve.Layer = 2 # put curve in layer2
center = (0,0,0)
#Here you change the radius to change the distance of the camera
radius = 4
AUTO = BezTriple.HandleTypes.AUTO
# Build four points at radius distance in the four cardnal directions
p1 = (0, -radius, 0)
p2 = (radius, 0, 0)
p3 = (0, radius, 0)
p4 = (-radius, 0, 0)
p1 = BezTriple.New(p1)
p2 = BezTriple.New(p2)
p3 = BezTriple.New(p3)
p4 = BezTriple.New(p4)
# Can't have a curve without points...
curve = cu.appendNurb(p1)
curve.append(p2)
curve.append(p3)
curve.append(p4)
# Set both handles to auto for each point
for point in curve:
point.handleTypes = [AUTO, AUTO]
curve.flagU = 1 # Set curve cyclic
cu.update()
obcurve.loc = center # Put it where it goes
#set a Track to constraint
ob.constraints.append(2)
const = ob.constraints[len(ob.constraints)-1] #last constraint in the list
const[Constraint.Settings.TARGET] = object
const.__setitem__(Constraint.Settings.TRACK, Constraint.Settings.TRACKNEGZ)
const.__setitem__(Constraint.Settings.UP, Constraint.Settings.UPY)
#add a followpath constraint
const2 = ob.constraints.append(Constraint.Type.FOLLOWPATH)
const2[Constraint.Settings.TARGET] = obcurve
Window.RedrawAll()
投票数:13
平均点:3.85
ログイン
クイックリンク
2021/07/01版
●Blender.org
BlenderFoundation
- Blenderのダウンロード
- 公式チュート等
- 公式マニュアル(和訳)
●ニュース(英文)
BlenderNation
●Blenderコミュニティ
blenderartists.org
●Blender Q&A
- Blender Stack Exchange
●テストビルド
Buildbot(自動生成)
●開発関連
公式開発サイト
Blender開発blog
Blender Wiki
●Blender.org
BlenderFoundation
- Blenderのダウンロード
- 公式チュート等
- 公式マニュアル(和訳)
●ニュース(英文)
BlenderNation
●Blenderコミュニティ
blenderartists.org
●Blender Q&A
- Blender Stack Exchange
●テストビルド
Buildbot(自動生成)
●開発関連
公式開発サイト
Blender開発blog
Blender Wiki