Commit 433d96b3 authored by frankie's avatar frankie 💬

starting documentation of production process

parent 3be310e9
......@@ -6,3 +6,4 @@ models/generated/log_*
rangeSlider-master/*
slider.html
css/style_4669676a757d0641b43f027d229f5de6d95b901f.css
*.blend1
......@@ -29,7 +29,13 @@ All chairs have been produced during Simone Niquille’s installation SAFETY MEA
* 24 may 2018: presentation of the prototype at venice biennale of architecture
* february 2018: project startup
## installation
## running blender production
This part of the work has to been done on a computer with graphical interface (any effort to port scripts for blender headless will be greatly welcomed!).
[documentation is coming soon]
## running html frontend
### server-side
......@@ -47,7 +53,7 @@ cubes produced in a file system.
#### cross-domain
Check the generation of the http response in ***nodejs/timestamp.js*** and
adapt the CROS settings of the header if you want to use script with another
adapt settings of the header if you want to use script with another
domain.
#### bash scripts
......@@ -59,7 +65,7 @@ deploys the code in the folder **/var/www/scripts/**.
### client-side
To prepare the front-end code, run ***ppython/package.py*** in the root folder
To prepare the front-end code, run ***python/package.py*** in the root folder
of the repo:
$ python python/package.py
......
import os,re,subprocess
import time
exe_path = '/opt/blender-2.79-linux-glibc219-x86_64/./blender'
template_path = 'generate_automatic.blend'
max_run = 30
modify_render_files = True
launch_render = True
launch_legs = True
current_run = 0
previous_run_time = time.time()
total_run_time = 0
def launch_generation():
global current_run
global previous_run_time
print( "\t####################################################")
print( "\t############# starting run " + str(current_run) + '/' + str(max_run) + " #############" )
print( "\t####################################################")
p1 = subprocess.Popen( [ exe_path, template_path ] )
p1.wait()
total_run_time = time.time() - previous_run_time
previous_run_time = time.time()
print( "\t####################################################")
print( '\ttotal run time: ' + time.strftime("%H:%M:%S", time.gmtime(total_run_time)) )
print( "\t####################################################")
current_run += 1
for i in range( 0, max_run ):
launch_generation()
if modify_render_files:
p1 = subprocess.Popen( [ 'python', 'render_file_modifier.py' ] )
p1.wait()
if launch_render:
p1 = subprocess.Popen( [ 'python', 'runner_01_render.py' ] )
p1.wait()
if launch_render:
p1 = subprocess.Popen( [ 'python', 'runner_05_legs.py' ] )
p1.wait()
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
import bpy
obj_names = [ 'cube', 'butt_physic' ]
# regeneration of modifiers
for n in obj_names:
obj = bpy.data.objects[ n ]
obj.modifiers.clear()
obj.modifiers.new( name = 'gen_softbody', type = 'SOFT_BODY' )
obj.modifiers.new( name = 'gen_subsurface', type = 'SUBSURF' )
obj.modifiers.new( name = 'gen_collision', type = 'COLLISION' )
bpy.data.objects['butt_physic'].modifiers.new( name = 'gen_wireframe', type = 'WIREFRAME' )
# interesting params
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.friction = 4.0
#bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_max = 0.5999999642372131
#bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_friction = 5.899998664855957
#bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_min = 0.0
#bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_spring = 0.19999998807907104
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_default = 0.3999999761581421
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_max = 0.83
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_friction = 0.899998664855957
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_min = 0.2
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.goal_spring = 0.65
#bpy.data.objects['cube'].modifiers['gen_softbody'].settings.pull = 0.4000000059604645
#bpy.data.objects['cube'].modifiers['gen_softbody'].settings.plastic = 5
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.mass = 0.10000000149011612
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.plastic = 0
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.pull = 0.6
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.push = 0.7999999523162842
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.shear = 0.20000000298023224
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.speed = 1.0
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.bend = 3.3999996185302734
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.damping = 11.599998474121094
# less interesting params
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.aero = 0
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.aerodynamics_type = 'SIMPLE'
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.ball_damp = 0.0010000000474974513
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.ball_size = 0.6000000238418579
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.ball_stiff = 1.0
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.choke = 3
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.collision_group = None
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.collision_type = 'AVERAGE'
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.error_threshold = 0.10000000149011612
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.fuzzy = 0
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.gravity = 9.800000190734863
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.spring_length = 0
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.step_max = 300
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.step_min = 10
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_auto_step = True
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_diagnose = False
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_edge_collision = False
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_edges = True
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_estimate_matrix = False
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_face_collision = False
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_goal = True
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_self_collision = True
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.use_stiff_quads = True
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.vertex_group_goal = 'rigids'
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.vertex_group_mass = ''
bpy.data.objects['cube'].modifiers['gen_softbody'].settings.vertex_group_spring = 'rigids'
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.compression = 'NO'
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.filepath = ''
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.frame_end = 100
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.frame_start = 1
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.frame_step = 1
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.index = -1
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.name = ''
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.use_disk_cache = False
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.use_external = False
bpy.data.objects['cube'].modifiers['gen_softbody'].point_cache.use_library_path = True
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.aero = 0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.aerodynamics_type = 'SIMPLE'
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.ball_damp = 0.5
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.ball_size = 0.49000000953674316
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.ball_stiff = 1.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.bend = 10.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.choke = 3
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.collision_group = None
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.collision_type = 'AVERAGE'
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.damping = 5.3000006675720215
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.error_threshold = 0.10000000149011612
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.friction = 4.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.fuzzy = 0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.goal_default = 0.699999988079071
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.goal_friction = 0.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.goal_max = 1.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.goal_min = 0.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.goal_spring = 0.5
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.gravity = 9.800000190734863
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.mass = 9.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.plastic = 0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.pull = 0.5
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.push = 0.5
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.shear = 1.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.speed = 1.0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.spring_length = 0
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.step_max = 300
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.step_min = 10
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_auto_step = True
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_diagnose = False
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_edge_collision = False
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_edges = True
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_estimate_matrix = False
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_face_collision = False
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_goal = False
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_self_collision = False
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.use_stiff_quads = True
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.vertex_group_goal = ''
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.vertex_group_mass = 'weights'
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].settings.vertex_group_spring = ''
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.compression = 'NO'
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.filepath = ''
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.frame_end = 100
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.frame_start = 1
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.frame_step = 1
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.index = -1
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.name = ''
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.use_disk_cache = False
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.use_external = False
bpy.data.objects['butt_physic'].modifiers['gen_softbody'].point_cache.use_library_path = True
bpy.context.scene.update()
bpy.context.scene.frame_current = 1
bpy.ops.screen.animation_play()
import bpy
import json
json_path = bpy.context.blend_data.filepath[:bpy.context.blend_data.filepath.rfind('/')+1] + 'tracker_timeline.json'
f = open(json_path)
data = json.load(f)
for key in data:
obj = bpy.data.objects[ key ]
if obj != None:
keyframes = data[key]
for kf in keyframes:
print( kf )
try:
bpy.context.scene.frame_current = kf['frame']
obj.location = kf['position']
obj.keyframe_insert(data_path='location', frame=(kf['frame']))
obj.rotation_euler = kf['eulers']
obj.keyframe_insert(data_path='rotation_euler', frame=(kf['frame']))
print( bpy.context.scene.frame_current )
except:
break
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment