Commit: 26dff781b3c13ad21010d595d38baa5b8b6e06a5
Author: Sergey Sharybin
Date:   Fri Feb 2 12:21:24 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB26dff781b3c13ad21010d595d38baa5b8b6e06a5

Merge branch 'master' into blender2.8

===================================================================



===================================================================

diff --cc source/blender/blenkernel/intern/armature_update.c
index 1b8bf3feb10,cc1bd9716b1..de0dfe2530d
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@@ -588,13 -587,15 +588,15 @@@ void BKE_pose_eval_init_ik(const struc
                             Object *ob,
                             bPose *UNUSED(pose))
  {
-       float ctime = BKE_scene_frame_get(scene); /* not accurate... */
- 
        DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
- 
+       BLI_assert(ob->type == OB_ARMATURE);
+       const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
+       bArmature *arm = (bArmature *)ob->data;
+       if (arm->flag & ARM_RESTPOS) {
+               return;
+       }
        /* 2a. construct the IK tree (standard IK) */
 -      BIK_initialize_tree(scene, ob, ctime);
 +      BIK_initialize_tree(eval_ctx, scene, ob, ctime);
- 
        /* 2b. construct the Spline IK trees
         *  - this is not integrated as an IK plugin, since it should be able
         *        to function in conjunction with standard IK
@@@ -674,22 -675,32 +676,32 @@@ void BKE_pose_iktree_evaluate(const str
                                Object *ob,
                                bPoseChannel *rootchan)
  {
-       float ctime = BKE_scene_frame_get(scene); /* not accurate... */
        DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, 
rootchan->name);
+       BLI_assert(ob->type == OB_ARMATURE);
+       const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
+       bArmature *arm = (bArmature *)ob->data;
+       if (arm->flag & ARM_RESTPOS) {
+               return;
+       }
 -      BIK_execute_tree(scene, ob, rootchan, ctime);
 +      BIK_execute_tree(eval_ctx, scene, ob, rootchan, ctime);
  }
  
 -void BKE_pose_splineik_evaluate(EvaluationContext *UNUSED(eval_ctx),
 +void BKE_pose_splineik_evaluate(const struct EvaluationContext *eval_ctx,
                                  Scene *scene,
                                  Object *ob,
                                  bPoseChannel *rootchan)
  {
-       float ctime = BKE_scene_frame_get(scene); /* not accurate... */
        DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, 
rootchan->name);
+       BLI_assert(ob->type == OB_ARMATURE);
+       const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
+       bArmature *arm = (bArmature *)ob->data;
+       if (arm->flag & ARM_RESTPOS) {
+               return;
+       }
 -      BKE_splineik_execute_tree(scene, ob, rootchan, ctime);
 +      BKE_splineik_execute_tree(eval_ctx, scene, ob, rootchan, ctime);
  }
  
 -void BKE_pose_eval_flush(EvaluationContext *UNUSED(eval_ctx),
 +void BKE_pose_eval_flush(const struct EvaluationContext *UNUSED(eval_ctx),
                           Scene *scene,
                           Object *ob,
                           bPose *UNUSED(pose))
diff --cc source/blender/collada/DocumentExporter.cpp
index 6e84c3baccb,957fec50e4b..179644db9b3
--- a/source/blender/collada/DocumentExporter.cpp
+++ b/source/blender/collada/DocumentExporter.cpp
@@@ -302,9 -304,9 +302,9 @@@ int DocumentExporter::exportCurrentScen
  
        // <library_animations>
        AnimationExporter ae(writer, this->export_settings);
-       bool has_animations = ae.exportAnimations(eval_ctx, sce);
  
  #if 0
 -      bool has_animations = ae.exportAnimations(sce);
++      bool has_animations = ae.exportAnimations(eval_ctx, sce);
        /* The following code seems to be an obsolete workaround
        Comment out until it proofs correct that we no longer need it.
        */
@@@ -320,9 -322,10 +320,10 @@@
                
se.setExportTransformationType(this->export_settings->export_transformation_type);
        }
  #else
+       ae.exportAnimations(sce);
        
se.setExportTransformationType(this->export_settings->export_transformation_type);
  #endif
 -      se.exportScene(sce);
 +      se.exportScene(eval_ctx, sce);
        
        // <scene>
        std::string scene_name(translate_id(id_name(sce)));
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index ddae761cea0,1d18d6def8d..7de3c169737
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -853,69 -661,44 +853,79 @@@ void DepsgraphNodeBuilder::build_partic
         *     blackbox evaluation step for one particle system referenced by
         *     the particle systems stack. All dependencies link to this 
operation.
         */
- 
-       /* component for all particle systems */
+       /* Component for all particle systems. */
        ComponentDepsNode *psys_comp =
                add_component_node(&object->id, DEG_NODE_TYPE_EVAL_PARTICLES);
 +
 +      /* TODO(sergey): Need to get COW of PSYS. */
 +      Scene *scene_cow = get_cow_datablock(scene_);
 +      Object *ob_cow = get_cow_datablock(object);
 +
        add_operation_node(psys_comp,
                           function_bind(BKE_particle_system_eval_init,
                                         _1,
 -                                       scene_,
 -                                       object),
 +                                       scene_cow,
 +                                       ob_cow),
                           DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
- 
-       /* particle systems */
+       /* Build all particle systems. */
        BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
                ParticleSettings *part = psys->part;
- 
 -              /* Particle settings. */
 -              // XXX: what if this is used more than once!
 -              build_animdata(&part->id);
 -              /* This particle system evaluation. */
 -              // TODO: for now, this will just be a placeholder "ubereval" 
node
 +              /* Build particle settings operations.
 +               *
 +               * NOTE: The call itself ensures settings are only build once.
 +               */
 +              build_particle_settings(part);
- 
 +              /* Update on particle settings change. */
 +              add_operation_node(psys_comp,
 +                                 
function_bind(BKE_particle_system_settings_eval,
 +                                               _1,
 +                                               psys),
 +                                 DEG_OPCODE_PARTICLE_SETTINGS_EVAL,
 +                                 psys->name);
- 
 +              /* Particle system evaluation. */
                add_operation_node(psys_comp,
                                   NULL,
                                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL,
                                   psys->name);
+               /* Visualization of particle system. */
+               switch (part->ren_as) {
+                       case PART_DRAW_OB:
+                               if (part->dup_ob != NULL) {
 -                                      build_object(NULL, part->dup_ob);
++                                      build_object(NULL,
++                                                   part->dup_ob,
++                                                   DEG_ID_LINKED_INDIRECTLY);
+                               }
+                               break;
+                       case PART_DRAW_GR:
+                               if (part->dup_group != NULL) {
 -                                      build_group(NULL, part->dup_group);
++                                      build_group(part->dup_group);
+                               }
+                               break;
+               }
        }
  
 -      /* pointcache */
 -      // TODO...
 +      /* TODO(sergey): Do we need a point cache operations here? */
 +}
 +
 +void DepsgraphNodeBuilder::build_particle_settings(ParticleSettings *part) {
 +      ID *part_id = &part->id;
 +      if (part_id->tag & LIB_TAG_DOIT) {
 +              return;
 +      }
 +      part_id->tag |= LIB_TAG_DOIT;
 +      /* Animation data. */
 +      build_animdata(part_id);
 +      /* Parameters change. */
 +      add_operation_node(part_id,
 +                         DEG_NODE_TYPE_PARAMETERS,
 +                         NULL,
 +                         DEG_OPCODE_PARTICLE_SETTINGS_EVAL);
 +      add_operation_node(part_id,
 +                         DEG_NODE_TYPE_PARAMETERS,
 +                         
function_bind(BKE_particle_system_settings_recalc_clear,
 +                                       _1,
 +                                       part),
 +                         DEG_OPCODE_PARTICLE_SETTINGS_RECALC_CLEAR);
  }
  
  void DepsgraphNodeBuilder::build_cloth(Object *object)
diff --cc source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 281e58cf38a,c30d3fecdd5..8afb23f08fa
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@@ -423,29 -427,24 +424,29 @@@ void DepsgraphRelationBuilder::build_gr
  {
        ID *group_id = &group->id;
        bool group_done = (group_id->tag & LIB_TAG_DOIT) != 0;
-       OperationKey object_local_transform_key(&object->id,
+       OperationKey object_local_transform_key(object != NULL ? &object->id : 
NULL,
                                                DEG_NODE_TYPE_TRANSFORM,
                                                DEG_OPCODE_TRANSFORM_LOCAL);
- 
 -      BLI_LISTBASE_FOREACH (GroupObject *, go, &group->gobject) {
 -              if (!group_done) {
 -                      build_object(go->ob);
 +      if (!group_done) {
 +              BLI_LISTBASE_FOREACH (Base *, base, 
&group->view_layer->object_bases) {
 +                      build_object(NULL, base->object);
                }
 -              if (object != NULL) {
 -                      ComponentKey dupli_transform_key(&go->ob->id, 
DEG_NODE_TYPE_TRANSFORM);
 +              group_id->tag |= LIB_TAG_DOIT;
 +      }
- 
-       BLI_LISTBASE_FOREACH (Base *, base, &group->view_layer->object_bases) {
-               ComponentKey dupli_transform_key(&base->object->id, 
DEG_NODE_TYPE_TRANSFORM);
-               add_relation(dupli_transform_key, object_local_transform_key, 
"Dupligroup");
++      if (object != NULL) {
++              BLI_LISTBASE_FOREACH (Base *, base, 
&group->view_layer->object_bases) {
++                      ComponentKey dupli_transform_key(&base->object->id, 
DEG_NODE_TYPE_TRANSFORM);
+                       add_relation(dupli_transform_key, 
object_local_transform_key, "Dupligroup");
+               }
        }
 -      group_id->tag |= LIB_TAG_DOIT;
  }
  
 -void DepsgraphRelationBuilder::build_object(Object *object)
 +void DepsgraphRelationBuilder::build_object(Base *base, Object *object)
  {
        if (object->id.tag & LIB_TAG_DOIT) {
 +              if (base != NULL) {
 +                      build_object_flags(base, object);
 +              }
                return;
        }
        object->id.tag |= LIB_TAG_DOIT;
@@@ -1413,46 -1363,17 +1414,40 @@@ void DepsgraphRelationBuilder::build_pa
                                   DEG_NODE_TYPE_EVAL_PARTICLES,
                                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
  
-       /* particle systems */
+       /* Particle systems. */
        BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
                ParticleSettings *part = psys->part;
 -              /* Animation of particle settings, */
 -              build_animdata(&part->id);
 +
 +              /* Build particle settings relations.
 +               *
 +               * NOTE: The call itself ensures settings are only build once.
 +               */
 +              build_particle_settings(part);
 +
                /* This particle system. */
                OperationKey psys_key(&object->id,
                                      DEG_NODE_TYPE_EVAL_PARTICLES,
                                      DEG_OPCODE_PARTICLE_SYSTEM

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to