[Bf-blender-cvs] [5132502] gooseberry: Merge branch 'master' into gooseberry
Sergey Sharybin
noreply at git.blender.org
Thu May 14 16:35:42 CEST 2015
Commit: 51325025ec6d48fa878f2d6e312cfed72661fb3c
Author: Sergey Sharybin
Date: Thu May 14 19:25:15 2015 +0500
Branches: gooseberry
https://developer.blender.org/rB51325025ec6d48fa878f2d6e312cfed72661fb3c
Merge branch 'master' into gooseberry
Conflicts:
build_files/scons/tools/Blender.py
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle_system.c
source/blender/editors/interface/interface_handlers.c
===================================================================
===================================================================
diff --cc build_files/scons/tools/Blender.py
index 384901a,ecf3475..fe171f9
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@@ -390,22 -372,7 +390,23 @@@ def propose_priorities()
def creator(env):
sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources
- incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/depsgraph', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']]
+ incs = ['#/intern/guardedalloc',
+ '#/source/blender/blenlib',
+ '#/source/blender/blenkernel',
++ '#/source/blender/depsgraph',
+ '#/source/blender/editors/include',
+ '#/source/blender/blenloader',
+ '#/source/blender/imbuf',
+ '#/source/blender/renderconverter',
+ '#/source/blender/render/extern/include',
+ '#/source/blender/windowmanager',
+ '#/source/blender/makesdna',
+ '#/source/blender/makesrna',
+ '#/source/blender/pointcache',
+ '#/source/gameengine/BlenderRoutines',
+ '#/extern/glew/include',
+ '#/source/blender/gpu',
+ env['BF_OPENGL_INC']]
defs = []
diff --cc source/blender/blenkernel/intern/mesh.c
index 42c9854,37a98ea..c822365
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@@ -2523,63 -2524,15 +2524,75 @@@ Mesh *BKE_mesh_new_from_object
return tmpmesh;
}
-
+/* settings: 1 - preview, 2 - render */
+Mesh *BKE_mesh_new_from_dupli_data(
+ Main *bmain, DupliObjectData *data,
+ bool calc_tessface, bool calc_undeformed)
+{
+ Object *ob = data->ob;
+ DerivedMesh *dm = data->dm;
+ CustomDataMask mask;
+
+ Mesh *tmpmesh;
+
+ if (!ob || !dm)
+ return NULL;
+
+ mask = CD_MASK_MESH; /* this seems more suitable, exporter,
+ * for example, needs CD_MASK_MDEFORMVERT */
+ if (calc_undeformed)
+ mask |= CD_MASK_ORCO;
+
+ tmpmesh = BKE_mesh_add(bmain, "Mesh");
+ DM_to_mesh(dm, tmpmesh, ob, mask, true);
+
+ /* BKE_mesh_add/copy gives us a user count we don't need */
+ tmpmesh->id.us--;
+
+ /* Copy materials to new mesh */
+ switch (ob->type) {
+ case OB_MESH: {
+ Mesh *origmesh = ob->data;
+ int i;
+
+ tmpmesh->flag = origmesh->flag;
+ tmpmesh->mat = MEM_dupallocN(origmesh->mat);
+ tmpmesh->totcol = origmesh->totcol;
+ tmpmesh->smoothresh = origmesh->smoothresh;
+ if (origmesh->mat) {
+ for (i = origmesh->totcol; i-- > 0; ) {
+ /* are we an object material or data based? */
+ tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i];
+
+ if (tmpmesh->mat[i]) {
+ tmpmesh->mat[i]->id.us++;
+ }
+ }
+ }
+ break;
+ }
+ } /* end copy materials */
+
+ if (calc_tessface) {
+ /* cycles and exporters rely on this still */
+ BKE_mesh_tessface_ensure(tmpmesh);
+ }
+
+ /* make sure materials get updated in objects */
+ test_object_materials(bmain, &tmpmesh->id);
+
+ return tmpmesh;
+}
++
+ /* **** Depsgraph evaluation **** */
+
+ void BKE_mesh_eval_geometry(EvaluationContext *UNUSED(eval_ctx),
+ Mesh *mesh)
+ {
+ if (G.debug & G_DEBUG_DEPSGRAPH) {
+ printf("%s on %s\n", __func__, mesh->id.name);
+ }
+ if (mesh->bb == NULL || (mesh->bb->flag & BOUNDBOX_DIRTY)) {
+ BKE_mesh_texspace_calc(mesh);
+ }
+ }
diff --cc source/blender/blenkernel/intern/object_update.c
index 0000000,46d68e7..567fb2e
mode 000000,100644..100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@@ -1,0 -1,340 +1,347 @@@
+ /*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 20014 by Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Sergey Sharybin.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+ /** \file blender/blenkernel/intern/object_update.c
+ * \ingroup bke
+ */
+
+ #include "DNA_anim_types.h"
+ #include "DNA_constraint_types.h"
+ #include "DNA_group_types.h"
+ #include "DNA_key_types.h"
+ #include "DNA_material_types.h"
+ #include "DNA_scene_types.h"
+
+ #include "BLI_blenlib.h"
+ #include "BLI_utildefines.h"
+ #include "BLI_math.h"
+
+ #include "BKE_global.h"
+ #include "BKE_armature.h"
+ #include "BKE_action.h"
+ #include "BKE_constraint.h"
+ #include "BKE_depsgraph.h"
+ #include "BKE_DerivedMesh.h"
+ #include "BKE_animsys.h"
+ #include "BKE_displist.h"
+ #include "BKE_effect.h"
+ #include "BKE_key.h"
+ #include "BKE_lamp.h"
+ #include "BKE_lattice.h"
+ #include "BKE_editmesh.h"
+ #include "BKE_object.h"
+ #include "BKE_particle.h"
+ #include "BKE_scene.h"
+ #include "BKE_material.h"
+ #include "BKE_image.h"
+
+ #include "DEG_depsgraph.h"
+
+ #ifdef WITH_LEGACY_DEPSGRAPH
+ # define DEBUG_PRINT if (!DEG_depsgraph_use_legacy() && G.debug & G_DEBUG_DEPSGRAPH) printf
+ #else
+ # define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
+ #endif
+
+ void BKE_object_eval_local_transform(EvaluationContext *UNUSED(eval_ctx),
+ Scene *UNUSED(scene),
+ Object *ob)
+ {
+ DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
+
+ /* calculate local matrix */
+ BKE_object_to_mat4(ob, ob->obmat);
+ }
+
+ /* Evaluate parent */
+ /* NOTE: based on solve_parenting(), but with the cruft stripped out */
+ void BKE_object_eval_parent(EvaluationContext *UNUSED(eval_ctx),
+ Scene *scene,
+ Object *ob)
+ {
+ Object *par = ob->parent;
+
+ float totmat[4][4];
+ float tmat[4][4];
+ float locmat[4][4];
+
+ DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
+
+ /* get local matrix (but don't calculate it, as that was done already!) */
+ // XXX: redundant?
+ copy_m4_m4(locmat, ob->obmat);
+
+ /* get parent effect matrix */
+ BKE_object_get_parent_matrix(scene, ob, par, totmat);
+
+ /* total */
+ mul_m4_m4m4(tmat, totmat, ob->parentinv);
+ mul_m4_m4m4(ob->obmat, tmat, locmat);
+
+ /* origin, for help line */
+ if ((ob->partype & PARTYPE) == PARSKEL) {
+ copy_v3_v3(ob->orig, par->obmat[3]);
+ }
+ else {
+ copy_v3_v3(ob->orig, totmat[3]);
+ }
+ }
+
+ void BKE_object_eval_constraints(EvaluationContext *UNUSED(eval_ctx),
+ Scene *scene,
+ Object *ob)
+ {
+ bConstraintOb *cob;
+ float ctime = BKE_scene_frame_get(scene);
+
+ DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
+
+ /* evaluate constraints stack */
+ /* TODO: split this into:
+ * - pre (i.e. BKE_constraints_make_evalob, per-constraint (i.e.
+ * - inner body of BKE_constraints_solve),
+ * - post (i.e. BKE_constraints_clear_evalob)
+ *
+ * Not sure why, this is from Joshua - sergey
+ *
+ */
+ cob = BKE_constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT);
+ BKE_constraints_solve(&ob->constraints, cob, ctime);
+ BKE_constraints_clear_evalob(cob);
+ }
+
+ void BKE_object_eval_done(EvaluationContext *UNUSED(eval_ctx), Object *ob)
+ {
+ DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
+
+ /* Set negative scale flag in object. */
+ if (is_negative_m4(ob->obmat)) ob->transflag |= OB_NEG_SCALE;
+ else ob->transflag &= ~OB_NEG_SCALE;
+ }
+
+ void BKE_object_eval_modifier(struct EvaluationContext *eval_ctx,
+ struct Scene *scene,
+ struct Object *ob,
+ struct ModifierData *md)
+ {
+ DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
+ (void) eval_ctx; /* Ignored. */
+ (void) scene; /* Ignored. */
+ (void) ob; /* Ignored. */
+ (void) md; /* Ignored. */
+ }
+
+ void BKE_object_handle_data_update(EvaluationContext *eval_ctx,
+ Scene *scene,
+ Object *ob)
+ {
+ ID *data_id = (ID *)ob->data;
+ AnimData *adt = BKE_animdata_from_id(data_id);
+ Key *key;
++ ParticleSystem *psys;
+ float ctime = BKE_scene_frame_get(scene);
+
+ if (G.debug & G_DEBUG_DEPSGRAPH)
+ printf("recalcdata %s\n", ob->id.name + 2);
+
+ /* TODO(sergey): Only used by legacy depsgraph. */
+ if (adt) {
+ /* evaluate drivers - datalevel */
+ /* XXX: for mesh types, should we push this to derivedmesh instead? */
+ BKE_animsys_evaluate_animdata(scene, data_id, adt, ctime, ADT_RECALC_DRIVERS);
+ }
+
+ /* TODO(sergey): Only used by legacy depsgraph. */
+ key = BKE_key_from_object(ob);
+ if (key && key->block.first) {
+ if (!(ob->shapeflag & OB_SHAPE_LOCK))
+ BKE_animsys_evaluate_animdata(scene, &key->id, key->adt, ctime, ADT_RECALC_DRIVERS);
+ }
++ for (psys = ob->particlesystem.first; psys; psys = psys->next) {
++ key = psys->key;
++ if (key && key->block.first) {
++ BKE_animsys_evaluate_animdata(scene, &key->id, key->adt, ctime, ADT_RECALC_DRIVERS);
++ }
++ }
+
+ /* includes all keys and modifiers */
+ switch (ob->type) {
+ case OB_MESH:
+ {
+ BMEditMesh *em = (ob == scene->obedit) ? BKE_editmesh_fr
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list