[Bf-blender-cvs] [1518fde] alembic: Merge branch 'master' into alembic
Lukas Tönne
noreply at git.blender.org
Thu May 14 16:46:52 CEST 2015
Commit: 1518fde97d37b87a475df18f5e828cc337086ccf
Author: Lukas Tönne
Date: Thu May 14 15:59:10 2015 +0200
Branches: alembic
https://developer.blender.org/rB1518fde97d37b87a475df18f5e828cc337086ccf
Merge branch 'master' into alembic
Conflicts:
build_files/scons/tools/Blender.py
source/blender/blenkernel/intern/mesh.c
===================================================================
===================================================================
diff --cc build_files/scons/tools/Blender.py
index 384901a,ecf3475..f6a70ac
--- 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/editors/include',
+ '#/source/blender/blenloader',
++ '#/source/blender/depsgraph',
+ '#/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 0f3aec5,37a98ea..1047710
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@@ -2523,63 -2524,15 +2524,76 @@@ 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/blenloader/intern/readfile.c
index f1bd81d,c736e54..3115f48
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -112,9 -111,9 +112,10 @@@
#include "BLF_translation.h"
+ #include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_brush.h"
+#include "BKE_cache_library.h"
#include "BKE_cloth.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
diff --cc source/blender/depsgraph/intern/depsgraph_build_relations.cc
index 0000000,b924831..3015fed
mode 000000,100644..100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
@@@ -1,0 -1,1815 +1,1815 @@@
+ /*
+ * ***** 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) 2013 Blender Foundation.
+ * All rights reserved.
+ *
+ * Original Author: Joshua Leung
+ * Contributor(s): Based on original depsgraph.c code - Blender Foundation (2005-2013)
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ * Methods for constructing depsgraph
+ */
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+
+ #include "MEM_guardedalloc.h"
+
+ extern "C" {
+ #include "BLI_blenlib.h"
+ #include "BLI_string.h"
+ #include "BLI_utildefines.h"
+
+ #include "DNA_action_types.h"
+ #include "DNA_anim_types.h"
+ #include "DNA_armature_types.h"
+ #include "DNA_camera_types.h"
+ #include "DNA_constraint_types.h"
+ #include "DNA_curve_types.h"
+ #include "DNA_effect_types.h"
+ #include "DNA_gpencil_types.h"
+ #include "DNA_group_types.h"
+ #include "DNA_key_types.h"
+ #include "DNA_lamp_types.h"
+ #include "DNA_material_types.h"
+ #include "DNA_mesh_types.h"
+ #include "DNA_meta_types.h"
+ #include "DNA_node_types.h"
+ #include "DNA_particle_types.h"
+ #include "DNA_object_types.h"
+ #include "DNA_rigidbody_types.h"
+ #include "DNA_scene_types.h"
+ #include "DNA_texture_types.h"
+ #include "DNA_world_types.h"
+
+ #include "BKE_action.h"
+ #include "BKE_armature.h"
+ #include "BKE_animsys.h"
+ #include "BKE_constraint.h"
+ #include "BKE_curve.h"
+ #include "BKE_effect.h"
+ #include "BKE_fcurve.h"
+ #include "BKE_group.h"
+ #include "BKE_key.h"
+ #include "BKE_library.h"
+ #include "BKE_main.h"
+ #include "BKE_material.h"
+ #include "BKE_mball.h"
+ #include "BKE_modifier.h"
+ #include "BKE_node.h"
+ #include "BKE_object.h"
+ #include "BKE_particle.h"
+ #include "BKE_rigidbody.h"
+ #include "BKE_sound.h"
+ #include "BKE_texture.h"
+ #include "BKE_tracking.h"
+ #include "BKE_world.h"
+
+ #include "DEG_depsgraph.h"
+ #include "DEG_depsgraph_build.h"
+
+ #include "RNA_access.h"
+ #include "RNA_types.h"
+ } /* extern "C" */
+
+ #include "depsnode.h"
+ #include "depsnode_component.h"
+ #include "depsnode_operation.h"
+ #include "depsgraph_build.h"
+ #include "depsgraph_debug.h"
+ #include "depsgraph_intern.h"
+ #include "depsgraph_types.h"
+
+ #include "depsgraph_util_pchanmap.h"
+
+ /* ***************** */
+ /* Relations Builder */
+
+ /* **** General purpose functions **** */
+
+ RNAPathKey::RNAPathKey(ID *id, const string &path) :
+ id(id)
+ {
+ /* create ID pointer for root of path lookup */
+ PointerRNA id_ptr;
+ RNA_id_pointer_create(id, &id_ptr);
+ /* try to resolve path... */
+ if (!RNA_path_resolve(&id_ptr, path.c_str(), &this->ptr, &this->prop)) {
+ this->ptr = PointerRNA_NULL;
+ this->prop = NULL;
+ }
+ }
+
+ DepsgraphRelationBuilder::DepsgraphRelationBuilder(Depsgraph *graph) :
+ m_graph(graph)
+ {
+ }
+
+ RootDepsNode *DepsgraphRelationBuilder::find_node(const RootKey &key) const
+ {
+ (void)key;
+ BLI_assert(!"Doesn't seem to be correct");
+ return m_graph->root_node;
+ }
+
+ TimeSourceDepsNode *DepsgraphRelationBuilder::find_node(
+ const TimeSourceKey &key) const
+ {
+ if (key.id) {
+ /* XXX TODO */
+ return NULL;
+ }
+ else {
+ return m_graph->root_node->time_source;
+ }
+ }
+
+ ComponentDepsNode *DepsgraphRelationBuilder::find_node(
+ const ComponentKey &key) const
+ {
+ IDDepsNode *id_node = m_graph->find_id_node(key.id);
+ if (!id_node) {
+ fprintf(stderr, "find_node component: Could not find ID %s\n",
+ (key.id != NULL) ? key.id->name : "<null>");
+ return NULL;
+ }
+
+ ComponentDepsNode *node = id_node->find_component(key.type, key.name);
+ return node;
+ }
+
+ OperationDepsNode *DepsgraphRelationBuilder::find_node(
+ const OperationKey &key) const
+ {
+ IDDepsNode *id_node = m_graph->find_id_node(key.id);
+ if (!id_node) {
+ fprintf(stderr, "find_node operation: Could not find ID\n");
+ return NULL;
+ }
+
+ ComponentDepsNode *comp_node = id_node->find_component(key.component_type,
+ key.component_name);
+ if (!comp_node) {
+ fprintf(stderr, "find_node operation: Could not find component\n");
+ return NULL;
+ }
+
+ OperationDepsNode *op_node = comp_node->find_operation(key.opcode, key.name);
+ if (!op_node) {
+ fprintf(stderr, "find_node_operation: Failed for (%s, '%s')\n",
+ DEG_OPNAMES[key.opcode], key.name.c_str());
+ }
+ return op_node;
+ }
+
+ DepsNode *DepsgraphRelationBuilder::find_node(const RNAPathKey &key) const
+ {
+ return m_graph->find_node_from_pointer(&key.ptr, key.prop);
+ }
+
+ OperationDepsNode *DepsgraphRelationBuilder::has_node(
+ const OperationKey &key) const
+ {
+ IDDepsNode *id_node = m_graph->find_id_node(key.id);
+ if (!id_node) {
+ return NULL;
+ }
+ ComponentDepsNode *comp_node = id_node->find_component(key.component_type,
+ key.componen
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list