2.5
authorTon Roosendaal <ton@blender.org>
Fri, 20 Feb 2009 16:18:37 +0000 (16:18 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 20 Feb 2009 16:18:37 +0000 (16:18 +0000)
Small fixes for animsys:

- Blender 2.4x allowed drivers to exist without object target, these
  got converted resulting in error prints. Now they get skipped.

- Animdata struct was not created for objects with poses, but without
  action/nla linked.

- An action-channel-constraint-ipo gets inserted in drivers differently
  than a pose-bone-constraint-ipo. Not sure yet how... but it makes a
  different depsgraph relation.
  Error is of course in depsgraph, that'll get tackled. For correct
  driver eval I've made 'object update ob' also been called for
  the 'object update data' tag.

source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/object.c

index 103e2f7edac03462859656b0374a88d20a6e238d..440f83e6a4f8ac82c8da149f67b9f860ac81f503 100644 (file)
@@ -1190,8 +1190,13 @@ static void ipo_to_animato (Ipo *ipo, char actname[], char constname[], ListBase
                /* Since an IPO-Curve may end up being made into many F-Curves (i.e. bitflag curves), 
                 * we figure out the best place to put the channel, then tell the curve-converter to just dump there
                 */
-               if (icu->driver)
-                       icu_to_fcurves(drivers, icu, actname, constname);
+               if (icu->driver) {
+                       /* Blender 2.4x allowed empty drivers */
+                       if(icu->driver->ob || icu->driver->type == IPO_DRIVER_TYPE_PYTHON)
+                               icu_to_fcurves(drivers, icu, actname, constname);
+                       else
+                               MEM_freeN(icu->driver);
+               }
                else
                        icu_to_fcurves(anim, icu, actname, constname);
                
@@ -1401,6 +1406,10 @@ void do_versions_ipos_to_animato(Main *main)
                
                /* check PoseChannels for constraints with local data */
                if (ob->pose) {
+                       
+                       /* Verify if there's AnimData block */
+                       BKE_id_add_animdata(id);
+
                        for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
                                for (con= pchan->constraints.first; con; con= con->next) {
                                        /* if constraint has own IPO, convert add these to Object 
index 610e513aa65f53e710bbbdac2dc8bef1505d0d88..949808b2e566866aba7e4d0f5a272d95455c02d8 100644 (file)
@@ -2268,7 +2268,9 @@ void object_handle_update(Scene *scene, Object *ob)
 {
        if(ob->recalc & OB_RECALC) {
                
-               if(ob->recalc & OB_RECALC_OB) {
+               /* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers, 
+                  which is only in where_is_object now */
+               if(ob->recalc & OB_RECALC) {
                        
                        if (G.f & G_DEBUG)
                                printf("recalcob %s\n", ob->id.name+2);