Private
Public Access
Blender-Scanvorschau und Gruppenfoto ergänzen
This commit is contained in:
1 parent
f15ab1d399
commit
4adf927773
21 files changed
+453
-4
No files matched your search
@@ -0,0 +1,15 @@
|
||||
"""Project fictional grave emitter into the existing animated camera."""
|
||||
import bpy, os, json, math
|
||||
from mathutils import Vector
|
||||
from bpy_extras.object_utils import world_to_camera_view
|
||||
root=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
bpy.ops.wm.open_mainfile(filepath=os.path.join(root,'preview/v4/halloween_dark_groan.blend'))
|
||||
s=bpy.context.scene;origin=Vector((0,1.48,1.02));end=Vector((3.25,-.65,1.2));direction=(end-origin).normalized()
|
||||
u=direction.cross(Vector((0,0,1))).normalized();v=direction.cross(u).normalized();records=[]
|
||||
def project(p):
|
||||
c=world_to_camera_view(s,s.camera,p);return [c.x*1280,(1-c.y)*720]
|
||||
for f in range(198,274):
|
||||
s.frame_set(f);ring=[project(end+.72*(u*math.cos(i*math.tau/40)+v*math.sin(i*math.tau/40))) for i in range(40)]
|
||||
records.append({'frame':f,'origin':project(origin),'ring':ring})
|
||||
path=os.path.join(root,'preview/v4/scan_assets');os.makedirs(path,exist_ok=True)
|
||||
with open(os.path.join(path,'projection.json'),'w') as out:json.dump(records,out)
|
||||
Reference in new issue
Block a user