[Bf-blender-cvs] [4b7cc39] soc-2014-fluid: removed commented parts
Roman Pogribnyi
noreply at git.blender.org
Fri Aug 15 20:18:13 CEST 2014
Commit: 4b7cc3923e1713a50df0b7f1e951c78bcefc5399
Author: Roman Pogribnyi
Date: Thu Aug 14 23:11:12 2014 +0200
Branches: soc-2014-fluid
https://developer.blender.org/rB4b7cc3923e1713a50df0b7f1e951c78bcefc5399
removed commented parts
===================================================================
M release/scripts/startup/bl_ui/properties_physics_smoke.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index b13cd8b..112efcb 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -336,25 +336,7 @@ class OBJECT_OT_RunMantaButton(bpy.types.Operator):
if os.path.exists(filename):
os.remove(filename)
- # def transform(obj, domain_obj):
- # scale_factor = domain_obj.modifiers['Smoke'].domain_settings.domain_resolution
- # for dim in range(3):
- # obj.scale[dim] /= domain_obj.scale[dim]
- # obj.location[dim] -= domain_obj.location[dim]
- # obj.location[dim] /= domain_obj.scale[dim]
-
- # def transform_back(obj, domain_obj):
- # scale_factor = domain_obj.modifiers['Smoke'].domain_settings.domain_resolution
- # for dim in range(3):
- # obj.scale[dim] *= domain_obj.scale[dim]
- # obj.location[dim] *= domain_obj.scale[dim]
- # obj.location[dim] += domain_obj.location[dim]
def transform_objgroup(obj_list, domain_obj):
- #D.objects['Suzanne'].constraints.new('CHILD_OF')
- #D.objects['Suzanne'].constraints['Child Of'].target = D.objects['Cube.001']
- #scale_factor = domain_obj.modifiers['Smoke'].domain_settings.domain_resolution
- #max_factor = max(domain_obj.scale[0],domain_obj.scale[1],domain_obj.scale[2])
- #rot_euler = deepcopy(obj.rotation_euler)
old_scale = deepcopy(domain_obj.scale)
old_location = deepcopy(domain_obj.location)
#link all objects to reference
@@ -363,102 +345,20 @@ class OBJECT_OT_RunMantaButton(bpy.types.Operator):
obj.select = True
obj.constraints.new('CHILD_OF')
obj.constraints.active.target = domain_obj
- #scale down to original size
- #obj.location[0] -= domain_obj.location[0]
- #obj.location[1] -= domain_obj.location[1]
- #obj.location[2] -= domain_obj.location[2]
- #obj.scale[0] /= domain_obj.scale[0]
- #obj.scale[1] /= domain_obj.scale[1]
- #obj.scale[2] /= domain_obj.scale[2]
#scale reference down
domain_obj.scale[0] /= old_scale[0]
- #domain_obj.location[0] -= domain_obj.location[0]
- #domain_obj.location[0] /= domain_obj.scale[0]
domain_obj.scale[1] /= old_scale[1]
- #domain_obj.location[1] -= domain_obj.location[1]
- #domain_obj.location[1] /= domain_obj.scale[1]
domain_obj.scale[2] /= old_scale[2]
return old_scale
- #domain_obj.location[2] -= domain_obj.location[2]
- #domain_obj.location[2] /= domain_obj.scale[2]
- #for axis in range(3):
- # obj.rotation_euler[axis] = rot_euler[axis]
- #obj.rotation_euler[0] = rot_euler[2]
- #obj.rotation_euler[1] = rot_euler[1]
- #obj.rotation_euler[2] = rot_euler[0]
- #for axis in range(3):
- # obj.rotation_euler[axis] = rot_euler[axis]
-
- def transform(obj, domain_obj):
- scale_factor = domain_obj.modifiers['Smoke'].domain_settings.domain_resolution
- max_factor = max(domain_obj.scale[0],domain_obj.scale[1],domain_obj.scale[2])
- rot_euler = deepcopy(obj.rotation_euler)
- for axis in range(3):
- obj.rotation_euler[axis] = 0
- obj.scale[0] /= domain_obj.scale[0]
- obj.location[0] -= domain_obj.location[0]
- obj.location[0] /= domain_obj.scale[0]
- obj.scale[1] /= domain_obj.scale[1]
- obj.location[1] -= domain_obj.location[1]
- obj.location[1] /= domain_obj.scale[1]
- obj.scale[2] /= domain_obj.scale[2]
- obj.location[2] -= domain_obj.location[2]
- obj.location[2] /= domain_obj.scale[2]
- for axis in range(3):
- obj.rotation_euler[axis] = rot_euler[axis]
- #obj.rotation_euler[0] = rot_euler[2]
- #obj.rotation_euler[1] = rot_euler[1]
- #obj.rotation_euler[2] = rot_euler[0]
- #for axis in range(3):
- # obj.rotation_euler[axis] = rot_euler[axis]
def transform_objgroup_back(obj_list, domain_obj, old_data):
- #scale_factor = domain_obj.modifiers['Smoke'].domain_settings.domain_resolution
- #max_factor = max(domain_obj.scale[0],domain_obj.scale[1],domain_obj.scale[2])
- #rot_euler = deepcopy(obj.rotation_euler)
- #scale domain to prev values
domain_obj.scale[0] = old_data[0]
- #obj.location[0] *= domain_obj.scale[0]
- #obj.location[0] += domain_obj.location[0]
domain_obj.scale[1] = old_data[1]
- #obj.location[1] *= domain_obj.scale[1]
- #obj.location[1] += domain_obj.location[1]
domain_obj.scale[2] = old_data[2]
- #obj.location[2] *= domain_obj.scale[2]
- #obj.location[2] += domain_obj.location[2]
-
#remove used constraint and deselect objects
for obj in obj_list:
obj.select = False
obj.constraints.remove(obj.constraints.active)
- #for axis in range(3):
- # obj.rotation_euler[axis] = -rot_euler[axis]
- #obj.rotation_euler[0] = rot_euler[2]
- #obj.rotation_euler[1] = rot_euler[1]
- #obj.rotation_euler[2] = rot_euler[0]
- #for axis in range(3):
- # obj.rotation_euler[axis] = rot_euler[axis]
-
- def transform_back(obj, domain_obj):
- scale_factor = domain_obj.modifiers['Smoke'].domain_settings.domain_resolution
- max_factor = max(domain_obj.scale[0],domain_obj.scale[1],domain_obj.scale[2])
- rot_euler = deepcopy(obj.rotation_euler)
- #for axis in range(3):
- # obj.rotation_euler[axis] = -rot_euler[axis]
- #obj.rotation_euler[0] = rot_euler[2]
- #obj.rotation_euler[1] = rot_euler[1]
- #obj.rotation_euler[2] = rot_euler[0]
- obj.scale[0] *= domain_obj.scale[0]
- obj.location[0] *= domain_obj.scale[0]
- obj.location[0] += domain_obj.location[0]
- obj.scale[1] *= domain_obj.scale[1]
- obj.location[1] *= domain_obj.scale[1]
- obj.location[1] += domain_obj.location[1]
- obj.scale[2] *= domain_obj.scale[2]
- obj.location[2] *= domain_obj.scale[2]
- obj.location[2] += domain_obj.location[2]
- #for axis in range(3):
- # obj.rotation_euler[axis] = rot_euler[axis]
def extract_force_fields(scene):
return [ob for ob in scene.objects if ob.field.type != None]
@@ -485,31 +385,16 @@ class OBJECT_OT_RunMantaButton(bpy.types.Operator):
silent_remove("./manta_flow.obj")
if coll_objs:
old_data = transform_objgroup(coll_objs, domain)
- #for ob in coll_objs:
- # ob.select = True
- # transform(ob,domain)
bpy.ops.export_scene.obj(filepath = "./manta_coll.obj", axis_forward='Y', axis_up='Z', use_selection = True, use_normals = True, use_materials = False, use_triangles = True, group_by_object = True, use_nurbs=True, check_existing= False)
transform_objgroup_back(coll_objs,domain,old_data)
- #for ob in coll_objs:
- # ob.select = False
- # transform_back(ob,domain)
if flow_objs:
old_data = transform_objgroup(flow_objs, domain)
- #for ob in flow_objs:
- # ob.select = True
- # transform(ob,domain)
bpy.ops.export_scene.obj(filepath = "./manta_flow.obj", axis_forward='Y', axis_up='Z', use_selection = True, use_normals = True, use_materials = False, use_triangles = True, group_by_object = True, use_nurbs=True, check_existing= False)
transform_objgroup_back(flow_objs,domain,old_data)
- #for ob in flow_objs:
- # ob.select = False
- # transform_back(ob,domain)
for ob in selected_before:
ob.select = True
bpy.ops.manta.make_file()
- # for frame_num in range(10):
- # domain.manta_sim_frame += 1
bpy.ops.manta.sim_step()
- # domain.manta_sim_frame = -1
return{'FINISHED'}
class OBJECT_OT_StopMantaButton(bpy.types.Operator):
More information about the Bf-blender-cvs
mailing list