[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25580] trunk/blender: Try to get soft body to curve working
Jens Ole Wund (bjornmose)
bjornmose at gmx.net
Mon Dec 28 01:07:24 CET 2009
Revision: 25580
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25580
Author: bjornmose
Date: 2009-12-28 01:07:24 +0100 (Mon, 28 Dec 2009)
Log Message:
-----------
Try to get soft body to curve working
Modified Paths:
--------------
trunk/blender/release/scripts/ui/properties_physics_softbody.py
trunk/blender/source/blender/blenkernel/intern/softbody.c
trunk/blender/source/blender/editors/space_view3d/drawobject.c
trunk/blender/source/blender/makesrna/intern/rna_object_force.c
Modified: trunk/blender/release/scripts/ui/properties_physics_softbody.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_softbody.py 2009-12-27 23:37:13 UTC (rev 25579)
+++ trunk/blender/release/scripts/ui/properties_physics_softbody.py 2009-12-28 00:07:24 UTC (rev 25580)
@@ -264,6 +264,7 @@
layout.label(text="Diagnostics:")
layout.prop(softbody, "diagnose")
+ layout.prop(softbody, "estimate_matrix")
class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
Modified: trunk/blender/source/blender/blenkernel/intern/softbody.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/softbody.c 2009-12-27 23:37:13 UTC (rev 25579)
+++ trunk/blender/source/blender/blenkernel/intern/softbody.c 2009-12-28 00:07:24 UTC (rev 25580)
@@ -3608,7 +3608,7 @@
if(sb){
BodyPoint *bp= sb->bpoint;
int a;
- if(sb->solverflags & SBSO_MONITOR ||sb->solverflags & SBSO_ESTIMATEIPO){SB_estimate_transform(ob,sb->lcom,sb->lrot,sb->lscale);}
+ if(sb->solverflags & SBSO_ESTIMATEIPO){SB_estimate_transform(ob,sb->lcom,sb->lrot,sb->lscale);}
/* inverse matrix is not uptodate... */
invert_m4_m4(ob->imat, ob->obmat);
@@ -3836,9 +3836,19 @@
free_scratch(sb); /* clear if any */
sb_new_scratch(sb); /* make a new */
sb->scratch->needstobuildcollider=1;
+ zero_v3(sb->lcom);
+ unit_m3(sb->lrot);
+ unit_m3(sb->lscale);
+
+
/* copy some info to scratch */
- if (1) reference_to_scratch(ob); /* wa only need that if we want to reconstruct IPO */
+ /* we only need that if we want to reconstruct IPO */
+ if(1) {
+ reference_to_scratch(ob);
+ SB_estimate_transform(ob,NULL,NULL,NULL);
+ SB_estimate_transform(ob,NULL,NULL,NULL);
+ }
switch(ob->type) {
case OB_MESH:
if (ob->softflag & OB_SB_FACECOLL) mesh_faces_to_scratch(ob);
Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c 2009-12-27 23:37:13 UTC (rev 25579)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c 2009-12-28 00:07:24 UTC (rev 25580)
@@ -5909,7 +5909,7 @@
SoftBody *sb = 0;
float tipw = 0.5f, tiph = 0.5f,drawsize = 4.0f;
if ((sb= ob->soft)){
- if(sb->solverflags & SBSO_MONITOR ||sb->solverflags & SBSO_ESTIMATEIPO){
+ if(sb->solverflags & SBSO_ESTIMATEIPO){
wmLoadMatrix(rv3d->viewmat);
copy_m3_m3(msc,sb->lscale);
Modified: trunk/blender/source/blender/makesrna/intern/rna_object_force.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object_force.c 2009-12-27 23:37:13 UTC (rev 25579)
+++ trunk/blender/source/blender/makesrna/intern/rna_object_force.c 2009-12-28 00:07:24 UTC (rev 25580)
@@ -1381,6 +1381,8 @@
{
StructRNA *srna;
PropertyRNA *prop;
+ int matrix_dimsize[]= {3, 3};
+
static EnumPropertyItem collision_type_items[] = {
{SBC_MODE_MANUAL, "MANUAL", 0, "Manual", "Manual adjust"},
@@ -1586,6 +1588,33 @@
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");
+ prop= RNA_def_property(srna, "estimate_matrix", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_ESTIMATEIPO);
+ RNA_def_property_ui_text(prop, "Estimate matrix", "esimate matrix .. split to COM , ROT ,SCALE ");
+
+
+ /***********************************************************************************/
+ /* these are not exactly settings, but reading calculated results*/
+ /* but i did not want to start a new property struct */
+ /* so rather rename this from SoftBodySettings to SoftBody */
+ /* translation */
+ prop= RNA_def_property(srna, "lcom", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "lcom");
+ RNA_def_property_ui_text(prop, "Center of mass", "Location of Center of mass.");
+
+ /* matrix */
+ prop= RNA_def_property(srna, "lrot", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "lrot");
+ RNA_def_property_multi_array(prop, 2, matrix_dimsize);
+ RNA_def_property_ui_text(prop, "Rot Matrix", "Estimated rotation matrix.");
+
+ prop= RNA_def_property(srna, "lscale", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "lscale");
+ RNA_def_property_multi_array(prop, 2, matrix_dimsize);
+ RNA_def_property_ui_text(prop, "Scale Matrix", "Estimated scale matrix.");
+ /***********************************************************************************/
+
+
/* Flags */
prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE);
More information about the Bf-blender-cvs
mailing list