2009-07-02 19:41:31 +00:00
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
class PhysicButtonsPanel(bpy.types.Panel):
|
2009-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
2009-07-02 19:41:31 +00:00
|
|
|
__context__ = "physics"
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-07-03 14:11:00 +00:00
|
|
|
ob = context.object
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
rd = context.scene.render_data
|
|
|
|
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
2009-07-02 19:41:31 +00:00
|
|
|
|
|
|
|
class PHYSICS_PT_softbody(PhysicButtonsPanel):
|
|
|
|
__label__ = "Soft Body"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-02 19:41:31 +00:00
|
|
|
md = context.soft_body
|
|
|
|
ob = context.object
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
split.operator_context = "EXEC_DEFAULT"
|
|
|
|
|
|
|
|
if md:
|
|
|
|
# remove modifier + settings
|
|
|
|
split.set_context_pointer("modifier", md)
|
2009-07-17 12:26:40 +00:00
|
|
|
split.itemO("object.modifier_remove", text="Remove")
|
2009-07-02 19:41:31 +00:00
|
|
|
|
|
|
|
row = split.row(align=True)
|
|
|
|
row.itemR(md, "render", text="")
|
|
|
|
row.itemR(md, "realtime", text="")
|
|
|
|
else:
|
|
|
|
# add modifier
|
2009-08-06 13:15:23 +00:00
|
|
|
split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add")
|
2009-07-03 20:03:24 +00:00
|
|
|
split.itemL("")
|
|
|
|
|
|
|
|
if md:
|
|
|
|
softbody = md.settings
|
|
|
|
|
|
|
|
# General
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Object:")
|
|
|
|
col.itemR(softbody, "mass")
|
|
|
|
col.itemR(softbody, "friction")
|
2009-07-02 19:41:31 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Simulation:")
|
|
|
|
col.itemR(softbody, "gravity")
|
|
|
|
col.itemR(softbody, "speed")
|
2009-08-02 19:39:33 +00:00
|
|
|
|
|
|
|
class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
|
|
|
|
__label__ = "Soft Body Cache"
|
|
|
|
__default_closed__ = True
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return (context.soft_body)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
cache = context.soft_body.point_cache
|
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
2009-08-12 09:54:29 +00:00
|
|
|
layout.set_context_pointer("PointCache", cache)
|
|
|
|
|
|
|
|
row = layout.row()
|
2009-08-25 12:31:35 +00:00
|
|
|
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2)
|
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
2009-08-12 09:54:29 +00:00
|
|
|
col = row.column(align=True)
|
2009-08-22 08:48:01 +00:00
|
|
|
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
|
|
|
|
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
|
2009-08-02 19:39:33 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(cache, "name")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(cache, "start_frame")
|
|
|
|
row.itemR(cache, "end_frame")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
if cache.baked == True:
|
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
2009-08-12 09:54:29 +00:00
|
|
|
row.itemO("ptcache.free_bake", text="Free Bake")
|
2009-08-02 19:39:33 +00:00
|
|
|
else:
|
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
2009-08-12 09:54:29 +00:00
|
|
|
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
|
2009-08-02 19:39:33 +00:00
|
|
|
|
|
|
|
sub = row.row()
|
|
|
|
sub.enabled = cache.frames_skipped or cache.outdated
|
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
2009-08-12 09:54:29 +00:00
|
|
|
sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
|
2009-08-02 19:39:33 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
2009-08-12 09:54:29 +00:00
|
|
|
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
|
2009-08-02 19:39:33 +00:00
|
|
|
row.itemR(cache, "step");
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-08-02 19:39:33 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(cache, "quick_cache")
|
|
|
|
row.itemR(cache, "disk_cache")
|
|
|
|
|
|
|
|
layout.itemL(text=cache.info)
|
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
|
|
|
|
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
|
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
2009-08-12 09:54:29 +00:00
|
|
|
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
|
2009-08-02 19:39:33 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
|
|
|
|
__label__ = "Soft Body Goal"
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-07-30 10:11:19 +00:00
|
|
|
return (context.soft_body)
|
2009-07-03 20:03:24 +00:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
softbody = context.soft_body.settings
|
|
|
|
|
|
|
|
layout.itemR(softbody, "use_goal", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
md = context.soft_body
|
|
|
|
ob = context.object
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-07-02 19:41:31 +00:00
|
|
|
if md:
|
|
|
|
softbody = md.settings
|
2009-07-03 20:03:24 +00:00
|
|
|
layout.active = softbody.use_goal
|
2009-07-02 19:41:31 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
# Goal
|
2009-07-02 19:41:31 +00:00
|
|
|
split = layout.split()
|
2009-07-03 20:03:24 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Goal Strengths:")
|
|
|
|
col.itemR(softbody, "goal_default", text="Default")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(softbody, "goal_min", text="Minimum")
|
|
|
|
sub.itemR(softbody, "goal_max", text="Maximum")
|
2009-07-02 19:41:31 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Goal Settings:")
|
|
|
|
col.itemR(softbody, "goal_spring", text="Stiffness")
|
|
|
|
col.itemR(softbody, "goal_friction", text="Damping")
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-08 15:34:41 +00:00
|
|
|
layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
|
2009-07-03 20:03:24 +00:00
|
|
|
|
|
|
|
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
|
|
|
|
__label__ = "Soft Body Edges"
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-07-30 10:11:19 +00:00
|
|
|
return (context.soft_body)
|
2009-07-03 20:03:24 +00:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
softbody = context.soft_body.settings
|
|
|
|
|
|
|
|
layout.itemR(softbody, "use_edges", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
md = context.soft_body
|
|
|
|
ob = context.object
|
|
|
|
|
|
|
|
if md:
|
|
|
|
softbody = md.settings
|
|
|
|
|
|
|
|
layout.active = softbody.use_edges
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Springs:")
|
|
|
|
col.itemR(softbody, "pull")
|
|
|
|
col.itemR(softbody, "push")
|
|
|
|
col.itemR(softbody, "damp")
|
|
|
|
col.itemR(softbody, "plastic")
|
|
|
|
col.itemR(softbody, "bending")
|
|
|
|
col.itemR(softbody, "spring_length", text="Length")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(softbody, "stiff_quads")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = softbody.stiff_quads
|
|
|
|
sub.itemR(softbody, "shear")
|
2009-07-03 20:03:24 +00:00
|
|
|
|
|
|
|
col.itemR(softbody, "new_aero", text="Aero")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.enabled = softbody.new_aero
|
|
|
|
sub.itemR(softbody, "aero", text="Factor")
|
2009-07-03 20:03:24 +00:00
|
|
|
|
|
|
|
col.itemL(text="Collision:")
|
|
|
|
col.itemR(softbody, "edge_collision", text="Edge")
|
|
|
|
col.itemR(softbody, "face_collision", text="Face")
|
|
|
|
|
|
|
|
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
|
|
|
|
__label__ = "Soft Body Collision"
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-07-30 10:11:19 +00:00
|
|
|
return (context.soft_body)
|
2009-07-03 20:03:24 +00:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
softbody = context.soft_body.settings
|
|
|
|
|
|
|
|
layout.itemR(softbody, "self_collision", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
md = context.soft_body
|
|
|
|
ob = context.object
|
|
|
|
|
|
|
|
if md:
|
|
|
|
softbody = md.settings
|
|
|
|
|
|
|
|
layout.active = softbody.self_collision
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
layout.itemL(text="Collision Type:")
|
|
|
|
layout.itemR(softbody, "collision_type", expand=True)
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.itemL(text="Ball:")
|
|
|
|
col.itemR(softbody, "ball_size", text="Size")
|
|
|
|
col.itemR(softbody, "ball_stiff", text="Stiffness")
|
|
|
|
col.itemR(softbody, "ball_damp", text="Dampening")
|
|
|
|
|
|
|
|
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
|
|
|
|
__label__ = "Soft Body Solver"
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-07-30 10:11:19 +00:00
|
|
|
return (context.soft_body)
|
2009-07-03 20:03:24 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
md = context.soft_body
|
|
|
|
ob = context.object
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-07-03 20:03:24 +00:00
|
|
|
if md:
|
|
|
|
softbody = md.settings
|
|
|
|
|
|
|
|
# Solver
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemL(text="Step Size:")
|
|
|
|
col.itemR(softbody, "minstep")
|
|
|
|
col.itemR(softbody, "maxstep")
|
|
|
|
col.itemR(softbody, "auto_step", text="Auto-Step")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(softbody, "error_limit")
|
|
|
|
col.itemL(text="Helpers:")
|
|
|
|
col.itemR(softbody, "choke")
|
|
|
|
col.itemR(softbody, "fuzzy")
|
|
|
|
|
|
|
|
layout.itemL(text="Diagnostics:")
|
|
|
|
layout.itemR(softbody, "diagnose")
|
|
|
|
|
|
|
|
bpy.types.register(PHYSICS_PT_softbody)
|
2009-08-02 19:39:33 +00:00
|
|
|
bpy.types.register(PHYSICS_PT_softbody_cache)
|
2009-07-03 20:03:24 +00:00
|
|
|
bpy.types.register(PHYSICS_PT_softbody_goal)
|
|
|
|
bpy.types.register(PHYSICS_PT_softbody_edge)
|
|
|
|
bpy.types.register(PHYSICS_PT_softbody_collision)
|
|
|
|
bpy.types.register(PHYSICS_PT_softbody_solver)
|