2009-01-02 13:47:33 +00:00
/**
* $ Id $
*
* * * * * * BEGIN GPL LICENSE BLOCK * * * * *
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*
2009-06-03 22:19:04 +00:00
* Contributor ( s ) : Blender Foundation ( 2008 ) , Thomas Dinges
2009-01-02 13:47:33 +00:00
*
* * * * * * END GPL LICENSE BLOCK * * * * *
*/
# include <stdlib.h>
# include "RNA_define.h"
# include "RNA_types.h"
# include "rna_internal.h"
# include "DNA_object_types.h"
# include "DNA_object_force.h"
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
# include "DNA_particle_types.h"
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
# include "DNA_scene_types.h"
2009-01-02 13:47:33 +00:00
2009-07-02 19:41:31 +00:00
# include "WM_api.h"
2009-06-21 10:16:52 +00:00
# include "WM_types.h"
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
EnumPropertyItem effector_shape_items [ ] = {
{ PFIELD_SHAPE_POINT , " POINT " , 0 , " Point " , " " } ,
{ PFIELD_SHAPE_PLANE , " PLANE " , 0 , " Plane " , " " } ,
{ PFIELD_SHAPE_SURFACE , " SURFACE " , 0 , " Surface " , " " } ,
{ PFIELD_SHAPE_POINTS , " POINTS " , 0 , " Every Point " , " " } ,
{ 0 , NULL , 0 , NULL , NULL }
} ;
2009-10-05 13:25:56 +00:00
EnumPropertyItem curve_shape_items [ ] = {
{ PFIELD_SHAPE_POINT , " POINT " , 0 , " Point " , " " } ,
{ PFIELD_SHAPE_PLANE , " PLANE " , 0 , " Plane " , " " } ,
{ PFIELD_SHAPE_SURFACE , " SURFACE " , 0 , " Curve " , " " } ,
{ 0 , NULL , 0 , NULL , NULL }
} ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
EnumPropertyItem empty_shape_items [ ] = {
{ PFIELD_SHAPE_POINT , " POINT " , 0 , " Point " , " " } ,
{ PFIELD_SHAPE_PLANE , " PLANE " , 0 , " Plane " , " " } ,
{ 0 , NULL , 0 , NULL , NULL }
} ;
EnumPropertyItem vortex_shape_items [ ] = {
{ PFIELD_SHAPE_POINT , " POINT " , 0 , " Old " , " " } ,
{ PFIELD_SHAPE_PLANE , " PLANE " , 0 , " New " , " " } ,
{ PFIELD_SHAPE_SURFACE , " SURFACE " , 0 , " Surface falloff (New) " , " " } ,
{ PFIELD_SHAPE_POINTS , " POINTS " , 0 , " Every Point (New) " , " " } ,
{ 0 , NULL , 0 , NULL , NULL }
} ;
2009-10-05 13:25:56 +00:00
EnumPropertyItem curve_vortex_shape_items [ ] = {
{ PFIELD_SHAPE_POINT , " POINT " , 0 , " Old " , " " } ,
{ PFIELD_SHAPE_PLANE , " PLANE " , 0 , " New " , " " } ,
{ PFIELD_SHAPE_SURFACE , " SURFACE " , 0 , " Curve (New) " , " " } ,
{ 0 , NULL , 0 , NULL , NULL }
} ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
EnumPropertyItem empty_vortex_shape_items [ ] = {
{ PFIELD_SHAPE_POINT , " POINT " , 0 , " Old " , " " } ,
{ PFIELD_SHAPE_PLANE , " PLANE " , 0 , " New " , " " } ,
{ 0 , NULL , 0 , NULL , NULL }
} ;
2009-01-02 13:47:33 +00:00
# ifdef RNA_RUNTIME
2009-06-21 10:16:52 +00:00
# include "MEM_guardedalloc.h"
2009-07-02 19:41:31 +00:00
# include "DNA_modifier_types.h"
# include "DNA_texture_types.h"
2009-06-21 10:16:52 +00:00
# include "BKE_context.h"
2009-07-02 19:41:31 +00:00
# include "BKE_modifier.h"
2009-06-21 10:16:52 +00:00
# include "BKE_pointcache.h"
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
# include "BKE_depsgraph.h"
2009-06-21 10:16:52 +00:00
# include "BLI_blenlib.h"
2009-07-02 19:41:31 +00:00
# include "ED_object.h"
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
static void rna_Cache_change ( bContext * C , PointerRNA * ptr )
{
Object * ob = CTX_data_active_object ( C ) ;
PointCache * cache = ( PointCache * ) ptr - > data ;
PTCacheID * pid = NULL ;
ListBase pidlist ;
if ( ! ob )
return ;
cache - > flag | = PTCACHE_OUTDATED ;
BKE_ptcache_ids_from_object ( & pidlist , ob ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
DAG_id_flush_update ( & ob - > id , OB_RECALC_DATA ) ;
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
for ( pid = pidlist . first ; pid ; pid = pid - > next ) {
if ( pid - > cache = = cache )
break ;
}
if ( pid )
BKE_ptcache_update_info ( pid ) ;
BLI_freelistN ( & pidlist ) ;
}
2009-06-21 10:16:52 +00:00
static void rna_Cache_toggle_disk_cache ( bContext * C , PointerRNA * ptr )
{
Object * ob = CTX_data_active_object ( C ) ;
PointCache * cache = ( PointCache * ) ptr - > data ;
PTCacheID * pid = NULL ;
ListBase pidlist ;
if ( ! ob )
return ;
BKE_ptcache_ids_from_object ( & pidlist , ob ) ;
for ( pid = pidlist . first ; pid ; pid = pid - > next ) {
if ( pid - > cache = = cache )
break ;
}
if ( pid )
BKE_ptcache_toggle_disk_cache ( pid ) ;
BLI_freelistN ( & pidlist ) ;
}
static void rna_Cache_idname_change ( bContext * C , PointerRNA * ptr )
{
Object * ob = CTX_data_active_object ( C ) ;
PointCache * cache = ( PointCache * ) ptr - > data ;
2009-07-09 19:49:04 +00:00
PTCacheID * pid = NULL , * pid2 = NULL ;
2009-06-21 10:16:52 +00:00
ListBase pidlist ;
int new_name = 1 ;
char name [ 80 ] ;
if ( ! ob )
return ;
/* TODO: check for proper characters */
BKE_ptcache_ids_from_object ( & pidlist , ob ) ;
2009-07-23 00:19:01 +00:00
if ( cache - > flag & PTCACHE_EXTERNAL ) {
for ( pid = pidlist . first ; pid ; pid = pid - > next ) {
if ( pid - > cache = = cache )
break ;
2009-06-21 10:16:52 +00:00
}
2009-07-23 00:19:01 +00:00
if ( ! pid )
return ;
cache - > flag | = ( PTCACHE_BAKED | PTCACHE_DISK_CACHE | PTCACHE_SIMULATION_VALID ) ;
cache - > flag & = ~ ( PTCACHE_OUTDATED | PTCACHE_FRAMES_SKIPPED ) ;
BKE_ptcache_load_external ( pid ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
DAG_id_flush_update ( & ob - > id , OB_RECALC_DATA ) ;
2009-06-21 10:16:52 +00:00
}
2009-07-23 00:19:01 +00:00
else {
for ( pid = pidlist . first ; pid ; pid = pid - > next ) {
if ( pid - > cache = = cache )
pid2 = pid ;
else if ( strcmp ( cache - > name , " " ) & & strcmp ( cache - > name , pid - > cache - > name ) = = 0 ) {
/*TODO: report "name exists" to user */
strcpy ( cache - > name , cache - > prev_name ) ;
new_name = 0 ;
}
}
2009-06-21 10:16:52 +00:00
2009-07-23 00:19:01 +00:00
if ( new_name ) {
if ( pid2 & & cache - > flag & PTCACHE_DISK_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
/* TODO: change to simple file rename */
2009-07-23 00:19:01 +00:00
strcpy ( name , cache - > name ) ;
strcpy ( cache - > name , cache - > prev_name ) ;
2009-06-21 10:16:52 +00:00
2009-07-23 00:19:01 +00:00
cache - > flag & = ~ PTCACHE_DISK_CACHE ;
2009-06-21 10:16:52 +00:00
2009-07-23 00:19:01 +00:00
BKE_ptcache_toggle_disk_cache ( pid2 ) ;
2009-06-21 10:16:52 +00:00
2009-07-23 00:19:01 +00:00
strcpy ( cache - > name , name ) ;
2009-06-21 10:16:52 +00:00
2009-07-23 00:19:01 +00:00
cache - > flag | = PTCACHE_DISK_CACHE ;
2009-06-21 10:16:52 +00:00
2009-07-23 00:19:01 +00:00
BKE_ptcache_toggle_disk_cache ( pid2 ) ;
}
2009-06-21 10:16:52 +00:00
2009-07-23 00:19:01 +00:00
strcpy ( cache - > prev_name , cache - > name ) ;
}
2009-06-21 10:16:52 +00:00
}
BLI_freelistN ( & pidlist ) ;
}
2009-06-27 14:02:21 +00:00
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
static void rna_Cache_list_begin ( CollectionPropertyIterator * iter , PointerRNA * ptr )
{
Object * ob = ptr - > id . data ;
PointCache * cache = ptr - > data ;
PTCacheID * pid ;
ListBase pidlist ;
BKE_ptcache_ids_from_object ( & pidlist , ob ) ;
for ( pid = pidlist . first ; pid ; pid = pid - > next ) {
if ( pid - > cache = = cache ) {
rna_iterator_listbase_begin ( iter , pid - > ptcaches , NULL ) ;
break ;
}
}
BLI_freelistN ( & pidlist ) ;
}
static void rna_Cache_active_point_cache_index_range ( PointerRNA * ptr , int * min , int * max )
{
Object * ob = ptr - > id . data ;
PointCache * cache = ptr - > data ;
PTCacheID * pid ;
ListBase pidlist ;
BKE_ptcache_ids_from_object ( & pidlist , ob ) ;
* min = 0 ;
* max = 0 ;
for ( pid = pidlist . first ; pid ; pid = pid - > next ) {
if ( pid - > cache = = cache ) {
* max = BLI_countlist ( pid - > ptcaches ) - 1 ;
* max = MAX2 ( 0 , * max ) ;
break ;
}
}
BLI_freelistN ( & pidlist ) ;
}
static int rna_Cache_active_point_cache_index_get ( PointerRNA * ptr )
{
Object * ob = ptr - > id . data ;
PointCache * cache = ptr - > data ;
PTCacheID * pid ;
ListBase pidlist ;
int num = 0 ;
BKE_ptcache_ids_from_object ( & pidlist , ob ) ;
for ( pid = pidlist . first ; pid ; pid = pid - > next ) {
if ( pid - > cache = = cache ) {
num = BLI_findindex ( pid - > ptcaches , cache ) ;
break ;
}
}
BLI_freelistN ( & pidlist ) ;
return num ;
}
static void rna_Cache_active_point_cache_index_set ( struct PointerRNA * ptr , int value )
{
Object * ob = ptr - > id . data ;
PointCache * cache = ptr - > data ;
PTCacheID * pid ;
ListBase pidlist ;
BKE_ptcache_ids_from_object ( & pidlist , ob ) ;
for ( pid = pidlist . first ; pid ; pid = pid - > next ) {
if ( pid - > cache = = cache ) {
* ( pid - > cache_ptr ) = BLI_findlink ( pid - > ptcaches , value ) ;
break ;
}
}
BLI_freelistN ( & pidlist ) ;
}
2009-06-27 14:02:21 +00:00
static int rna_SoftBodySettings_use_edges_get ( PointerRNA * ptr )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
return ( ( ( data - > softflag ) & OB_SB_EDGES ) ! = 0 ) ;
}
static void rna_SoftBodySettings_use_edges_set ( PointerRNA * ptr , int value )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
if ( value ) data - > softflag | = OB_SB_EDGES ;
else data - > softflag & = ~ OB_SB_EDGES ;
}
static int rna_SoftBodySettings_use_goal_get ( PointerRNA * ptr )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
return ( ( ( data - > softflag ) & OB_SB_GOAL ) ! = 0 ) ;
}
static void rna_SoftBodySettings_use_goal_set ( PointerRNA * ptr , int value )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
if ( value ) data - > softflag | = OB_SB_GOAL ;
else data - > softflag & = ~ OB_SB_GOAL ;
}
static int rna_SoftBodySettings_stiff_quads_get ( PointerRNA * ptr )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
return ( ( ( data - > softflag ) & OB_SB_QUADS ) ! = 0 ) ;
}
static void rna_SoftBodySettings_stiff_quads_set ( PointerRNA * ptr , int value )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
if ( value ) data - > softflag | = OB_SB_QUADS ;
else data - > softflag & = ~ OB_SB_QUADS ;
}
static int rna_SoftBodySettings_self_collision_get ( PointerRNA * ptr )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
return ( ( ( data - > softflag ) & OB_SB_SELF ) ! = 0 ) ;
}
static void rna_SoftBodySettings_self_collision_set ( PointerRNA * ptr , int value )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
if ( value ) data - > softflag | = OB_SB_SELF ;
else data - > softflag & = ~ OB_SB_SELF ;
}
static int rna_SoftBodySettings_new_aero_get ( PointerRNA * ptr )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
return ( ( ( data - > softflag ) & OB_SB_AERO_ANGLE ) ! = 0 ) ;
}
static void rna_SoftBodySettings_new_aero_set ( PointerRNA * ptr , int value )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
if ( value ) data - > softflag | = OB_SB_AERO_ANGLE ;
else data - > softflag & = ~ OB_SB_AERO_ANGLE ;
}
static int rna_SoftBodySettings_face_collision_get ( PointerRNA * ptr )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
return ( ( ( data - > softflag ) & OB_SB_FACECOLL ) ! = 0 ) ;
}
static void rna_SoftBodySettings_face_collision_set ( PointerRNA * ptr , int value )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
if ( value ) data - > softflag | = OB_SB_FACECOLL ;
else data - > softflag & = ~ OB_SB_FACECOLL ;
}
static int rna_SoftBodySettings_edge_collision_get ( PointerRNA * ptr )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
return ( ( ( data - > softflag ) & OB_SB_EDGECOLL ) ! = 0 ) ;
}
static void rna_SoftBodySettings_edge_collision_set ( PointerRNA * ptr , int value )
{
2009-08-02 19:39:33 +00:00
Object * data = ( Object * ) ( ptr - > id . data ) ;
2009-06-27 14:02:21 +00:00
if ( value ) data - > softflag | = OB_SB_EDGECOLL ;
else data - > softflag & = ~ OB_SB_EDGECOLL ;
}
2009-07-02 19:41:31 +00:00
static void rna_SoftBodySettings_goal_vgroup_get ( PointerRNA * ptr , char * value )
{
SoftBody * sb = ( SoftBody * ) ptr - > data ;
rna_object_vgroup_name_index_get ( ptr , value , sb - > vertgroup ) ;
}
static int rna_SoftBodySettings_goal_vgroup_length ( PointerRNA * ptr )
{
SoftBody * sb = ( SoftBody * ) ptr - > data ;
return rna_object_vgroup_name_index_length ( ptr , sb - > vertgroup ) ;
}
static void rna_SoftBodySettings_goal_vgroup_set ( PointerRNA * ptr , const char * value )
{
SoftBody * sb = ( SoftBody * ) ptr - > data ;
rna_object_vgroup_name_index_set ( ptr , value , & sb - > vertgroup ) ;
}
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
static int particle_field_check ( PointerRNA * ptr )
{
ID * id = ptr - > id . data ;
return ( GS ( id - > name ) = = ID_PA ) ;
}
2009-07-02 19:41:31 +00:00
static void rna_FieldSettings_update ( bContext * C , PointerRNA * ptr )
{
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
if ( particle_field_check ( ptr ) ) {
ParticleSettings * part = ( ParticleSettings * ) ptr - > id . data ;
if ( part - > pd - > forcefield ! = PFIELD_TEXTURE & & part - > pd - > tex ) {
part - > pd - > tex - > id . us - - ;
part - > pd - > tex = 0 ;
}
if ( part - > pd2 - > forcefield ! = PFIELD_TEXTURE & & part - > pd2 - > tex ) {
part - > pd2 - > tex - > id . us - - ;
part - > pd2 - > tex = 0 ;
}
DAG_id_flush_update ( & part - > id , OB_RECALC | PSYS_RECALC_RESET ) ;
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , NULL ) ;
2009-07-02 19:41:31 +00:00
}
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
else {
Object * ob = ( Object * ) ptr - > id . data ;
2009-07-02 19:41:31 +00:00
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
if ( ob - > pd - > forcefield ! = PFIELD_TEXTURE & & ob - > pd - > tex ) {
ob - > pd - > tex - > id . us - - ;
ob - > pd - > tex = 0 ;
}
DAG_id_flush_update ( & ob - > id , OB_RECALC_OB ) ;
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , ob ) ;
}
2009-07-02 19:41:31 +00:00
}
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
static void rna_FieldSettings_shape_update ( bContext * C , PointerRNA * ptr )
2009-07-02 19:41:31 +00:00
{
Scene * scene = CTX_data_scene ( C ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
if ( ! particle_field_check ( ptr ) ) {
Object * ob = ( Object * ) ptr - > id . data ;
PartDeflect * pd = ob - > pd ;
ModifierData * md = modifiers_findByType ( ob , eModifierType_Surface ) ;
/* add/remove modifier as needed */
if ( ! md ) {
if ( pd & & ( pd - > shape = = PFIELD_SHAPE_SURFACE ) & & ELEM ( pd - > forcefield , PFIELD_GUIDE , PFIELD_TEXTURE ) = = 0 )
2009-07-02 19:41:31 +00:00
if ( ELEM4 ( ob - > type , OB_MESH , OB_SURF , OB_FONT , OB_CURVE ) )
ED_object_modifier_add ( NULL , scene , ob , eModifierType_Surface ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
}
else {
if ( ! pd | | pd - > shape ! = PFIELD_SHAPE_SURFACE )
ED_object_modifier_remove ( NULL , scene , ob , md ) ;
}
2009-07-02 19:41:31 +00:00
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , ob ) ;
}
2009-07-02 19:41:31 +00:00
}
static void rna_FieldSettings_dependency_update ( bContext * C , PointerRNA * ptr )
{
Scene * scene = CTX_data_scene ( C ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
if ( particle_field_check ( ptr ) ) {
DAG_id_flush_update ( ( ID * ) ptr - > id . data , OB_RECALC | PSYS_RECALC_RESET ) ;
}
else {
Object * ob = ( Object * ) ptr - > id . data ;
2009-07-02 19:41:31 +00:00
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
/* do this before scene sort, that one checks for CU_PATH */
/* XXX if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) {
Curve * cu = ob - > data ;
cu - > flag | = ( CU_PATH | CU_3D ) ;
do_curvebuts ( B_CU3D ) ; // all curves too
} */
2009-07-02 19:41:31 +00:00
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
rna_FieldSettings_shape_update ( C , ptr ) ;
2009-07-02 19:41:31 +00:00
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
DAG_scene_sort ( scene ) ;
2009-07-02 19:41:31 +00:00
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
if ( ob - > type = = OB_CURVE & & ob - > pd - > forcefield = = PFIELD_GUIDE )
DAG_id_flush_update ( & ob - > id , OB_RECALC ) ;
else
DAG_id_flush_update ( & ob - > id , OB_RECALC_OB ) ;
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , ob ) ;
}
}
static void rna_EffectorWeight_update ( bContext * C , PointerRNA * ptr )
{
DAG_id_flush_update ( ( ID * ) ptr - > id . data , OB_RECALC_DATA | PSYS_RECALC_RESET ) ;
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , NULL ) ;
2009-07-02 19:41:31 +00:00
}
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
static void rna_EffectorWeight_dependency_update ( bContext * C , PointerRNA * ptr )
{
Scene * scene = CTX_data_scene ( C ) ;
DAG_scene_sort ( scene ) ;
DAG_id_flush_update ( ( ID * ) ptr - > id . data , OB_RECALC_DATA | PSYS_RECALC_RESET ) ;
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , NULL ) ;
}
2009-07-02 19:41:31 +00:00
static void rna_CollisionSettings_dependency_update ( bContext * C , PointerRNA * ptr )
{
Scene * scene = CTX_data_scene ( C ) ;
Object * ob = ( Object * ) ptr - > id . data ;
ModifierData * md = modifiers_findByType ( ob , eModifierType_Collision ) ;
/* add/remove modifier as needed */
if ( ob - > pd - > deflect & & ! md )
ED_object_modifier_add ( NULL , scene , ob , eModifierType_Collision ) ;
else if ( ! ob - > pd - > deflect & & md )
ED_object_modifier_remove ( NULL , scene , ob , md ) ;
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , ob ) ;
}
static void rna_CollisionSettings_update ( bContext * C , PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
DAG_id_flush_update ( & ob - > id , OB_RECALC ) ;
2009-07-02 19:41:31 +00:00
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , ob ) ;
}
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
static void rna_softbody_update ( bContext * C , PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
DAG_id_flush_update ( & ob - > id , OB_RECALC_DATA ) ;
WM_event_add_notifier ( C , NC_OBJECT | ND_MODIFIER , ob ) ;
}
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
static EnumPropertyItem * rna_Effector_shape_itemf ( bContext * C , PointerRNA * ptr , int * free )
{
Object * ob = NULL ;
if ( particle_field_check ( ptr ) )
return empty_shape_items ;
ob = ( Object * ) ptr - > id . data ;
2009-10-05 13:25:56 +00:00
if ( ob - > type = = OB_CURVE ) {
if ( ob - > pd - > forcefield = = PFIELD_VORTEX )
return curve_vortex_shape_items ;
return curve_shape_items ;
}
else if ( ELEM3 ( ob - > type , OB_MESH , OB_SURF , OB_FONT ) ) {
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
if ( ob - > pd - > forcefield = = PFIELD_VORTEX )
return vortex_shape_items ;
return effector_shape_items ;
}
else {
if ( ob - > pd - > forcefield = = PFIELD_VORTEX )
return empty_vortex_shape_items ;
return empty_shape_items ;
}
}
2009-01-02 13:47:33 +00:00
# else
static void rna_def_pointcache ( BlenderRNA * brna )
{
StructRNA * srna ;
2009-06-03 22:19:04 +00:00
PropertyRNA * prop ;
2009-01-02 13:47:33 +00:00
srna = RNA_def_struct ( brna , " PointCache " , NULL ) ;
RNA_def_struct_ui_text ( srna , " Point Cache " , " Point cache for physics simulations. " ) ;
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
RNA_def_struct_ui_icon ( srna , ICON_PHYSICS ) ;
2009-06-03 22:19:04 +00:00
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " start_frame " , PROP_INT , PROP_TIME ) ;
2009-06-03 22:19:04 +00:00
RNA_def_property_int_sdna ( prop , NULL , " startframe " ) ;
RNA_def_property_range ( prop , 1 , 300000 ) ;
RNA_def_property_ui_text ( prop , " Start " , " Frame on which the simulation starts. " ) ;
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " end_frame " , PROP_INT , PROP_TIME ) ;
2009-06-03 22:19:04 +00:00
RNA_def_property_int_sdna ( prop , NULL , " endframe " ) ;
RNA_def_property_range ( prop , 1 , 300000 ) ;
RNA_def_property_ui_text ( prop , " End " , " Frame on which the simulation stops. " ) ;
2009-06-05 23:59:33 +00:00
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
prop = RNA_def_property ( srna , " step " , PROP_INT , PROP_NONE ) ;
RNA_def_property_range ( prop , 1 , 20 ) ;
RNA_def_property_ui_text ( prop , " Cache Step " , " Number of frames between cached frames. " ) ;
RNA_def_property_update ( prop , NC_OBJECT , " rna_Cache_change " ) ;
2009-07-23 00:19:01 +00:00
prop = RNA_def_property ( srna , " index " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " index " ) ;
RNA_def_property_range ( prop , - 1 , 100 ) ;
RNA_def_property_ui_text ( prop , " Cache Index " , " Index number of cache files. " ) ;
RNA_def_property_update ( prop , NC_OBJECT , " rna_Cache_idname_change " ) ;
2009-06-05 23:59:33 +00:00
/* flags */
prop = RNA_def_property ( srna , " baked " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PTCACHE_BAKED ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-06-05 23:59:33 +00:00
prop = RNA_def_property ( srna , " baking " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PTCACHE_BAKING ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-06-21 10:16:52 +00:00
prop = RNA_def_property ( srna , " disk_cache " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PTCACHE_DISK_CACHE ) ;
RNA_def_property_ui_text ( prop , " Disk Cache " , " Save cache files to disk " ) ;
RNA_def_property_update ( prop , NC_OBJECT , " rna_Cache_toggle_disk_cache " ) ;
prop = RNA_def_property ( srna , " outdated " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PTCACHE_OUTDATED ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Cache is outdated " , " " ) ;
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
prop = RNA_def_property ( srna , " frames_skipped " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PTCACHE_FRAMES_SKIPPED ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-06-21 10:16:52 +00:00
prop = RNA_def_property ( srna , " name " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_string_sdna ( prop , NULL , " name " ) ;
RNA_def_property_ui_text ( prop , " Name " , " Cache name " ) ;
RNA_def_property_update ( prop , NC_OBJECT , " rna_Cache_idname_change " ) ;
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
RNA_def_struct_name_property ( srna , prop ) ;
2009-06-21 10:16:52 +00:00
2009-07-23 00:19:01 +00:00
prop = RNA_def_property ( srna , " filepath " , PROP_STRING , PROP_DIRPATH ) ;
RNA_def_property_string_sdna ( prop , NULL , " path " ) ;
RNA_def_property_ui_text ( prop , " File Path " , " Cache file path. " ) ;
RNA_def_property_update ( prop , NC_OBJECT , " rna_Cache_idname_change " ) ;
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
prop = RNA_def_property ( srna , " quick_cache " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PTCACHE_QUICK_CACHE ) ;
RNA_def_property_ui_text ( prop , " Quick Cache " , " Update simulation with cache steps " ) ;
RNA_def_property_update ( prop , NC_OBJECT , " rna_Cache_change " ) ;
2009-06-21 10:16:52 +00:00
prop = RNA_def_property ( srna , " info " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_string_sdna ( prop , NULL , " info " ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Cache Info " , " Info on current cache status. " ) ;
2009-07-23 00:19:01 +00:00
prop = RNA_def_property ( srna , " external " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PTCACHE_EXTERNAL ) ;
RNA_def_property_ui_text ( prop , " External " , " Read cache from an external location " ) ;
RNA_def_property_update ( prop , NC_OBJECT , " rna_Cache_idname_change " ) ;
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
prop = RNA_def_property ( srna , " point_cache_list " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_funcs ( prop , " rna_Cache_list_begin " , " rna_iterator_listbase_next " , " rna_iterator_listbase_end " , " rna_iterator_listbase_get " , 0 , 0 , 0 , 0 , 0 ) ;
RNA_def_property_struct_type ( prop , " PointCache " ) ;
RNA_def_property_ui_text ( prop , " Point Cache List " , " Point cache list " ) ;
prop = RNA_def_property ( srna , " active_point_cache_index " , PROP_INT , PROP_UNSIGNED ) ;
RNA_def_property_int_funcs ( prop , " rna_Cache_active_point_cache_index_get " , " rna_Cache_active_point_cache_index_set " , " rna_Cache_active_point_cache_index_range " ) ;
RNA_def_property_ui_text ( prop , " Active Point Cache Index " , " " ) ;
RNA_def_property_update ( prop , NC_OBJECT , " rna_Cache_change " ) ;
2009-01-02 13:47:33 +00:00
}
static void rna_def_collision ( BlenderRNA * brna )
{
StructRNA * srna ;
2009-06-03 22:19:04 +00:00
PropertyRNA * prop ;
2009-01-02 13:47:33 +00:00
srna = RNA_def_struct ( brna , " CollisionSettings " , NULL ) ;
RNA_def_struct_sdna ( srna , " PartDeflect " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_ui_text ( srna , " Collision Settings " , " Collision settings for object in physics simulation. " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " enabled " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " deflect " , 1 ) ;
RNA_def_property_ui_text ( prop , " Enabled " , " Enable this objects as a collider for physics systems " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_dependency_update " ) ;
2009-06-03 22:19:04 +00:00
/* Particle Interaction */
prop = RNA_def_property ( srna , " damping_factor " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " pdef_damp " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Damping Factor " , " Amount of damping during particle collision " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " random_damping " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " pdef_rdamp " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Random Damping " , " Random variation of damping " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " friction_factor " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " pdef_frict " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Friction Factor " , " Amount of friction during particle collision " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " random_friction " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " pdef_rfrict " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Random Friction " , " Random variation of friction " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " permeability " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " pdef_perm " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Permeability " , " Chance that the particle will pass through the mesh " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " kill_particles " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PDEFLE_KILL_PART ) ;
RNA_def_property_ui_text ( prop , " Kill Particles " , " Kill collided particles " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
/* Soft Body and Cloth Interaction */
prop = RNA_def_property ( srna , " inner_thickness " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " pdef_sbift " ) ;
RNA_def_property_range ( prop , 0.001f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Inner Thickness " , " Inner face thickness " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " outer_thickness " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " pdef_sboft " ) ;
RNA_def_property_range ( prop , 0.001f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Outer Thickness " , " Outer face thickness " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " damping " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " pdef_sbdamp " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Damping " , " Amount of damping during collision " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
/* Does this belong here?
prop = RNA_def_property ( srna , " collision_stack " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " softflag " , OB_SB_COLLFINAL ) ;
RNA_def_property_ui_text ( prop , " Collision from Stack " , " Pick collision object from modifier stack (softbody only) " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-06-03 22:19:04 +00:00
*/
2009-09-21 21:19:58 +00:00
prop = RNA_def_property ( srna , " absorption " , PROP_FLOAT , PROP_FACTOR ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 1 , 2 ) ;
RNA_def_property_ui_text ( prop , " Absorption " , " How much of effector force gets lost during collision with this object (in percent). " ) ;
RNA_def_property_update ( prop , 0 , " rna_CollisionSettings_update " ) ;
2009-01-02 13:47:33 +00:00
}
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
static void rna_def_effector_weight ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " EffectorWeights " , NULL ) ;
RNA_def_struct_ui_text ( srna , " Effector Weights " , " Effector weights for physics simulation. " ) ;
RNA_def_struct_ui_icon ( srna , ICON_PHYSICS ) ;
/* Flags */
prop = RNA_def_property ( srna , " do_growing_hair " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , EFF_WEIGHT_DO_HAIR ) ;
RNA_def_property_ui_text ( prop , " Use For Growing Hair " , " Use force fields when growing hair. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
/* General */
prop = RNA_def_property ( srna , " group " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " group " ) ;
RNA_def_property_struct_type ( prop , " Group " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Effector Group " , " Limit effectors to this Group. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_dependency_update " ) ;
prop = RNA_def_property ( srna , " gravity " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " global_gravity " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Gravity " , " Global gravity weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
/* Effector weights */
prop = RNA_def_property ( srna , " all " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[0] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " All " , " All effector's weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
2009-10-05 13:25:56 +00:00
prop = RNA_def_property ( srna , " force " , PROP_FLOAT , PROP_NONE ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
RNA_def_property_float_sdna ( prop , NULL , " weight[1] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
2009-10-05 13:25:56 +00:00
RNA_def_property_ui_text ( prop , " Force " , " Force effector weight. " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " vortex " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[2] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Vortex " , " Vortex effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " magnetic " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[3] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Magnetic " , " Magnetic effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " wind " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[4] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Wind " , " Wind effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " curveguide " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[5] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Curve Guide " , " Curve guide effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " texture " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[6] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Texture " , " Texture effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " harmonic " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[7] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Harmonic " , " Harmonic effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " charge " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[8] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Charge " , " Charge effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " lennardjones " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[9] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Lennard-Jones " , " Lennard-Jones effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " boid " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[10] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Boid " , " Boid effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " turbulence " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[11] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Turbulence " , " Turbulence effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
prop = RNA_def_property ( srna , " drag " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " weight[12] " ) ;
RNA_def_property_range ( prop , - 200.0f , 200.0f ) ;
RNA_def_property_ui_range ( prop , 0.0f , 1.0f , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Drag " , " Drag effector weight. " ) ;
RNA_def_property_update ( prop , 0 , " rna_EffectorWeight_update " ) ;
}
2009-01-02 13:47:33 +00:00
static void rna_def_field ( BlenderRNA * brna )
{
StructRNA * srna ;
2009-06-03 22:19:04 +00:00
PropertyRNA * prop ;
static EnumPropertyItem field_type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 0 , " NONE " , 0 , " None " , " " } ,
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
{ PFIELD_FORCE , " FORCE " , 0 , " Force " , " " } ,
{ PFIELD_WIND , " WIND " , 0 , " Wind " , " " } ,
2009-06-16 00:52:21 +00:00
{ PFIELD_VORTEX , " VORTEX " , 0 , " Vortex " , " " } ,
{ PFIELD_MAGNET , " MAGNET " , 0 , " Magnetic " , " " } ,
{ PFIELD_HARMONIC , " HARMONIC " , 0 , " Harmonic " , " " } ,
{ PFIELD_CHARGE , " CHARGE " , 0 , " Charge " , " " } ,
{ PFIELD_LENNARDJ , " LENNARDJ " , 0 , " Lennard-Jones " , " " } ,
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
{ PFIELD_TEXTURE , " TEXTURE " , 0 , " Texture " , " " } ,
{ PFIELD_GUIDE , " GUIDE " , 0 , " Curve Guide " , " " } ,
2009-07-20 23:52:53 +00:00
{ PFIELD_BOID , " BOID " , 0 , " Boid " , " " } ,
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
{ PFIELD_TURBULENCE , " TURBULENCE " , 0 , " Turbulence " , " " } ,
{ PFIELD_DRAG , " DRAG " , 0 , " Drag " , " " } ,
2009-06-16 00:52:21 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
2009-06-03 22:19:04 +00:00
static EnumPropertyItem falloff_items [ ] = {
2009-06-16 00:52:21 +00:00
{ PFIELD_FALL_SPHERE , " SPHERE " , 0 , " Sphere " , " " } ,
{ PFIELD_FALL_TUBE , " TUBE " , 0 , " Tube " , " " } ,
{ PFIELD_FALL_CONE , " CONE " , 0 , " Cone " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-04 10:56:39 +00:00
static EnumPropertyItem texture_items [ ] = {
2009-06-16 00:52:21 +00:00
{ PFIELD_TEX_RGB , " RGB " , 0 , " RGB " , " " } ,
{ PFIELD_TEX_GRAD , " GRADIENT " , 0 , " Gradient " , " " } ,
{ PFIELD_TEX_CURL , " CURL " , 0 , " Curl " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-02 13:47:33 +00:00
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
static EnumPropertyItem zdirection_items [ ] = {
{ PFIELD_Z_BOTH , " BOTH " , 0 , " Both Z " , " " } ,
{ PFIELD_Z_POS , " POSITIVE " , 0 , " +Z " , " " } ,
{ PFIELD_Z_NEG , " NEGATIVE " , 0 , " -Z " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-10-02 20:15:25 +00:00
static EnumPropertyItem guide_kink_items [ ] = {
{ 0 , " NONE " , 0 , " Nothing " , " " } ,
{ 1 , " CURL " , 0 , " Curl " , " " } ,
{ 2 , " RADIAL " , 0 , " Radial " , " " } ,
{ 3 , " WAVE " , 0 , " Wave " , " " } ,
{ 4 , " BRAID " , 0 , " Braid " , " " } ,
{ 5 , " ROTATION " , 0 , " Rotation " , " " } ,
{ 6 , " ROLL " , 0 , " Roll " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
static EnumPropertyItem guide_kink_axis_items [ ] = {
{ 0 , " X " , 0 , " X " , " " } ,
{ 1 , " Y " , 0 , " Y " , " " } ,
{ 2 , " Z " , 0 , " Z " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
2009-01-02 13:47:33 +00:00
srna = RNA_def_struct ( brna , " FieldSettings " , NULL ) ;
RNA_def_struct_sdna ( srna , " PartDeflect " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_ui_text ( srna , " Field Settings " , " Field settings for an object in physics simulation. " ) ;
2009-06-27 11:57:50 +00:00
RNA_def_struct_ui_icon ( srna , ICON_PHYSICS ) ;
2009-06-03 22:19:04 +00:00
/* Enums */
2009-07-02 19:41:31 +00:00
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
2009-06-03 22:19:04 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " forcefield " ) ;
RNA_def_property_enum_items ( prop , field_type_items ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_ui_text ( prop , " Type " , " Type of field. " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_dependency_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
prop = RNA_def_property ( srna , " shape " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_items ( prop , effector_shape_items ) ;
RNA_def_property_enum_funcs ( prop , NULL , NULL , " rna_Effector_shape_itemf " ) ;
RNA_def_property_ui_text ( prop , " Shape " , " Which direction is used to calculate the effector force. " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_shape_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " falloff_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " falloff " ) ;
RNA_def_property_enum_items ( prop , falloff_items ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_ui_text ( prop , " Fall-Off " , " Fall-off shape. " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-03 22:19:04 +00:00
2009-06-04 10:56:39 +00:00
prop = RNA_def_property ( srna , " texture_mode " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " tex_mode " ) ;
RNA_def_property_enum_items ( prop , texture_items ) ;
RNA_def_property_ui_text ( prop , " Texture Mode " , " How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead) " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
prop = RNA_def_property ( srna , " z_direction " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " zdir " ) ;
RNA_def_property_enum_items ( prop , zdirection_items ) ;
RNA_def_property_ui_text ( prop , " Z Direction " , " Effect in full or only positive/negative Z direction. " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-04 10:56:39 +00:00
2009-06-03 22:19:04 +00:00
/* Float */
prop = RNA_def_property ( srna , " strength " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_strength " ) ;
RNA_def_property_range ( prop , - 1000.0f , 1000.0f ) ;
RNA_def_property_ui_text ( prop , " Strength " , " Strength of force field " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
/* different ui range to above */
prop = RNA_def_property ( srna , " linear_drag " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_strength " ) ;
RNA_def_property_range ( prop , - 2.0f , 2.0f ) ;
RNA_def_property_ui_text ( prop , " Linear Drag " , " Drag component proportional to velocity. " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " harmonic_damping " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_damp " ) ;
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Harmonic Damping " , " Damping of the harmonic force " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
/* different ui range to above */
prop = RNA_def_property ( srna , " quadratic_drag " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_damp " ) ;
RNA_def_property_range ( prop , - 2.0f , 2.0f ) ;
RNA_def_property_ui_text ( prop , " Quadratic Drag " , " Drag component proportional to the square of velocity. " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " flow " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_flow " ) ;
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Flow " , " Convert effector force into air flow velocity " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
/* different ui range to above */
prop = RNA_def_property ( srna , " inflow " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_flow " ) ;
RNA_def_property_range ( prop , - 10.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Inflow " , " Inwards component of the vortex force " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " size " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_size " ) ;
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Size " , " Size of the noise " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " falloff_power " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_power " ) ;
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Falloff Power " , " Falloff power (real gravitational falloff = 2) " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " minimum_distance " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " mindist " ) ;
RNA_def_property_range ( prop , 0.0f , 1000.0f ) ;
RNA_def_property_ui_text ( prop , " Minimum Distance " , " Minimum distance for the field's fall-off " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " maximum_distance " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " maxdist " ) ;
RNA_def_property_range ( prop , 0.0f , 1000.0f ) ;
RNA_def_property_ui_text ( prop , " Maximum Distance " , " Maximum distance for the field to work " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " radial_minimum " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " minrad " ) ;
RNA_def_property_range ( prop , 0.0f , 1000.0f ) ;
RNA_def_property_ui_text ( prop , " Minimum Radial Distance " , " Minimum radial distance for the field's fall-off " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " radial_maximum " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " maxrad " ) ;
RNA_def_property_range ( prop , 0.0f , 1000.0f ) ;
RNA_def_property_ui_text ( prop , " Maximum Radial Distance " , " Maximum radial distance for the field to work " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-03 22:19:04 +00:00
prop = RNA_def_property ( srna , " radial_falloff " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_power_r " ) ;
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Radial Falloff Power " , " Radial falloff power (real gravitational falloff = 2) " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-04 10:56:39 +00:00
2009-06-06 16:18:19 +00:00
prop = RNA_def_property ( srna , " texture_nabla " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " tex_nabla " ) ;
RNA_def_property_range ( prop , 0.0001f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Nabla " , " Defines size of derivative offset used for calculating gradient and curl " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-06 16:18:19 +00:00
prop = RNA_def_property ( srna , " noise " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_noise " ) ;
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Noise " , " Noise of the wind force " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-06 16:18:19 +00:00
2009-06-08 20:08:19 +00:00
prop = RNA_def_property ( srna , " seed " , PROP_INT , PROP_UNSIGNED ) ;
RNA_def_property_range ( prop , 1 , 128 ) ;
RNA_def_property_ui_text ( prop , " Seed " , " Seed of the wind noise " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-08 20:08:19 +00:00
2009-06-04 10:56:39 +00:00
/* Boolean */
prop = RNA_def_property ( srna , " use_min_distance " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_USEMIN ) ;
RNA_def_property_ui_text ( prop , " Use Min " , " Use a minimum distance for the field's fall-off " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-04 10:56:39 +00:00
prop = RNA_def_property ( srna , " use_max_distance " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_USEMAX ) ;
RNA_def_property_ui_text ( prop , " Use Max " , " Use a maximum distance for the field to work " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-04 10:56:39 +00:00
prop = RNA_def_property ( srna , " use_radial_min " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_USEMINR ) ;
RNA_def_property_ui_text ( prop , " Use Min " , " Use a minimum radial distance for the field's fall-off " ) ;
// "Use a minimum angle for the field's fall-off"
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-04 10:56:39 +00:00
prop = RNA_def_property ( srna , " use_radial_max " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_USEMAXR ) ;
RNA_def_property_ui_text ( prop , " Use Max " , " Use a maximum radial distance for the field to work " ) ;
// "Use a maximum angle for the field to work"
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
2009-06-04 10:56:39 +00:00
prop = RNA_def_property ( srna , " use_coordinates " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_TEX_OBJECT ) ;
RNA_def_property_ui_text ( prop , " Use Coordinates " , " Use object/global coordinates for texture " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
prop = RNA_def_property ( srna , " global_coordinates " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_GLOBAL_CO ) ;
RNA_def_property_ui_text ( prop , " Use Global Coordinates " , " Use effector/global coordinates for turbulence " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-04 10:56:39 +00:00
prop = RNA_def_property ( srna , " force_2d " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_TEX_2D ) ;
RNA_def_property_ui_text ( prop , " 2D " , " Apply force only in 2d " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-04 10:56:39 +00:00
2009-06-06 16:18:19 +00:00
prop = RNA_def_property ( srna , " root_coordinates " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 10:56:39 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_TEX_ROOTCO ) ;
RNA_def_property_ui_text ( prop , " Root Texture Coordinates " , " Texture coordinates from root particle locations " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
prop = RNA_def_property ( srna , " do_location " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_DO_LOCATION ) ;
RNA_def_property_ui_text ( prop , " Location " , " Effect particles' location " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " do_rotation " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_DO_ROTATION ) ;
RNA_def_property_ui_text ( prop , " Rotation " , " Effect particles' dynamic rotation " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-10-05 13:25:56 +00:00
prop = RNA_def_property ( srna , " do_absorption " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_VISIBILITY ) ;
RNA_def_property_ui_text ( prop , " Absorption " , " Force gets absorbed by collision objects " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-06-06 16:18:19 +00:00
/* Pointer */
prop = RNA_def_property ( srna , " texture " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " tex " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Texture " , " Texture to use as force " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
2009-10-02 20:15:25 +00:00
/********** Curve Guide Field Settings **********/
prop = RNA_def_property ( srna , " guide_minimum " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f_strength " ) ;
RNA_def_property_range ( prop , 0.0f , 1000.0f ) ;
RNA_def_property_ui_text ( prop , " Minimum Distance " , " The distance from which particles are affected fully. " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " guide_free " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " free_end " ) ;
RNA_def_property_range ( prop , 0.0f , 0.99f ) ;
RNA_def_property_ui_text ( prop , " Free " , " Guide-free time from particle life's end " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " guide_path_add " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , PFIELD_GUIDE_PATH_ADD ) ;
RNA_def_property_ui_text ( prop , " Additive " , " Based on distance/falloff it adds a portion of the entire path " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
/* Clump Settings */
prop = RNA_def_property ( srna , " guide_clump_amount " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " clump_fac " ) ;
RNA_def_property_range ( prop , - 1.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Amount " , " Amount of clumpimg " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " guide_clump_shape " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " clump_pow " ) ;
RNA_def_property_range ( prop , - 0.999f , 0.999f ) ;
RNA_def_property_ui_text ( prop , " Shape " , " Shape of clumpimg " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
/* Kink Settings */
prop = RNA_def_property ( srna , " guide_kink_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " kink " ) ;
RNA_def_property_enum_items ( prop , guide_kink_items ) ;
RNA_def_property_ui_text ( prop , " Kink " , " Type of periodic offset on the curve " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " guide_kink_axis " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " kink_axis " ) ;
RNA_def_property_enum_items ( prop , guide_kink_axis_items ) ;
RNA_def_property_ui_text ( prop , " Axis " , " Which axis to use for offset " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " guide_kink_frequency " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " kink_freq " ) ;
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Frequency " , " The frequency of the offset (1/total length) " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " guide_kink_shape " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " kink_shape " ) ;
RNA_def_property_range ( prop , - 0.999f , 0.999f ) ;
RNA_def_property_ui_text ( prop , " Shape " , " djust the offset to the beginning/end " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
prop = RNA_def_property ( srna , " guide_kink_amplitude " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " kink_amp " ) ;
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Amplitude " , " The amplitude of the offset " ) ;
RNA_def_property_update ( prop , 0 , " rna_FieldSettings_update " ) ;
/* Variables used for Curve Guide, allready wrapped, used for other fields too */
// falloff_power, use_max_distance, maximum_distance
2009-01-02 13:47:33 +00:00
}
static void rna_def_game_softbody ( BlenderRNA * brna )
{
StructRNA * srna ;
2009-08-01 10:36:05 +00:00
PropertyRNA * prop ;
2009-01-02 13:47:33 +00:00
srna = RNA_def_struct ( brna , " GameSoftBodySettings " , NULL ) ;
RNA_def_struct_sdna ( srna , " BulletSoftBody " ) ;
RNA_def_struct_ui_text ( srna , " Game Soft Body Settings " , " Soft body simulation settings for an object in the game engine. " ) ;
2009-08-01 10:36:05 +00:00
/* Floats */
prop = RNA_def_property ( srna , " linstiff " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " linStiff " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Linear Stiffness " , " Linear stiffness of the soft body links " ) ;
prop = RNA_def_property ( srna , " dynamic_friction " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " kDF " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Friction " , " Dynamic Friction " ) ;
prop = RNA_def_property ( srna , " threshold " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " kMT " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Threshold " , " Shape matching threshold " ) ;
prop = RNA_def_property ( srna , " margin " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " margin " ) ;
RNA_def_property_range ( prop , 0.01f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Margin " , " Collision margin for soft body. Small value makes the algorithm unstable " ) ;
prop = RNA_def_property ( srna , " welding " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " welding " ) ;
RNA_def_property_range ( prop , 0.0f , 0.01f ) ;
RNA_def_property_ui_text ( prop , " Welding " , " Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates) " ) ;
/* Integers */
prop = RNA_def_property ( srna , " position_iterations " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " piterations " ) ;
RNA_def_property_range ( prop , 0 , 10 ) ;
RNA_def_property_ui_text ( prop , " Position Iterations " , " Position solver iterations " ) ;
prop = RNA_def_property ( srna , " cluster_iterations " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " numclusteriterations " ) ;
RNA_def_property_range ( prop , 1 , 128 ) ;
RNA_def_property_ui_text ( prop , " Cluster Iterations " , " Specify the number of cluster iterations " ) ;
/* Booleans */
prop = RNA_def_property ( srna , " shape_match " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , OB_BSB_SHAPE_MATCHING ) ;
RNA_def_property_ui_text ( prop , " Shape Match " , " Enable soft body shape matching goal " ) ;
prop = RNA_def_property ( srna , " bending_const " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , OB_BSB_BENDING_CONSTRAINTS ) ;
RNA_def_property_ui_text ( prop , " Bending Const " , " Enable bending constraints " ) ;
2009-08-16 09:47:33 +00:00
prop = RNA_def_property ( srna , " cluster_rigid_to_softbody " , PROP_BOOLEAN , PROP_NONE ) ;
2009-08-01 10:36:05 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " collisionflags " , OB_BSB_COL_CL_RS ) ;
2009-08-16 09:47:33 +00:00
RNA_def_property_ui_text ( prop , " Rigid to Soft Body " , " Enable cluster collision between soft and rigid body " ) ;
2009-08-01 10:36:05 +00:00
2009-08-16 09:47:33 +00:00
prop = RNA_def_property ( srna , " cluster_soft_to_softbody " , PROP_BOOLEAN , PROP_NONE ) ;
2009-08-01 10:36:05 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " collisionflags " , OB_BSB_COL_CL_SS ) ;
2009-08-16 09:47:33 +00:00
RNA_def_property_ui_text ( prop , " Soft to Soft Body " , " Enable cluster collision between soft and soft body " ) ;
2009-01-02 13:47:33 +00:00
}
static void rna_def_softbody ( BlenderRNA * brna )
{
StructRNA * srna ;
2009-06-27 11:57:50 +00:00
PropertyRNA * prop ;
2009-06-27 13:20:19 +00:00
static EnumPropertyItem collision_type_items [ ] = {
{ SBC_MODE_MANUAL , " MANUAL " , 0 , " Manual " , " Manual adjust " } ,
2009-07-02 19:41:31 +00:00
{ SBC_MODE_AVG , " AVERAGE " , 0 , " Average " , " Average Spring length * Ball Size " } ,
{ SBC_MODE_MIN , " MINIMAL " , 0 , " Minimal " , " Minimal Spring length * Ball Size " } ,
{ SBC_MODE_MAX , " MAXIMAL " , 0 , " Maximal " , " Maximal Spring length * Ball Size " } ,
2009-06-27 13:20:19 +00:00
{ SBC_MODE_AVGMINMAX , " MINMAX " , 0 , " AvMinMax " , " (Min+Max)/2 * Ball Size " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-02 13:47:33 +00:00
srna = RNA_def_struct ( brna , " SoftBodySettings " , NULL ) ;
RNA_def_struct_sdna ( srna , " SoftBody " ) ;
RNA_def_struct_ui_text ( srna , " Soft Body Settings " , " Soft body simulation settings for an object. " ) ;
2009-06-27 11:57:50 +00:00
/* General Settings */
prop = RNA_def_property ( srna , " friction " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " mediafrict " ) ;
RNA_def_property_range ( prop , 0.0f , 50.0f ) ;
RNA_def_property_ui_text ( prop , " Friction " , " General media friction for point movements " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " mass " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " nodemass " ) ;
RNA_def_property_range ( prop , 0.0f , 50000.0f ) ;
RNA_def_property_ui_text ( prop , " Mass " , " " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " gravity " , PROP_FLOAT , PROP_ACCELERATION ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_float_sdna ( prop , NULL , " grav " ) ;
RNA_def_property_range ( prop , - 10.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Gravitation " , " Apply gravitation to point movement " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " speed " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " physics_speed " ) ;
RNA_def_property_range ( prop , 0.01f , 100.0f ) ;
RNA_def_property_ui_text ( prop , " Speed " , " Tweak timing for physics to control frequency and speed " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
/* Goal */
2009-07-02 19:41:31 +00:00
prop = RNA_def_property ( srna , " goal_vertex_group " , PROP_STRING , PROP_NONE ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_string_sdna ( prop , NULL , " vertgroup " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_string_funcs ( prop , " rna_SoftBodySettings_goal_vgroup_get " , " rna_SoftBodySettings_goal_vgroup_length " , " rna_SoftBodySettings_goal_vgroup_set " ) ;
RNA_def_property_ui_text ( prop , " Goal Vertex Group " , " Control point weight values. " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " goal_min " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " mingoal " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Goal Minimum " , " Goal minimum, vertex group weights are scaled to match this range. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " goal_max " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " maxgoal " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Goal Maximum " , " Goal maximum, vertex group weights are scaled to match this range. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " goal_default " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " defgoal " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Goal Default " , " Default Goal (vertex target position) value, when no Vertex Group used. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " goal_spring " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " goalspring " ) ;
RNA_def_property_range ( prop , 0.0f , 0.999f ) ;
RNA_def_property_ui_text ( prop , " Goal Stiffness " , " Goal (vertex target position) spring stiffness. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " goal_friction " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " goalfrict " ) ;
RNA_def_property_range ( prop , 0.0f , 50.0f ) ;
RNA_def_property_ui_text ( prop , " Goal Damping " , " Goal (vertex target position) friction. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
/* Edge Spring Settings */
prop = RNA_def_property ( srna , " pull " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " inspring " ) ;
2009-06-27 13:20:19 +00:00
RNA_def_property_range ( prop , 0.0f , 0.999f ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_ui_text ( prop , " Pull " , " Edge spring stiffness when longer than rest length " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " push " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " inpush " ) ;
2009-06-27 13:20:19 +00:00
RNA_def_property_range ( prop , 0.0f , 0.999f ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_ui_text ( prop , " Push " , " Edge spring stiffness when shorter than rest length " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " damp " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " infrict " ) ;
2009-06-27 13:20:19 +00:00
RNA_def_property_range ( prop , 0.0f , 50.0f ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_ui_text ( prop , " Damp " , " Edge spring friction " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
2009-07-02 19:41:31 +00:00
prop = RNA_def_property ( srna , " spring_length " , PROP_FLOAT , PROP_NONE ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_float_sdna ( prop , NULL , " springpreload " ) ;
2009-06-27 13:20:19 +00:00
RNA_def_property_range ( prop , 0.0f , 200.0f ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_ui_text ( prop , " SL " , " Alter spring length to shrink/blow up (unit %) 0 to disable " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " aero " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " aeroedge " ) ;
2009-06-27 13:20:19 +00:00
RNA_def_property_range ( prop , 0.0f , 30000.0f ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_ui_text ( prop , " Aero " , " Make edges 'sail' " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " plastic " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " plastic " ) ;
2009-06-27 13:20:19 +00:00
RNA_def_property_range ( prop , 0.0f , 100.0f ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_ui_text ( prop , " Plastic " , " Permanent deform " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " bending " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " secondspring " ) ;
2009-06-27 13:20:19 +00:00
RNA_def_property_range ( prop , 0.0f , 10.0f ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_ui_text ( prop , " Bending " , " Bending Stiffness " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 11:57:50 +00:00
prop = RNA_def_property ( srna , " shear " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " shearstiff " ) ;
2009-06-27 13:20:19 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-27 11:57:50 +00:00
RNA_def_property_ui_text ( prop , " Shear " , " Shear Stiffness " ) ;
2009-06-27 13:20:19 +00:00
/* Collision */
prop = RNA_def_property ( srna , " collision_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " sbc_mode " ) ;
RNA_def_property_enum_items ( prop , collision_type_items ) ;
RNA_def_property_ui_text ( prop , " Collision Type " , " Choose Collision Type " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " ball_size " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " colball " ) ;
RNA_def_property_range ( prop , - 10.0f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Ball Size " , " Absolute ball size or factor if not manual adjusted " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " ball_stiff " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " ballstiff " ) ;
RNA_def_property_range ( prop , 0.001f , 100.0f ) ;
RNA_def_property_ui_text ( prop , " Ball Size " , " Ball inflating presure " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " ball_damp " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " balldamp " ) ;
RNA_def_property_range ( prop , 0.001f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Ball Size " , " Blending to inelastic collision " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
/* Solver */
prop = RNA_def_property ( srna , " error_limit " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " rklimit " ) ;
RNA_def_property_range ( prop , 0.001f , 10.0f ) ;
RNA_def_property_ui_text ( prop , " Error Limit " , " The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " minstep " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " minloops " ) ;
RNA_def_property_range ( prop , 0 , 30000 ) ;
RNA_def_property_ui_text ( prop , " Min Step " , " Minimal # solver steps/frame " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " maxstep " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " maxloops " ) ;
RNA_def_property_range ( prop , 0 , 30000 ) ;
RNA_def_property_ui_text ( prop , " Max Step " , " Maximal # solver steps/frame " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " choke " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " choke " ) ;
RNA_def_property_range ( prop , 0 , 100 ) ;
RNA_def_property_ui_text ( prop , " Choke " , " 'Viscosity' inside collision target " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " fuzzy " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " fuzzyness " ) ;
RNA_def_property_range ( prop , 1 , 100 ) ;
RNA_def_property_ui_text ( prop , " Fuzzy " , " Fuzzyness while on collision, high values make collsion handling faster but less stable " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " auto_step " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " solverflags " , SBSO_OLDERR ) ;
RNA_def_property_ui_text ( prop , " V " , " Use velocities for automagic step sizes " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 13:20:19 +00:00
prop = RNA_def_property ( srna , " diagnose " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " solverflags " , SBSO_MONITOR ) ;
RNA_def_property_ui_text ( prop , " Print Performance to Console " , " Turn on SB diagnose console prints " ) ;
2009-06-27 14:02:21 +00:00
/* Flags */
prop = RNA_def_property ( srna , " use_goal " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_funcs ( prop , " rna_SoftBodySettings_use_goal_get " , " rna_SoftBodySettings_use_goal_set " ) ;
RNA_def_property_ui_text ( prop , " Use Goal " , " Define forces for vertices to stick to animated position. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 14:02:21 +00:00
prop = RNA_def_property ( srna , " use_edges " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_funcs ( prop , " rna_SoftBodySettings_use_edges_get " , " rna_SoftBodySettings_use_edges_set " ) ;
RNA_def_property_ui_text ( prop , " Use Edges " , " Use Edges as springs " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 14:02:21 +00:00
prop = RNA_def_property ( srna , " stiff_quads " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_funcs ( prop , " rna_SoftBodySettings_stiff_quads_get " , " rna_SoftBodySettings_stiff_quads_set " ) ;
RNA_def_property_ui_text ( prop , " Stiff Quads " , " Adds diagonal springs on 4-gons. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 14:02:21 +00:00
prop = RNA_def_property ( srna , " edge_collision " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_funcs ( prop , " rna_SoftBodySettings_edge_collision_get " , " rna_SoftBodySettings_edge_collision_set " ) ;
RNA_def_property_ui_text ( prop , " Edge Collision " , " Edges collide too. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 14:02:21 +00:00
prop = RNA_def_property ( srna , " face_collision " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_funcs ( prop , " rna_SoftBodySettings_face_collision_get " , " rna_SoftBodySettings_face_collision_set " ) ;
RNA_def_property_ui_text ( prop , " Face Collision " , " Faces collide too, SLOOOOOW warning. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 14:02:21 +00:00
prop = RNA_def_property ( srna , " new_aero " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_funcs ( prop , " rna_SoftBodySettings_new_aero_get " , " rna_SoftBodySettings_new_aero_set " ) ;
RNA_def_property_ui_text ( prop , " N " , " New aero(uses angle and length). " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
2009-06-27 14:02:21 +00:00
prop = RNA_def_property ( srna , " self_collision " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_funcs ( prop , " rna_SoftBodySettings_self_collision_get " , " rna_SoftBodySettings_self_collision_set " ) ;
RNA_def_property_ui_text ( prop , " Self Collision " , " Enable naive vertex ball self collision. " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_softbody_update " ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
prop = RNA_def_property ( srna , " effector_weights " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , " EffectorWeights " ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Effector Weights " , " " ) ;
2009-01-02 13:47:33 +00:00
}
void RNA_def_object_force ( BlenderRNA * brna )
{
rna_def_pointcache ( brna ) ;
rna_def_collision ( brna ) ;
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
rna_def_effector_weight ( brna ) ;
2009-01-02 13:47:33 +00:00
rna_def_field ( brna ) ;
rna_def_game_softbody ( brna ) ;
rna_def_softbody ( brna ) ;
}
# endif