[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41490] branches/cycles: Cycles: updates to follow code committed to trunk.
Brecht Van Lommel
brechtvanlommel at pandora.be
Thu Nov 3 11:18:59 CET 2011
Revision: 41490
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41490
Author: blendix
Date: 2011-11-03 10:18:58 +0000 (Thu, 03 Nov 2011)
Log Message:
-----------
Cycles: updates to follow code committed to trunk.
Modified Paths:
--------------
branches/cycles/intern/cycles/blender/blender_sync.cpp
branches/cycles/source/blender/blenkernel/intern/anim_sys.c
branches/cycles/source/blender/blenkernel/intern/node.c
branches/cycles/source/blender/blenkernel/intern/scene.c
branches/cycles/source/blender/blenkernel/intern/world.c
branches/cycles/source/blender/blenlib/BLI_callbacks.h
branches/cycles/source/blender/editors/render/render_preview.c
branches/cycles/source/blender/editors/space_node/node_draw.c
branches/cycles/source/blender/editors/space_node/node_edit.c
branches/cycles/source/blender/editors/space_node/node_select.c
branches/cycles/source/blender/makesrna/intern/rna_ID.c
branches/cycles/source/blender/makesrna/intern/rna_main_api.c
branches/cycles/source/blender/makesrna/intern/rna_texture.c
branches/cycles/source/blender/nodes/shader/node_shader_tree.c
branches/cycles/source/blender/nodes/shader/nodes/node_shader_common.c
branches/cycles/source/blender/python/intern/bpy_app_handlers.c
branches/cycles/source/gameengine/Ketsji/BL_BlenderShader.cpp
branches/cycles/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
Modified: branches/cycles/intern/cycles/blender/blender_sync.cpp
===================================================================
--- branches/cycles/intern/cycles/blender/blender_sync.cpp 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/intern/cycles/blender/blender_sync.cpp 2011-11-03 10:18:58 UTC (rev 41490)
@@ -67,31 +67,31 @@
BL::BlendData::materials_iterator b_mat;
for(b_data.materials.begin(b_mat); b_mat != b_data.materials.end(); ++b_mat)
- if(b_mat->recalc())
+ if(b_mat->is_updated())
shader_map.set_recalc(*b_mat);
BL::BlendData::lamps_iterator b_lamp;
for(b_data.lamps.begin(b_lamp); b_lamp != b_data.lamps.end(); ++b_lamp)
- if(b_lamp->recalc())
+ if(b_lamp->is_updated())
shader_map.set_recalc(*b_lamp);
BL::BlendData::objects_iterator b_ob;
for(b_data.objects.begin(b_ob); b_ob != b_data.objects.end(); ++b_ob) {
- if(b_ob->recalc()) {
+ if(b_ob->is_updated()) {
object_map.set_recalc(*b_ob);
light_map.set_recalc(*b_ob);
}
if(object_is_mesh(*b_ob)) {
- if(b_ob->recalc_data() || b_ob->data().recalc()) {
+ if(b_ob->is_updated_data() || b_ob->data().is_updated()) {
BL::ID key = object_is_modified(*b_ob)? *b_ob: b_ob->data();
mesh_map.set_recalc(key);
}
}
else if(object_is_light(*b_ob)) {
- if(b_ob->recalc_data() || b_ob->data().recalc())
+ if(b_ob->is_updated_data() || b_ob->data().is_updated())
light_map.set_recalc(*b_ob);
}
}
@@ -99,13 +99,13 @@
BL::BlendData::meshes_iterator b_mesh;
for(b_data.meshes.begin(b_mesh); b_mesh != b_data.meshes.end(); ++b_mesh)
- if(b_mesh->recalc())
+ if(b_mesh->is_updated())
mesh_map.set_recalc(*b_mesh);
BL::BlendData::worlds_iterator b_world;
for(b_data.worlds.begin(b_world); b_world != b_data.worlds.end(); ++b_world)
- if(world_map == b_world->ptr.data && b_world->recalc())
+ if(world_map == b_world->ptr.data && b_world->is_updated())
world_recalc = true;
bool recalc =
@@ -113,7 +113,7 @@
object_map.has_recalc() ||
light_map.has_recalc() ||
mesh_map.has_recalc() ||
- BlendDataObjects_recalc_get(&b_data.ptr) ||
+ BlendDataObjects_is_updated_get(&b_data.ptr) ||
world_recalc;
return recalc;
Modified: branches/cycles/source/blender/blenkernel/intern/anim_sys.c
===================================================================
--- branches/cycles/source/blender/blenkernel/intern/anim_sys.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/blenkernel/intern/anim_sys.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -51,6 +51,7 @@
#include "BKE_animsys.h"
#include "BKE_action.h"
+#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
#include "BKE_nla.h"
#include "BKE_global.h"
@@ -1181,6 +1182,15 @@
RNA_property_update_cache_add(&new_ptr, prop);
}
#endif
+
+ /* as long as we don't do property update, we still tag datablock
+ as having been updated. this flag does not cause any updates to
+ be run, it's for e.g. render engines to synchronize data */
+ if(new_ptr.id.data) {
+ ID *id= new_ptr.id.data;
+ id->flag |= LIB_ID_RECALC;
+ DAG_id_type_tag(G.main, GS(id->name));
+ }
}
/* successful */
@@ -2322,7 +2332,7 @@
/* particles */
EVAL_ANIM_IDS(main->particle.first, ADT_RECALC_ANIM);
- /* lamps */
+ /* speakers */
EVAL_ANIM_IDS(main->speaker.first, ADT_RECALC_ANIM);
/* objects */
Modified: branches/cycles/source/blender/blenkernel/intern/node.c
===================================================================
--- branches/cycles/source/blender/blenkernel/intern/node.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/blenkernel/intern/node.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -1073,6 +1073,7 @@
newtree->id.us= 0;
+
cd.new_id = &newtree->id;
treetype->foreach_nodetree(G.main, &cd, &ntreeMakeLocal_LinkNew);
}
@@ -1862,7 +1863,7 @@
static void registerShaderNodes(ListBase *ntypelist)
{
register_node_type_frame(ntypelist);
-
+
register_node_type_sh_group(ntypelist);
//register_node_type_sh_forloop(ntypelist);
//register_node_type_sh_whileloop(ntypelist);
Modified: branches/cycles/source/blender/blenkernel/intern/scene.c
===================================================================
--- branches/cycles/source/blender/blenkernel/intern/scene.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/blenkernel/intern/scene.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -992,6 +992,8 @@
{
DAG_ids_flush_tagged(bmain);
+ BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
+
scene->physics_settings.quick_cache_step= 0;
/* update all objects: drivers, matrices, displists, etc. flags set
@@ -1013,6 +1015,8 @@
DAG_ids_check_recalc(bmain);
+ BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST);
+
/* in the future this should handle updates for all datablocks, not
only objects and scenes. - brecht */
}
@@ -1046,6 +1050,8 @@
* so dont call within 'scene_update_tagged_recursive' */
DAG_scene_update_flags(bmain, sce, lay, TRUE); // only stuff that moves or needs display still
+ BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_SCENE_UPDATE_PRE);
+
/* All 'standard' (i.e. without any dependencies) animation is handled here,
* with an 'local' to 'macro' order of evaluation. This should ensure that
* settings stored nestled within a hierarchy (i.e. settings in a Texture block
@@ -1059,7 +1065,10 @@
scene_update_tagged_recursive(bmain, sce, sce);
/* keep this last */
+ BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_SCENE_UPDATE_POST);
BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_FRAME_CHANGE_POST);
+
+ DAG_ids_clear_recalc(bmain);
}
/* return default layer, also used to patch old files */
Modified: branches/cycles/source/blender/blenkernel/intern/world.c
===================================================================
--- branches/cycles/source/blender/blenkernel/intern/world.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/blenkernel/intern/world.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -42,14 +42,14 @@
#include "BLI_utildefines.h"
#include "BLI_bpath.h"
-#include "BKE_world.h"
-#include "BKE_library.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
#include "BKE_icons.h"
#include "BKE_library.h"
+#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
+#include "BKE_world.h"
void free_world(World *wrld)
{
Modified: branches/cycles/source/blender/blenlib/BLI_callbacks.h
===================================================================
--- branches/cycles/source/blender/blenlib/BLI_callbacks.h 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/blenlib/BLI_callbacks.h 2011-11-03 10:18:58 UTC (rev 41490)
@@ -47,6 +47,8 @@
BLI_CB_EVT_LOAD_POST,
BLI_CB_EVT_SAVE_PRE,
BLI_CB_EVT_SAVE_POST,
+ BLI_CB_EVT_SCENE_UPDATE_PRE,
+ BLI_CB_EVT_SCENE_UPDATE_POST,
BLI_CB_EVT_TOT
} eCbEvent;
Modified: branches/cycles/source/blender/editors/render/render_preview.c
===================================================================
--- branches/cycles/source/blender/editors/render/render_preview.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/editors/render/render_preview.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -86,7 +86,6 @@
#include "PIL_time.h"
-#include "RE_engine.h"
#include "RE_pipeline.h"
Modified: branches/cycles/source/blender/editors/space_node/node_draw.c
===================================================================
--- branches/cycles/source/blender/editors/space_node/node_draw.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/editors/space_node/node_draw.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -560,7 +560,6 @@
int color_id= node_get_colorid(node);
char showname[128]; /* 128 used below */
View2D *v2d = &ar->v2d;
- int i;
/* hurmf... another candidate for callback, have to see how this works first */
if(node->id && node->block && snode->treetype==NTREE_SHADER)
@@ -684,7 +683,7 @@
/* socket inputs, buttons */
- for(i= 0, sock= node->inputs.first; sock; sock= sock->next, i++) {
+ for(sock= node->inputs.first; sock; sock= sock->next) {
bNodeSocketType *stype= ntreeGetSocketType(sock->type);
if(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))
Modified: branches/cycles/source/blender/editors/space_node/node_edit.c
===================================================================
--- branches/cycles/source/blender/editors/space_node/node_edit.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/editors/space_node/node_edit.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -303,8 +303,8 @@
}
case ID_WO: {
World *wo= (World*)id;
+ wo->nodetree = ntree;
- wo->nodetree = ntree;
output_type = SH_NODE_OUTPUT_WORLD;
shader_type = SH_NODE_BACKGROUND;
@@ -314,8 +314,8 @@
}
case ID_LA: {
Lamp *la= (Lamp*)id;
+ la->nodetree = ntree;
- ((Lamp*)id)->nodetree = ntree;
output_type = SH_NODE_OUTPUT_LAMP;
shader_type = SH_NODE_EMISSION;
Modified: branches/cycles/source/blender/editors/space_node/node_select.c
===================================================================
--- branches/cycles/source/blender/editors/space_node/node_select.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/editors/space_node/node_select.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -35,7 +35,6 @@
#include "DNA_scene_types.h"
#include "BKE_context.h"
-#include "BKE_global.h"
#include "BKE_main.h"
#include "BLI_rect.h"
Modified: branches/cycles/source/blender/makesrna/intern/rna_ID.c
===================================================================
--- branches/cycles/source/blender/makesrna/intern/rna_ID.c 2011-11-03 10:03:08 UTC (rev 41489)
+++ branches/cycles/source/blender/makesrna/intern/rna_ID.c 2011-11-03 10:18:58 UTC (rev 41490)
@@ -486,15 +486,15 @@
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data (initial state is undefined)");
- prop= RNA_def_property(srna, "recalc", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Recalc", "Datablock is tagged for recalculation");
+ RNA_def_property_ui_text(prop, "Is Updated", "Datablock is tagged for recalculation");
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list