[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24336] trunk/blender: Added mass and spring vertex groups to softbody rna/ui

Agustin Benavidez agustinbenavidez at gmail.com
Fri Nov 6 11:00:18 CET 2009


Yea! I already save this commit in a file, but for people like us,
after a hole day of work with the head totally burned would be great
have some detailed explanations about severals commints in differents
areas.


So i Propouse to Bretch, Matt, Campell, Joushua, theet, Ton etc.:
   Next important commit, you can document it a liitle bit more and
put it without any format in the wiki, just put it there and alert us,
so we'll give the right format and so, to save work for you all!


I really want to help soon and, in the near future, add more features,
but it seems that i must to feace a not motivating and painful
learning, so first step: I'll change my nick name to the Figureouter.

Cheers!
Figureouter, know time ago as Agus3D.



2009/11/5 Campbell Barton <ideasman42 at gmail.com>:
> Hey Bjornmose, I think there are quite a few devs in your position
> that haven't been so active since 2.4x and I can definitely understand
> how using rna is confusing initially.
> (big Thank you to Matt also!)
>
> the way python hooks in with rna is also not always obvious especially
> when it comes to context.
> wrapping ints/floats is quite simple but collections/arrays/pointers
> can be tricky too.
>
> Even if commits like this were linked to from the wiki they would be
> very useful, as long as the api doesn't change too much.
>
> Side note: It seems there are fairly few people who understand RNA
> well, Brecht wrote it, Algorith animated it, I wrapped it, Vekoon
> added functions to it but who else?
> Understanding its internals isn't always necessary so it might not be so bad.
>
> Incidentally I still didn't read any of the RNA docs, Being so used to
> undocumented API's with blender, just looked over the api functions.
>
> On Fri, Nov 6, 2009 at 12:18 AM, bjornmose <bjornmose at gmx.net> wrote:
>> Hi Matt
>> I'd like to give you a big  'Thank you' .
>> This looks generic enough to be a template for
>> 'blender developers wiki' : How to plug an object ( or what ever  )
>> property to the blender UI .
>> Well, may be I missed existing docs, but then they are not clearly
>> visible on the blender.org page, which i would choose for 1rst
>> developers information ( as if i don't know 42th Murphy's law:  "The
>> information you look for is never at the place you would expect it to
>> be, but pretty close to the other end of the known universe" )
>> So point the flame thrower on me .. (i am used to it)  .. still ..
>> search engines  will find this and may be help other coders to ship
>> trough /Skylla/ and /Charybdi/s
>> at ease.
>>
>>
>>
>> Matt Ebb wrote:
>>> Revision: 24336
>>>           http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24336
>>> Author:   broken
>>> Date:     2009-11-05 03:50:26 +0100 (Thu, 05 Nov 2009)
>>>
>>> Log Message:
>>> -----------
>>> Added mass and spring vertex groups to softbody rna/ui
>>>
>>> Modified Paths:
>>> --------------
>>>     trunk/blender/release/scripts/ui/properties_physics_softbody.py
>>>     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-11-05 02:21:04 UTC (rev 24335)
>>> +++ trunk/blender/release/scripts/ui/properties_physics_softbody.py   2009-11-05 02:50:26 UTC (rev 24336)
>>> @@ -73,8 +73,9 @@
>>>
>>>              col = split.column()
>>>              col.itemL(text="Object:")
>>> +            col.itemR(softbody, "friction")
>>>              col.itemR(softbody, "mass")
>>> -            col.itemR(softbody, "friction")
>>> +            col.item_pointerR(softbody, "mass_vertex_group", ob, "vertex_groups", text="Mass:")
>>>
>>>              col = split.column()
>>>              col.itemL(text="Simulation:")
>>> @@ -167,6 +168,7 @@
>>>          col.itemR(softbody, "plastic")
>>>          col.itemR(softbody, "bending")
>>>          col.itemR(softbody, "spring_length", text="Length")
>>> +        col.item_pointerR(softbody, "spring_vertex_group", ob, "vertex_groups", text="Springs:")
>>>
>>>          col = split.column()
>>>          col.itemR(softbody, "stiff_quads")
>>>
>>> Modified: trunk/blender/source/blender/makesrna/intern/rna_object_force.c
>>> ===================================================================
>>> --- trunk/blender/source/blender/makesrna/intern/rna_object_force.c   2009-11-05 02:21:04 UTC (rev 24335)
>>> +++ trunk/blender/source/blender/makesrna/intern/rna_object_force.c   2009-11-05 02:50:26 UTC (rev 24336)
>>> @@ -412,6 +412,19 @@
>>>       rna_object_vgroup_name_index_set(ptr, value, &sb->vertgroup);
>>>  }
>>>
>>> +static void rna_SoftBodySettings_mass_vgroup_set(PointerRNA *ptr, const char *value)
>>> +{
>>> +     SoftBody *sb= (SoftBody*)ptr->data;
>>> +     rna_object_vgroup_name_set(ptr, value, sb->namedVG_Mass, sizeof(sb->namedVG_Mass));
>>> +}
>>> +
>>> +static void rna_SoftBodySettings_spring_vgroup_set(PointerRNA *ptr, const char *value)
>>> +{
>>> +     SoftBody *sb= (SoftBody*)ptr->data;
>>> +     rna_object_vgroup_name_set(ptr, value, sb->namedVG_Spring_K, sizeof(sb->namedVG_Spring_K));
>>> +}
>>> +
>>> +
>>>  static char *rna_SoftBodySettings_path(PointerRNA *ptr)
>>>  {
>>>       Object *ob= (Object*)ptr->id.data;
>>> @@ -1392,6 +1405,12 @@
>>>       RNA_def_property_ui_text(prop, "Mass", "");
>>>       RNA_def_property_update(prop, 0, "rna_softbody_update");
>>>
>>> +     prop= RNA_def_property(srna, "mass_vertex_group", PROP_STRING, PROP_NONE);
>>> +     RNA_def_property_string_sdna(prop, NULL, "namedVG_Mass");
>>> +     RNA_def_property_ui_text(prop, "Mass Vertex Group", "Control point mass values.");
>>> +     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoftBodySettings_mass_vgroup_set");
>>> +     RNA_def_property_update(prop, 0, "rna_softbody_update");
>>> +
>>>       prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
>>>       RNA_def_property_float_sdna(prop, NULL, "grav");
>>>       RNA_def_property_range(prop, -10.0f, 10.0f);
>>> @@ -1490,6 +1509,12 @@
>>>       RNA_def_property_range(prop, 0.0f, 1.0f);
>>>       RNA_def_property_ui_text(prop, "Shear", "Shear Stiffness");
>>>
>>> +     prop= RNA_def_property(srna, "spring_vertex_group", PROP_STRING, PROP_NONE);
>>> +     RNA_def_property_string_sdna(prop, NULL, "namedVG_Spring_K");
>>> +     RNA_def_property_ui_text(prop, "Spring Vertex Group", "Control point spring strength values.");
>>> +     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoftBodySettings_spring_vgroup_set");
>>> +     RNA_def_property_update(prop, 0, "rna_softbody_update");
>>> +
>>>       /* Collision */
>>>
>>>       prop= RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE);
>>>
>>>
>>> _______________________________________________
>>> Bf-blender-cvs mailing list
>>> Bf-blender-cvs at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>>>
>>>
>>
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>>
>
>
>
> --
> - Campbell
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list