[Bf-blender-cvs] [94b4a06] object_nodes: Merge branch 'master' into object_nodes
Lukas Tönne
noreply at git.blender.org
Sun Mar 6 15:54:19 CET 2016
Commit: 94b4a06c53b9367808ef71a6fbb21a6ec6a4b398
Author: Lukas Tönne
Date: Sun Mar 6 15:48:32 2016 +0100
Branches: object_nodes
https://developer.blender.org/rB94b4a06c53b9367808ef71a6fbb21a6ec6a4b398
Merge branch 'master' into object_nodes
===================================================================
===================================================================
diff --cc source/blender/editors/space_node/node_relationships.c
index 726e867,50d7df6..96603c2
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@@ -668,9 -745,17 +745,13 @@@ static bNodeLinkDrag *node_link_init(Sp
*oplink = *link;
oplink->next = oplink->prev = NULL;
oplink->flag |= NODE_LINK_VALID;
-
+ oplink->flag &= ~NODE_LINK_TEST;
+ if (node_connected_to_output(snode->edittree, link->tonode)) {
+ oplink->flag |= NODE_LINK_TEST;
+ }
+
BLI_addtail(&nldrag->links, linkdata);
nodeRemLink(snode->edittree, link);
-
- /* send changed event to original link->tonode */
- if (node)
- snode_update(snode, node);
}
}
}
diff --cc source/blender/makesrna/intern/rna_nodetree.c
index 88a267e,a701cf6..cffc8a6
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@@ -1060,33 -1049,9 +1061,33 @@@ static void rna_NodeTree_interface_upda
ntree->update |= NTREE_UPDATE_GROUP;
ntreeUpdateTree(G.main, ntree);
- ED_node_tag_update_nodetree(CTX_data_main(C), ntree);
+ ED_node_tag_update_nodetree(CTX_data_main(C), ntree, NULL);
}
+static void rna_NodeTree_bvm_debug_graphviz(struct bNodeTree *ntree, const char *filename,
+ int funtype, int mode, const char *label)
+{
+ FILE *f = fopen(filename, "w");
+ if (f == NULL)
+ return;
+
+ switch (funtype) {
+ case BVM_FUNTYPE_GEOMETRY:
+ BVM_debug_modifier_nodes(ntree, f, label, mode);
+ break;
+ case BVM_FUNTYPE_INSTANCING:
+ BVM_debug_dupli_nodes(ntree, f, label, mode);
+ break;
+ case BVM_FUNTYPE_TEXTURE:
+ BVM_debug_texture_nodes(ntree, f, label, mode);
+ break;
+ case BVM_FUNTYPE_FORCEFIELD:
+ BVM_debug_forcefield_nodes(ntree, f, label, mode);
+ break;
+ }
+
+ fclose(f);
+}
/* ******** NodeLink ******** */
@@@ -1635,43 -1546,15 +1636,44 @@@ static int rna_Node_parent_poll(Pointer
static void rna_Node_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->id.data;
- ED_node_tag_update_nodetree(bmain, ntree);
+ bNode *node = (bNode *)ptr->data;
+ ED_node_tag_update_nodetree(bmain, ntree, node);
+ }
+
+ static void rna_Node_socket_value_update(ID *id, bNode *node, bContext *C)
+ {
+ ED_node_tag_update_nodetree(CTX_data_main(C), (bNodeTree *)id, node);
}
+static void rna_ObjectNode_id_update_cb(bContext *C, PointerRNA *ptr)
+{
+ bNode *node = (bNode *)ptr->data;
+ ParameterList list;
+ FunctionRNA *func;
+
+ func = RNA_struct_find_function(ptr->type, "bl_id_property_update");
+ if (!func)
+ return;
+
+ RNA_parameter_list_create(&list, ptr, func);
+ RNA_parameter_set_lookup(&list, "context", &C);
+ node->typeinfo->ext.call(NULL, ptr, func, &list);
+
+ RNA_parameter_list_free(&list);
+}
+
+static void rna_ObjectNode_id_update(bContext *C, PointerRNA *ptr)
+{
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+
+ rna_Node_update(bmain, scene, ptr);
+
+ DEG_relations_tag_update(bmain);
+
+ rna_ObjectNode_id_update_cb(C, ptr);
+}
+
- static void rna_Node_socket_value_update(ID *id, bNode *UNUSED(node), bContext *C)
- {
- ED_node_tag_update_nodetree(CTX_data_main(C), (bNodeTree *)id);
- }
-
static void rna_Node_select_set(PointerRNA *ptr, int value)
{
bNode *node = (bNode *)ptr->data;
diff --cc source/blender/render/intern/source/render_texture.c
index 8215876,807686a..f2a3fbb
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@@ -1113,23 -1120,8 +1122,23 @@@ static int multitex(Tex *tex
texres->talpha = false; /* is set when image texture returns alpha (considered premul) */
if (tex->use_nodes && tex->nodetree) {
- retval = ntreeTexExecTree(tex->nodetree, texres, texvec, dxt, dyt, osatex, thread,
- tex, which_output, R.r.cfra, texnode_preview, NULL, NULL);
+ struct BVMFunction *fn = BVM_function_cache_acquire(tex->nodetree);
+ if (!fn) {
+ fn = BVM_gen_texture_function(tex->nodetree);
+ BVM_function_cache_set(tex->nodetree, fn);
+ }
+
+ if (fn) {
+ struct BVMEvalContext *context = BVM_context_create();
+
+ BVM_eval_texture(context, fn, texres, texvec, dxt, dyt, osatex, which_output,
- R.r.cfra, (R.r.scemode & R_TEXNODE_PREVIEW) != 0);
++ R.r.cfra, texnode_preview);
+ retval = TEX_INT | TEX_RGB | TEX_NOR;
+
+ BVM_context_free(context);
+ }
+
+ BVM_function_release(fn);
}
else {
switch (tex->type) {
@@@ -1320,7 -1350,26 +1367,17 @@@ int multitex_nodes(Tex *tex, float texv
/* this is called for surface shading */
static int multitex_mtex(ShadeInput *shi, MTex *mtex, float texvec[3], float dxt[3], float dyt[3], TexResult *texres, struct ImagePool *pool, const bool skip_load_image)
{
- return multitex(mtex->tex, texvec, dxt, dyt, shi->osatex, texres, shi->thread, mtex->which_output, pool, skip_load_image);
- Tex *tex = mtex->tex;
+ /* TODO(sergey): Texture preview should become an argument? */
- if (tex->use_nodes && tex->nodetree) {
- /* stupid exception here .. but we have to pass shi and mtex to
- * textures nodes for 2d mapping and color management for images */
- return ntreeTexExecTree(tex->nodetree, texres, texvec, dxt, dyt, shi->osatex, shi->thread,
- tex, mtex->which_output, R.r.cfra, (R.r.scemode & R_TEXNODE_PREVIEW) != 0, shi, mtex);
- }
- else {
- return multitex(mtex->tex,
- texvec,
- dxt, dyt,
- shi->osatex,
- texres,
- shi->thread,
- mtex->which_output,
- pool,
- skip_load_image,
- (R.r.scemode & R_TEXNODE_PREVIEW) != 0);
- }
++ return multitex(mtex->tex,
++ texvec,
++ dxt, dyt,
++ shi->osatex,
++ texres,
++ shi->thread,
++ mtex->which_output,
++ pool,
++ skip_load_image,
++ (R.r.scemode & R_TEXNODE_PREVIEW) != 0);
}
/* Warning, if the texres's values are not declared zero, check the return value to be sure
@@@ -1339,7 -1407,13 +1415,7 @@@ int multitex_ext(Tex *tex
*/
int multitex_ext_safe(Tex *tex, float texvec[3], TexResult *texres, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
{
- return multitex_nodes_intern(tex, texvec, NULL, NULL, 0, texres, 0, 0, NULL, NULL, pool, scene_color_manage, skip_load_image);
- int use_nodes= tex->use_nodes, retval;
-
- tex->use_nodes = false;
- retval= multitex_nodes_intern(tex, texvec, NULL, NULL, 0, texres, 0, 0, NULL, NULL, pool, scene_color_manage, skip_load_image, false);
- tex->use_nodes= use_nodes;
-
- return retval;
++ return multitex_nodes_intern(tex, texvec, NULL, NULL, 0, texres, 0, 0, NULL, NULL, pool, scene_color_manage, skip_load_image, false);
}
More information about the Bf-blender-cvs
mailing list