[Bf-committers] [Bf-blender-cvs] [11e0ddd] master: Bugfix T40801: Select grouped objects by Keying Set not working with builtin Keying Sets

Joshua Leung aligorith at gmail.com
Thu Jun 26 15:51:38 CEST 2014


HI Terry,

This feature was intended to be used with Keying Sets where you've manually
specified the set of paths that it should work on. It works by going over
the visible objects in the scene, and selecting those which appear in the
Keying Set's paths.

With the current implementation, it may be possible to do it the other way
(i.e. check which objects the keying set may have been used to animate),
but that one is more error prone given that users could end up renaming the
groups, which makes this quite a difficult exercise in practice.

Hope that helps,
Joshua


On Thu, Jun 26, 2014 at 8:25 PM, AIBlender <aiblender at gmail.com> wrote:

> On 26/06/14 03:39, Joshua Leung wrote:
> > Commit: 11e0dddf91f76065a6dd782163eb3b75745a6b2e
> > Author: Joshua Leung
> > Date:   Thu Jun 26 14:39:44 2014 +1200
> > https://developer.blender.org/rB11e0dddf91f76065a6dd782163eb3b75745a6b2e
> >
> > Bugfix T40801: Select grouped objects by Keying Set not working with
> builtin Keying Sets
> >
> > Most of the default builtin Keying Sets (e.g. Loc, Rot, Available, etc.)
> depend
> > on the currently selected objects, making them unsuitable for use with
> this feature.
> > As a result, this feature would silently fail. This commit adds some
> error messages
> > which at least let users know what's going on so that they can make
> other plans
> >
> > ===================================================================
> >
> > M     source/blender/editors/object/object_select.c
> >
> > ===================================================================
> >
> > diff --git a/source/blender/editors/object/object_select.c
> b/source/blender/editors/object/object_select.c
> > index a5a96c6..8a98f38 100644
> > --- a/source/blender/editors/object/object_select.c
> > +++ b/source/blender/editors/object/object_select.c
> > @@ -776,14 +776,29 @@ static bool select_grouped_gameprops(bContext *C,
> Object *ob)
> >       return changed;
> >   }
> >
> > -static bool select_grouped_keyingset(bContext *C, Object *UNUSED(ob))
> > +static bool select_grouped_keyingset(bContext *C, ReportList *reports,
> Object *UNUSED(ob))
> >   {
> >       KeyingSet *ks = ANIM_scene_get_active_keyingset(CTX_data_scene(C));
> >       bool changed = false;
> >
> >       /* firstly, validate KeyingSet */
> > -     if ((ks == NULL) || (ANIM_validate_keyingset(C, NULL, ks) != 0))
> > +     if (ks == NULL) {
> > +             BKE_report(reports, RPT_ERROR, "No active Keying Set to
> use");
> > +             return false;
> > +     }
> > +     else if (ANIM_validate_keyingset(C, NULL, ks) != 0) {
> > +             if (ks->paths.first == NULL) {
> > +                     if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) {
> > +                             BKE_report(reports, RPT_ERROR,
> > +                                        "Use another Keying Set, as the
> active one depends on the currently "
> > +                                                "selected objects or
> cannot find any targets due to unsuitable context");
> > +                     }
> > +                     else {
> > +                             BKE_report(reports, RPT_ERROR, "Keying Set
> does not contain any paths");
> > +                     }
> > +             }
> >               return 0;
> > +     }
> >
> >       /* select each object that Keying Set refers to */
> >       /* TODO: perhaps to be more in line with the rest of these, we
> should only take objects
> > @@ -852,7 +867,7 @@ static int object_select_grouped_exec(bContext *C,
> wmOperator *op)
> >       else if (nr == 9) changed |= select_grouped_index_object(C, ob);
> >       else if (nr == 10) changed |= select_grouped_color(C, ob);
> >       else if (nr == 11) changed |= select_grouped_gameprops(C, ob);
> > -     else if (nr == 12) changed |= select_grouped_keyingset(C, ob);
> > +     else if (nr == 12) changed |= select_grouped_keyingset(C,
> op->reports, ob);
> >       else if (nr == 13) changed |= select_similar_lamps(C, ob);
> >       else if (nr == 14) changed |= select_similar_pass_index(C, ob);
> >
> > _______________________________________________
> > Bf-blender-cvs mailing list
> > Bf-blender-cvs at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
> Hi Joshua,
>
> It would help if this function had some proper documentation in the
> Blender Wiki to fully spell out what the function is supposed to do.  It
> seems to suggest that it will scan the currently selected object for the
> currently active keying set and select those objects.
>
> If that isn't what it does then the wiki is currently misleading or wrong.
>
> Joshua can you give an example of how to successfully use this
> function?  I am currently trying to document how this function works
> from a user point of view and currently it is not clear.
>
> Also the error message that you added, doesn't really help as it doesn't
> explain why the function is failing just that it is (at least when you
> don't know the correct way to use this function.).
>
> Terry Wallwork
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>


More information about the Bf-committers mailing list