[Bf-committers] Group freeing bug
Ton Roosendaal
ton at blender.org
Sun Mar 19 18:24:05 CET 2006
Hi,
The 'from group' flag was not really meant to be accurate, but more
quick finding a drawing color for example.
Group membership has to be evaluated with a function call.
The group flags themselves are reset on a 'set_scene' call. This can be
separated to a function to be called after a gree_group too. I don't
like it to call a g.scene in group.c that way, is asking for troubles.
-Ton-
On 19 Mar, 2006, at 18:38, Campbell Barton wrote:
> Hey Ton, group freeing dosent check that the objects are still in a
> group when it removes the object from a group.
> This causes a bug in oops unlink and Python group module. where
> objects are flagged as in a group and drawn green.
>
> Heres a change that fixes it. does more listbase loops then Id like,
> but its probably the best that can be done with the current
> datastructure.
> objects keeping a count of how many groups use them could be good.
> if (ob.group_users==0) :)
>
> Was...
> _________________________________________________
> void free_group(Group *group)
> {
> /* don't free group itself */
> GroupObject *go;
> while(group->gobject.first) {
> go= group->gobject.first;
> BLI_remlink(&group->gobject, go);
> free_group_object(go);
> }
> }
>
>
>
>
> Added a check for objects group status.
> _________________________________________________
>
>
> void free_group(Group *group)
> {
> /* don't free group itself */
> GroupObject *go;
> Base *base;
> while(group->gobject.first) {
> go= group->gobject.first;
> BLI_remlink(&group->gobject, go);
> free_group_object(go);
> /* check to see if the group flag needs to be changed.*/
> if (!find_group(go->ob)) {
> go->ob->flag &= ~OB_FROMGROUP;
> base= object_in_scene(go->ob, G.scene);
> if (base) base->flag &= ~OB_FROMGROUP; }
> }
> }
> _________________________________________________
>
> Does this look okay?
>
> --
> Campbell J Barton
>
> 133 Hope Street
> Geelong West, Victoria 3218 Australia
>
> URL: http://www.metavr.com
> e-mail: cbarton at metavr.com
> phone: AU (03) 5229 0241
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------
--
Ton Roosendaal Blender Foundation ton at blender.org
http://www.blender.org
More information about the Bf-committers
mailing list