diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-01-26 21:17:22 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-01-26 21:17:22 +0300 |
commit | c1742b88a4cf58e474b3dfe9d01921105b8c8b6e (patch) | |
tree | 1147fc9d41c9200f9f591d6dd26720af4f1225b3 /source | |
parent | 8f673cb40c6d038ecaabd24c6549dc5c7571c26a (diff) | |
parent | 8d04f49d0ea53552500e82afea92addaaa939dfd (diff) |
Merge remote-tracking branch 'origin/blender2.8' into render-layers
Note:
renamed blo_do_versions_after_linking_280 to do_versions_after_linking_280 to following the pattern of do_versions_after_linking_270
Diffstat (limited to 'source')
32 files changed, 309 insertions, 207 deletions
diff --git a/source/blender/alembic/CMakeLists.txt b/source/blender/alembic/CMakeLists.txt index ad85f79ef2e..a6e0be6a7f3 100644 --- a/source/blender/alembic/CMakeLists.txt +++ b/source/blender/alembic/CMakeLists.txt @@ -39,14 +39,10 @@ set(INC set(INC_SYS ${ALEMBIC_INCLUDE_DIRS} + ${BOOST_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIRS} ) -if(APPLE OR WIN32) - list(APPEND INC_SYS - ${BOOST_INCLUDE_DIR} - ) -endif() set(SRC intern/abc_archive.cc diff --git a/source/blender/blenfont/intern/blf_thumbs.c b/source/blender/blenfont/intern/blf_thumbs.c index 133168fccf2..b6f5ffbb092 100644 --- a/source/blender/blenfont/intern/blf_thumbs.c +++ b/source/blender/blenfont/intern/blf_thumbs.c @@ -98,6 +98,10 @@ void BLF_thumb_preview( blf_font_size(font, (unsigned int)MAX2(font_size_min, font_size_curr), dpi); + /* font->glyph_cache remains NULL if blf_font_size() failed to set font size */ + if (!font->glyph_cache) + break; + /* decrease font size each time */ font_size_curr -= (font_size_curr / font_shrink); font_shrink += 1; diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 784c76bffd3..789bc8df7e5 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -172,8 +172,6 @@ typedef enum DMDirtyFlag { /* check this with modifier dependsOnNormals callback to see if normals need recalculation */ DM_DIRTY_NORMALS = 1 << 2, - - DM_MESH_BATCH_CACHE = 1 << 3, } DMDirtyFlag; typedef struct DerivedMesh DerivedMesh; diff --git a/source/blender/blenkernel/BKE_mesh_render.h b/source/blender/blenkernel/BKE_mesh_render.h index 8a2b3f9d9ec..29787dcfdab 100644 --- a/source/blender/blenkernel/BKE_mesh_render.h +++ b/source/blender/blenkernel/BKE_mesh_render.h @@ -32,6 +32,7 @@ struct Batch; struct Mesh; +void BKE_mesh_batch_cache_dirty(struct Mesh *me); void BKE_mesh_batch_cache_free(struct Mesh *me); struct Batch *BKE_mesh_batch_cache_get_all_edges(struct Mesh *me); struct Batch *BKE_mesh_batch_cache_get_all_triangles(struct Mesh *me); diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index d1e7e2e5e45..e25b71d508e 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -207,6 +207,7 @@ void BKE_object_eval_uber_transform(struct EvaluationContext *eval_ctx, void BKE_object_eval_uber_data(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob); +void BKE_object_eval_shading(struct EvaluationContext *eval_ctx, struct Object *ob); void BKE_object_handle_data_update(struct EvaluationContext *eval_ctx, struct Scene *scene, diff --git a/source/blender/blenkernel/intern/mesh_render.c b/source/blender/blenkernel/intern/mesh_render.c index f90783a3dbb..4118208d32f 100644 --- a/source/blender/blenkernel/intern/mesh_render.c +++ b/source/blender/blenkernel/intern/mesh_render.c @@ -234,7 +234,8 @@ typedef struct MeshBatchCache { Batch *fancy_edges; /* owns its vertex buffer (not shared) */ Batch *overlay_edges; /* owns its vertex buffer */ - /* TODO: settings, before DEPSGRAPH update */ + /* settings to determine if cache is invalid */ + bool is_dirty; int tot_edges; int tot_faces; int tot_polys; @@ -254,20 +255,20 @@ static bool mesh_batch_cache_valid(Mesh *me) return false; } - if (cache->is_editmode) { - DerivedMesh *dm = me->edit_btmesh->derivedFinal; - if ((dm->dirty & DM_MESH_BATCH_CACHE) == 0) { + if (cache->is_dirty == false) { + return true; + } + else { + if (cache->is_editmode) { + return false; + } + else if ((cache->tot_edges != mesh_render_get_num_edges(me)) || + (cache->tot_faces != mesh_render_get_num_faces(me)) || + (cache->tot_polys != mesh_render_get_num_polys(me)) || + (cache->tot_verts != mesh_render_get_num_verts(me))) + { return false; } - } - - /* TODO: temporary check, waiting for depsgraph update */ - if ((cache->tot_edges != mesh_render_get_num_edges(me)) || - (cache->tot_faces != mesh_render_get_num_faces(me)) || - (cache->tot_polys != mesh_render_get_num_polys(me)) || - (cache->tot_verts != mesh_render_get_num_verts(me))) - { - return false; } return true; @@ -278,15 +279,14 @@ static void mesh_batch_cache_init(Mesh *me) MeshBatchCache *cache = me->batch_cache; cache->is_editmode = me->edit_btmesh != NULL; - cache->tot_edges = mesh_render_get_num_edges(me); - cache->tot_faces = mesh_render_get_num_faces(me); - cache->tot_polys = mesh_render_get_num_polys(me); - cache->tot_verts = mesh_render_get_num_verts(me); - - if (cache->is_editmode) { - DerivedMesh *dm = me->edit_btmesh->derivedFinal; - dm->dirty |= DM_MESH_BATCH_CACHE; + if (cache->is_editmode == false) { + cache->tot_edges = mesh_render_get_num_edges(me); + cache->tot_faces = mesh_render_get_num_faces(me); + cache->tot_polys = mesh_render_get_num_polys(me); + cache->tot_verts = mesh_render_get_num_verts(me); } + + cache->is_dirty = false; } static MeshBatchCache *mesh_batch_cache_get(Mesh *me) @@ -378,6 +378,14 @@ static ElementList *mesh_batch_cache_get_triangles_in_order(Mesh *me) return cache->triangles_in_order; } +void BKE_mesh_batch_cache_dirty(struct Mesh *me) +{ + MeshBatchCache *cache = me->batch_cache; + if (cache) { + cache->is_dirty = true; + } +} + void BKE_mesh_batch_cache_free(Mesh *me) { MeshBatchCache *cache = me->batch_cache; diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 047de18d5b5..46e6d09294d 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -51,6 +51,7 @@ #include "BKE_key.h" #include "BKE_lamp.h" #include "BKE_lattice.h" +#include "BKE_mesh_render.h" #include "BKE_editmesh.h" #include "BKE_object.h" #include "BKE_particle.h" @@ -343,3 +344,11 @@ void BKE_object_eval_uber_data(EvaluationContext *eval_ctx, ob->recalc &= ~(OB_RECALC_DATA | OB_RECALC_TIME); } + +void BKE_object_eval_shading(EvaluationContext *UNUSED(eval_ctx), Object *ob) +{ + DEBUG_PRINT("%s on %s\n", __func__, ob->id.name); + if (ob->type == OB_MESH) { + BKE_mesh_batch_cache_dirty(ob->data); + } +} diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 54eaf29980d..c1316373b2a 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1583,6 +1583,8 @@ bool BKE_scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer * return false; } + BKE_freestyle_config_free(&srl->freestyleConfig); + BLI_remlink(&scene->r.layers, srl); MEM_freeN(srl); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d00e472c2da..cec886b4ce3 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3245,6 +3245,11 @@ static void direct_link_constraints(FileData *fd, ListBase *lb) con->flag |= CONSTRAINT_SPACEONCE; break; } + case CONSTRAINT_TYPE_TRANSFORM_CACHE: + { + bTransformCacheConstraint *data = con->data; + data->reader = NULL; + } } } } @@ -8464,10 +8469,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) static void do_versions_after_linking(Main *main) { - UNUSED_VARS(main); // printf("%s for %s (%s), %d.%d\n", __func__, main->curlib ? main->curlib->name : main->name, // main->curlib ? "LIB" : "MAIN", main->versionfile, main->subversionfile); - blo_do_versions_after_linking_280(main); + do_versions_after_linking_270(main); + do_versions_after_linking_280(main); } static void lib_link_all(FileData *fd, Main *main) diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index d6203a88d95..50cdeca16b5 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -172,7 +172,9 @@ void blo_do_versions_250(struct FileData *fd, struct Library *lib, struct Main * void blo_do_versions_260(struct FileData *fd, struct Library *lib, struct Main *main); void blo_do_versions_270(struct FileData *fd, struct Library *lib, struct Main *main); void blo_do_versions_280(struct FileData *fd, struct Library *lib, struct Main *main); -void blo_do_versions_after_linking_280(struct Main *main); + +void do_versions_after_linking_270(struct Main *main); +void do_versions_after_linking_280(struct Main *main); #endif diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 58cc06ddec6..477382d8c5b 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -34,6 +34,7 @@ /* allow readfile to use deprecated functionality */ #define DNA_DEPRECATED_ALLOW +#include "DNA_anim_types.h" #include "DNA_armature_types.h" #include "DNA_brush_types.h" #include "DNA_camera_types.h" @@ -58,6 +59,7 @@ #include "DNA_genfile.h" +#include "BKE_animsys.h" #include "BKE_colortools.h" #include "BKE_library.h" #include "BKE_main.h" @@ -76,6 +78,9 @@ #include "BLO_readfile.h" +#include "NOD_common.h" +#include "NOD_socket.h" + #include "readfile.h" #include "MEM_guardedalloc.h" @@ -195,6 +200,50 @@ static void do_version_bones_super_bbone(ListBase *lb) } } +/* TODO(sergey): Consider making it somewhat more generic function in BLI_anim.h. */ +static void anim_change_prop_name(FCurve *fcu, + const char *prefix, + const char *old_prop_name, + const char *new_prop_name) +{ + const char *old_path = BLI_sprintfN("%s.%s", prefix, old_prop_name); + if (STREQ(fcu->rna_path, old_path)) { + MEM_freeN(fcu->rna_path); + fcu->rna_path = BLI_sprintfN("%s.%s", prefix, new_prop_name); + } + MEM_freeN((char *)old_path); +} + +static void do_version_hue_sat_node(bNodeTree *ntree, bNode *node) +{ + /* Make sure new sockets are properly created. */ + node_verify_socket_templates(ntree, node); + /* Convert value from old storage to new sockets. */ + NodeHueSat *nhs = node->storage; + bNodeSocket *hue = nodeFindSocket(node, SOCK_IN, "Hue"), + *saturation = nodeFindSocket(node, SOCK_IN, "Saturation"), + *value = nodeFindSocket(node, SOCK_IN, "Value"); + ((bNodeSocketValueFloat *)hue->default_value)->value = nhs->hue; + ((bNodeSocketValueFloat *)saturation->default_value)->value = nhs->sat; + ((bNodeSocketValueFloat *)value->default_value)->value = nhs->val; + /* Take care of possible animation. */ + AnimData *adt = BKE_animdata_from_id(&ntree->id); + if (adt != NULL && adt->action != NULL) { + const char *prefix = BLI_sprintfN("nodes[\"%s\"]", node->name); + for (FCurve *fcu = adt->action->curves.first; fcu != NULL; fcu = fcu->next) { + if (STRPREFIX(fcu->rna_path, prefix)) { + anim_change_prop_name(fcu, prefix, "color_hue", "inputs[1].default_value"); + anim_change_prop_name(fcu, prefix, "color_saturation", "inputs[2].default_value"); + anim_change_prop_name(fcu, prefix, "color_value", "inputs[3].default_value"); + } + } + MEM_freeN((char *)prefix); + } + /* Free storage, it is no longer used. */ + MEM_freeN(node->storage); + node->storage = NULL; +} + void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) { if (!MAIN_VERSION_ATLEAST(main, 270, 0)) { @@ -1521,6 +1570,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + } { @@ -1546,3 +1596,20 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + +void do_versions_after_linking_270(Main *main) +{ + /* To be added to next subversion bump! */ + { + FOREACH_NODETREE(main, ntree, id) { + if (ntree->type == NTREE_COMPOSIT) { + ntreeSetTypes(NULL, ntree); + for (bNode *node = ntree->nodes.first; node; node = node->next) { + if (node->type == CMP_NODE_HUE_SAT) { + do_version_hue_sat_node(ntree, node); + } + } + } + } FOREACH_NODETREE_END + } +} diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index bd6bb9eebf0..2f3251fb702 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -46,7 +46,7 @@ #include "MEM_guardedalloc.h" -void blo_do_versions_after_linking_280(Main *main) +void do_versions_after_linking_280(Main *main) { if (!MAIN_VERSION_ATLEAST(main, 280, 0)) { for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp b/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp index 29c296a896d..b8971fffe3e 100644 --- a/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp +++ b/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp @@ -37,8 +37,11 @@ HueSaturationValueNode::HueSaturationValueNode(bNode *editorNode) : Node(editorN void HueSaturationValueNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const { - NodeInput *valueSocket = this->getInputSocket(0); - NodeInput *colorSocket = this->getInputSocket(1); + NodeInput *colorSocket = this->getInputSocket(0); + NodeInput *hueSocket = this->getInputSocket(1); + NodeInput *saturationSocket = this->getInputSocket(2); + NodeInput *valueSocket = this->getInputSocket(3); + NodeInput *facSocket = this->getInputSocket(4); NodeOutput *outputSocket = this->getOutputSocket(0); bNode *editorsnode = getbNode(); NodeHueSat *storage = (NodeHueSat *)editorsnode->storage; @@ -50,9 +53,9 @@ void HueSaturationValueNode::convertToOperations(NodeConverter &converter, const converter.addOperation(hsvToRGB); ChangeHSVOperation *changeHSV = new ChangeHSVOperation(); - changeHSV->setHue(storage->hue); - changeHSV->setSaturation(storage->sat); - changeHSV->setValue(storage->val); + converter.mapInputSocket(hueSocket, changeHSV->getInputSocket(1)); + converter.mapInputSocket(saturationSocket, changeHSV->getInputSocket(2)); + converter.mapInputSocket(valueSocket, changeHSV->getInputSocket(3)); converter.addOperation(changeHSV); MixBlendOperation *blend = new MixBlendOperation(); @@ -64,6 +67,6 @@ void HueSaturationValueNode::convertToOperations(NodeConverter &converter, const converter.addLink(changeHSV->getOutputSocket(), hsvToRGB->getInputSocket(0)); converter.addLink(hsvToRGB->getOutputSocket(), blend->getInputSocket(2)); converter.mapInputSocket(colorSocket, blend->getInputSocket(1)); - converter.mapInputSocket(valueSocket, blend->getInputSocket(0)); + converter.mapInputSocket(facSocket, blend->getInputSocket(0)); converter.mapOutputSocket(outputSocket, blend->getOutputSocket()); } diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp b/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp index 964f1d64667..7ea974a41dc 100644 --- a/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp +++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp @@ -25,6 +25,9 @@ ChangeHSVOperation::ChangeHSVOperation() : NodeOperation() { this->addInputSocket(COM_DT_COLOR); + this->addInputSocket(COM_DT_VALUE); + this->addInputSocket(COM_DT_VALUE); + this->addInputSocket(COM_DT_VALUE); this->addOutputSocket(COM_DT_COLOR); this->m_inputOperation = NULL; } @@ -32,24 +35,34 @@ ChangeHSVOperation::ChangeHSVOperation() : NodeOperation() void ChangeHSVOperation::initExecution() { this->m_inputOperation = getInputSocketReader(0); + this->m_hueOperation = getInputSocketReader(1); + this->m_saturationOperation = getInputSocketReader(2); + this->m_valueOperation = getInputSocketReader(3); } void ChangeHSVOperation::deinitExecution() { this->m_inputOperation = NULL; + this->m_hueOperation = NULL; + this->m_saturationOperation = NULL; + this->m_valueOperation = NULL; } void ChangeHSVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; + float hue[4], saturation[4], value[4]; this->m_inputOperation->readSampled(inputColor1, x, y, sampler); + this->m_hueOperation->readSampled(hue, x, y, sampler); + this->m_saturationOperation->readSampled(saturation, x, y, sampler); + this->m_valueOperation->readSampled(value, x, y, sampler); - output[0] = inputColor1[0] + (this->m_hue - 0.5f); + output[0] = inputColor1[0] + (hue[0] - 0.5f); if (output[0] > 1.0f) output[0] -= 1.0f; else if (output[0] < 0.0f) output[0] += 1.0f; - output[1] = inputColor1[1] * this->m_saturation; - output[2] = inputColor1[2] * this->m_value; + output[1] = inputColor1[1] * saturation[0]; + output[2] = inputColor1[2] * value[0]; output[3] = inputColor1[3]; } diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.h b/source/blender/compositor/operations/COM_ChangeHSVOperation.h index 76025e86b7a..800c09c05ff 100644 --- a/source/blender/compositor/operations/COM_ChangeHSVOperation.h +++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.h @@ -32,10 +32,9 @@ class ChangeHSVOperation : public NodeOperation { private: SocketReader *m_inputOperation; - - float m_hue; - float m_saturation; - float m_value; + SocketReader *m_hueOperation; + SocketReader *m_saturationOperation; + SocketReader *m_valueOperation; public: /** @@ -51,9 +50,5 @@ public: */ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); - void setHue(float hue) { this->m_hue = hue; } - void setSaturation(float saturation) { this->m_saturation = saturation; } - void setValue(float value) { this->m_value = value; } - }; #endif diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index e312c4e0dcb..4b73dfa1ec3 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -320,6 +320,23 @@ OperationDepsNode *DepsgraphNodeBuilder::find_operation_node( /* **** Build functions for entity nodes **** */ +void DepsgraphNodeBuilder::begin_build(Main *bmain) { + /* LIB_TAG_DOIT is used to indicate whether node for given ID was already + * created or not. This flag is being set in add_id_node(), so functions + * shouldn't bother with setting it, they only might query this flag when + * needed. + */ + BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); + /* XXX nested node trees are not included in tag-clearing above, + * so we need to do this manually. + */ + FOREACH_NODETREE(bmain, nodetree, id) { + if (id != (ID *)nodetree) { + nodetree->id.tag &= ~LIB_TAG_DOIT; + } + } FOREACH_NODETREE_END +} + void DepsgraphNodeBuilder::build_group(Scene *scene, Base *base, Group *group) @@ -626,18 +643,18 @@ void DepsgraphNodeBuilder::build_world(World *world) } /* world itself */ - IDDepsNode *world_node = add_id_node(world_id); /* world shading/params? */ + add_id_node(world_id); /* world shading/params? */ build_animdata(world_id); /* TODO: other settings? */ /* textures */ - build_texture_stack(world_node, world->mtex); + build_texture_stack(world->mtex); /* world's nodetree */ if (world->nodetree) { - build_nodetree(world_node, world->nodetree); + build_nodetree(world->nodetree); } } @@ -807,13 +824,18 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) } /* materials */ - for (int a = 1; a <= ob->totcol; a++) { - Material *ma = give_current_material(ob, a); - if (ma != NULL) { - // XXX?! - ComponentDepsNode *geom_node = add_component_node(&ob->id, DEPSNODE_TYPE_GEOMETRY); - build_material(geom_node, ma); + if (ob->totcol != 0) { + for (int a = 1; a <= ob->totcol; a++) { + Material *ma = give_current_material(ob, a); + if (ma != NULL) { + build_material(ma); + } } + add_operation_node(&ob->id, + DEPSNODE_TYPE_SHADING, + DEPSOP_TYPE_EXEC, + function_bind(BKE_object_eval_shading, _1, ob), + DEG_OPCODE_OPERATION, "Material Update"); } /* geometry collision */ @@ -976,7 +998,7 @@ void DepsgraphNodeBuilder::build_lamp(Object *ob) build_animdata(&la->id); /* node for obdata */ - ComponentDepsNode *param_node = add_component_node(lamp_id, DEPSNODE_TYPE_PARAMETERS); + add_component_node(lamp_id, DEPSNODE_TYPE_PARAMETERS); /* TODO(sergey): Is it really how we're supposed to work with drivers? */ add_operation_node(lamp_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, @@ -984,14 +1006,14 @@ void DepsgraphNodeBuilder::build_lamp(Object *ob) /* lamp's nodetree */ if (la->nodetree) { - build_nodetree(param_node, la->nodetree); + build_nodetree(la->nodetree); } /* textures */ - build_texture_stack(param_node, la->mtex); + build_texture_stack(la->mtex); } -void DepsgraphNodeBuilder::build_nodetree(DepsNode *owner_node, bNodeTree *ntree) +void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree) { if (!ntree) return; @@ -1011,10 +1033,10 @@ void DepsgraphNodeBuilder::build_nodetree(DepsNode *owner_node, bNodeTree *ntree if (id != NULL) { short id_type = GS(id->name); if (id_type == ID_MA) { - build_material(owner_node, (Material *)id); + build_material((Material *)id); } else if (id_type == ID_TE) { - build_texture(owner_node, (Tex *)id); + build_texture((Tex *)id); } else if (id_type == ID_IM) { build_image((Image *)id); @@ -1022,7 +1044,7 @@ void DepsgraphNodeBuilder::build_nodetree(DepsNode *owner_node, bNodeTree *ntree else if (bnode->type == NODE_GROUP) { bNodeTree *group_ntree = (bNodeTree *)id; if ((group_ntree->id.tag & LIB_TAG_DOIT) == 0) { - build_nodetree(owner_node, group_ntree); + build_nodetree(group_ntree); } } } @@ -1032,7 +1054,7 @@ void DepsgraphNodeBuilder::build_nodetree(DepsNode *owner_node, bNodeTree *ntree } /* Recursively build graph for material */ -void DepsgraphNodeBuilder::build_material(DepsNode *owner_node, Material *ma) +void DepsgraphNodeBuilder::build_material(Material *ma) { ID *ma_id = &ma->id; if (ma_id->tag & LIB_TAG_DOIT) { @@ -1050,14 +1072,14 @@ void DepsgraphNodeBuilder::build_material(DepsNode *owner_node, Material *ma) build_animdata(ma_id); /* textures */ - build_texture_stack(owner_node, ma->mtex); + build_texture_stack(ma->mtex); /* material's nodetree */ - build_nodetree(owner_node, ma->nodetree); + build_nodetree(ma->nodetree); } /* Texture-stack attached to some shading datablock */ -void DepsgraphNodeBuilder::build_texture_stack(DepsNode *owner_node, MTex **texture_stack) +void DepsgraphNodeBuilder::build_texture_stack(MTex **texture_stack) { int i; @@ -1065,12 +1087,12 @@ void DepsgraphNodeBuilder::build_texture_stack(DepsNode *owner_node, MTex **text for (i = 0; i < MAX_MTEX; i++) { MTex *mtex = texture_stack[i]; if (mtex && mtex->tex) - build_texture(owner_node, mtex->tex); + build_texture(mtex->tex); } } /* Recursively build graph for texture */ -void DepsgraphNodeBuilder::build_texture(DepsNode *owner_node, Tex *tex) +void DepsgraphNodeBuilder::build_texture(Tex *tex) { ID *tex_id = &tex->id; if (tex_id->tag & LIB_TAG_DOIT) { @@ -1080,7 +1102,7 @@ void DepsgraphNodeBuilder::build_texture(DepsNode *owner_node, Tex *tex) /* Texture itself. */ build_animdata(tex_id); /* Texture's nodetree. */ - build_nodetree(owner_node, tex->nodetree); + build_nodetree(tex->nodetree); /* Special cases for different IDs which texture uses. */ if (tex->type == TEX_IMAGE) { if (tex->ima != NULL) { @@ -1114,8 +1136,8 @@ void DepsgraphNodeBuilder::build_compositor(Scene *scene) //graph->get_node(&scene->id, NULL, DEPSNODE_TYPE_COMPOSITING, NULL); /* for now, nodetrees are just parameters; compositing occurs in internals of renderer... */ - ComponentDepsNode *owner_node = add_component_node(&scene->id, DEPSNODE_TYPE_PARAMETERS); - build_nodetree(owner_node, scene->nodetree); + add_component_node(&scene->id, DEPSNODE_TYPE_PARAMETERS); + build_nodetree(scene->nodetree); } void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 9cb8bc5d45c..c5035f35f6e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -72,6 +72,8 @@ struct DepsgraphNodeBuilder { DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph); ~DepsgraphNodeBuilder(); + void begin_build(Main *bmain); + RootDepsNode *add_root_node(); IDDepsNode *add_id_node(ID *id); TimeSourceDepsNode *add_time_source(ID *id); @@ -147,10 +149,10 @@ struct DepsgraphNodeBuilder { void build_obdata_geom(Scene *scene, Object *ob); void build_camera(Object *ob); void build_lamp(Object *ob); - void build_nodetree(DepsNode *owner_node, bNodeTree *ntree); - void build_material(DepsNode *owner_node, Material *ma); - void build_texture(DepsNode *owner_node, Tex *tex); - void build_texture_stack(DepsNode *owner_node, MTex **texture_stack); + void build_nodetree(bNodeTree *ntree); + void build_material(Material *ma); + void build_texture(Tex *tex); + void build_texture_stack(MTex **texture_stack); void build_image(Image *image); void build_world(World *world); void build_compositor(Scene *scene); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc index c1d51c1ace9..b1896fdc22a 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -119,7 +119,17 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) * Eventually, we need some type of proxy/isolation mechanism in-between here * to ensure that we can use same rig multiple times in same scene... */ - build_animdata(&arm->id); + if ((arm->id.tag & LIB_TAG_DOIT) == 0) { + build_animdata(&arm->id); + + /* Make sure pose is up-to-date with armature updates. */ + add_operation_node(&arm->id, + DEPSNODE_TYPE_PARAMETERS, + DEPSOP_TYPE_EXEC, + NULL, + DEG_OPCODE_PLACEHOLDER, + "Armature Eval"); + } /* Rebuild pose if not up to date. */ if (ob->pose == NULL || (ob->pose->flag & POSE_RECALC)) { @@ -141,14 +151,6 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) } } - /* Make sure pose is up-to-date with armature updates. */ - add_operation_node(&arm->id, - DEPSNODE_TYPE_PARAMETERS, - DEPSOP_TYPE_EXEC, - NULL, - DEG_OPCODE_PLACEHOLDER, - "Armature Eval"); - /** * Pose Rig Graph * ============== diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc index bcd4bc51448..99e61692231 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc @@ -65,20 +65,6 @@ namespace DEG { void DepsgraphNodeBuilder::build_scene(Main *bmain, Scene *scene) { - /* LIB_TAG_DOIT is used to indicate whether node for given ID was already - * created or not. This flag is being set in add_id_node(), so functions - * shouldn't bother with setting it, they only might query this flag when - * needed. - */ - BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); - /* XXX nested node trees are not included in tag-clearing above, - * so we need to do this manually. - */ - FOREACH_NODETREE(bmain, nodetree, id) { - if (id != (ID *)nodetree) - nodetree->id.tag &= ~LIB_TAG_DOIT; - } FOREACH_NODETREE_END - /* scene ID block */ add_id_node(&scene->id); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index b5272d3acf2..41d2ca0ca6d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -339,6 +339,22 @@ void DepsgraphRelationBuilder::add_forcefield_relations(const OperationKey &key, /* **** Functions to build relations between entities **** */ +void DepsgraphRelationBuilder::begin_build(Main *bmain) +{ + /* LIB_TAG_DOIT is used to indicate whether node for given ID was already + * created or not. + */ + BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); + /* XXX nested node trees are notr included in tag-clearing above, + * so we need to do this manually. + */ + FOREACH_NODETREE(bmain, nodetree, id) { + if (id != (ID *)nodetree) { + nodetree->id.tag &= ~LIB_TAG_DOIT; + } + } FOREACH_NODETREE_END +} + void DepsgraphRelationBuilder::build_group(Main *bmain, Scene *scene, Object *object, @@ -489,7 +505,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o /* grease pencil */ if (ob->gpd) { - build_gpencil(&ob->id, ob->gpd); + build_gpencil(ob->gpd); } } @@ -1062,10 +1078,10 @@ void DepsgraphRelationBuilder::build_world(World *world) /* TODO: other settings? */ /* textures */ - build_texture_stack(world_id, world->mtex); + build_texture_stack(world->mtex); /* world's nodetree */ - build_nodetree(world_id, world->nodetree); + build_nodetree(world->nodetree); } void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) @@ -1402,15 +1418,28 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje } /* materials */ - if (ob->totcol) { - int a; - - for (a = 1; a <= ob->totcol; a++) { + if (ob->totcol != 0) { + ComponentKey object_shading_key(&ob->id, DEPSNODE_TYPE_SHADING); + for (int a = 1; a <= ob->totcol; a++) { Material *ma = give_current_material(ob, a); - - if (ma) - build_material(&ob->id, ma); + if (ma != NULL) { + build_material(ma); + ComponentKey material_shading_key(&ma->id, + DEPSNODE_TYPE_SHADING); + add_relation(material_shading_key, + object_shading_key, + DEPSREL_TYPE_UPDATE, + "Object Shading"); + } } + OperationKey obdata_geom_done_key(obdata, + DEPSNODE_TYPE_GEOMETRY, + DEG_OPCODE_PLACEHOLDER, + "Eval Done"); + add_relation(geom_key, + object_shading_key, + DEPSREL_TYPE_UPDATE, + "Object Shading"); } /* geometry collision */ @@ -1568,17 +1597,17 @@ void DepsgraphRelationBuilder::build_lamp(Object *ob) /* lamp's nodetree */ if (la->nodetree) { - build_nodetree(lamp_id, la->nodetree); + build_nodetree(la->nodetree); ComponentKey nodetree_key(&la->nodetree->id, DEPSNODE_TYPE_PARAMETERS); add_relation(nodetree_key, parameters_key, DEPSREL_TYPE_COMPONENT_ORDER, "NTree->Lamp Parameters"); } /* textures */ - build_texture_stack(lamp_id, la->mtex); + build_texture_stack(la->mtex); } -void DepsgraphRelationBuilder::build_nodetree(ID *owner, bNodeTree *ntree) +void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) { if (!ntree) return; @@ -1596,15 +1625,15 @@ void DepsgraphRelationBuilder::build_nodetree(ID *owner, bNodeTree *ntree) LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) { if (bnode->id) { if (GS(bnode->id->name) == ID_MA) { - build_material(owner, (Material *)bnode->id); + build_material((Material *)bnode->id); } else if (bnode->type == ID_TE) { - build_texture(owner, (Tex *)bnode->id); + build_texture((Tex *)bnode->id); } else if (bnode->type == NODE_GROUP) { bNodeTree *group_ntree = (bNodeTree *)bnode->id; if ((group_ntree->id.tag & LIB_TAG_DOIT) == 0) { - build_nodetree(owner, group_ntree); + build_nodetree(group_ntree); group_ntree->id.tag |= LIB_TAG_DOIT; } OperationKey group_parameters_key(&group_ntree->id, @@ -1622,12 +1651,10 @@ void DepsgraphRelationBuilder::build_nodetree(ID *owner, bNodeTree *ntree) add_relation(animation_key, parameters_key, DEPSREL_TYPE_COMPONENT_ORDER, "NTree Parameters"); } - - // TODO: link from nodetree to owner_component? } /* Recursively build graph for material */ -void DepsgraphRelationBuilder::build_material(ID *owner, Material *ma) +void DepsgraphRelationBuilder::build_material(Material *ma) { ID *ma_id = &ma->id; if (ma_id->tag & LIB_TAG_DOIT) { @@ -1639,14 +1666,26 @@ void DepsgraphRelationBuilder::build_material(ID *owner, Material *ma) build_animdata(ma_id); /* textures */ - build_texture_stack(owner, ma->mtex); + build_texture_stack(ma->mtex); /* material's nodetree */ - build_nodetree(owner, ma->nodetree); + if (ma->nodetree != NULL) { + build_nodetree(ma->nodetree); + OperationKey ntree_key(&ma->nodetree->id, + DEPSNODE_TYPE_PARAMETERS, + DEG_OPCODE_PLACEHOLDER, + "Parameters Eval"); + OperationKey material_key(&ma->id, + DEPSNODE_TYPE_SHADING, + DEG_OPCODE_PLACEHOLDER, + "Material Update"); + add_relation(ntree_key, material_key, + DEPSREL_TYPE_UPDATE, "Material's NTree"); + } } /* Recursively build graph for texture */ -void DepsgraphRelationBuilder::build_texture(ID *owner, Tex *tex) +void DepsgraphRelationBuilder::build_texture(Tex *tex) { ID *tex_id = &tex->id; if (tex_id->tag & LIB_TAG_DOIT) { @@ -1658,11 +1697,11 @@ void DepsgraphRelationBuilder::build_texture(ID *owner, Tex *tex) build_animdata(tex_id); /* texture's nodetree */ - build_nodetree(owner, tex->nodetree); + build_nodetree(tex->nodetree); } /* Texture-stack attached to some shading datablock */ -void DepsgraphRelationBuilder::build_texture_stack(ID *owner, MTex **texture_stack) +void DepsgraphRelationBuilder::build_texture_stack(MTex **texture_stack) { int i; @@ -1670,17 +1709,17 @@ void DepsgraphRelationBuilder::build_texture_stack(ID *owner, MTex **texture_sta for (i = 0; i < MAX_MTEX; i++) { MTex *mtex = texture_stack[i]; if (mtex && mtex->tex) - build_texture(owner, mtex->tex); + build_texture(mtex->tex); } } void DepsgraphRelationBuilder::build_compositor(Scene *scene) { /* For now, just a plain wrapper? */ - build_nodetree(&scene->id, scene->nodetree); + build_nodetree(scene->nodetree); } -void DepsgraphRelationBuilder::build_gpencil(ID *UNUSED(owner), bGPdata *gpd) +void DepsgraphRelationBuilder::build_gpencil(bGPdata *gpd) { /* animation */ build_animdata(&gpd->id); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 6e8485bee30..054e4103290 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -171,6 +171,8 @@ struct DepsgraphRelationBuilder { DepsgraphRelationBuilder(Depsgraph *graph); + void begin_build(Main *bmain); + template <typename KeyFrom, typename KeyTo> void add_relation(const KeyFrom& key_from, const KeyTo& key_to, @@ -217,12 +219,12 @@ struct DepsgraphRelationBuilder void build_obdata_geom(Main *bmain, Scene *scene, Object *ob); void build_camera(Object *ob); void build_lamp(Object *ob); - void build_nodetree(ID *owner, bNodeTree *ntree); - void build_material(ID *owner, Material *ma); - void build_texture(ID *owner, Tex *tex); - void build_texture_stack(ID *owner, MTex **texture_stack); + void build_nodetree(bNodeTree *ntree); + void build_material(Material *ma); + void build_texture(Tex *tex); + void build_texture_stack(MTex **texture_stack); void build_compositor(Scene *scene); - void build_gpencil(ID *owner, bGPdata *gpd); + void build_gpencil(bGPdata *gpd); void build_cachefile(CacheFile *cache_file); void build_mask(Mask *mask); void build_movieclip(MovieClip *clip); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc index 6b51a957da0..8a3476cff45 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc @@ -69,20 +69,8 @@ namespace DEG { void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene) { - /* LIB_TAG_DOIT is used to indicate whether node for given ID was already - * created or not. - */ - BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); - /* XXX nested node trees are not included in tag-clearing above, - * so we need to do this manually. - */ - FOREACH_NODETREE(bmain, nodetree, id) { - if (id != (ID *)nodetree) - nodetree->id.tag &= ~LIB_TAG_DOIT; - } FOREACH_NODETREE_END - if (scene->set) { - // TODO: link set to scene, especially our timesource... + build_scene(bmain, scene->set); } /* scene objects */ @@ -132,7 +120,7 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene) /* grease pencil */ if (scene->gpd) { - build_gpencil(&scene->id, scene->gpd); + build_gpencil(scene->gpd); } /* Masks. */ diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 9952f714145..3a69469053c 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -209,6 +209,7 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene) * - this way it should be the first in the graph, * reflecting its role as the entrypoint */ + node_builder.begin_build(bmain); node_builder.add_root_node(); node_builder.build_scene(bmain, scene); @@ -221,6 +222,7 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene) * it doesnt add any operations anyway and is not clear what part of the * scene is to be connected. */ + relation_builder.begin_build(bmain); #if 0 relation_builder.add_relation(RootKey(), IDKey(scene), diff --git a/source/blender/depsgraph/intern/depsgraph_type_defines.cc b/source/blender/depsgraph/intern/depsgraph_type_defines.cc index 4ce91516c84..39c189629f2 100644 --- a/source/blender/depsgraph/intern/depsgraph_type_defines.cc +++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cc @@ -145,7 +145,7 @@ DepsOperationStringifier::DepsOperationStringifier() const char *DepsOperationStringifier::operator[](eDepsOperation_Code opcode) { - BLI_assert((opcode > 0) && (opcode < DEG_NUM_OPCODES)); + BLI_assert((opcode >= 0) && (opcode < DEG_NUM_OPCODES)); if (opcode >= 0 && opcode < DEG_NUM_OPCODES) { return names_[opcode]; } diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index b02a909d009..7262b453e02 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -581,6 +581,9 @@ static void ui_item_enum_expand( UI_block_layout_set_current(block, layout_radial); } else { + if (layout->item.type == ITEM_LAYOUT_RADIAL) { + layout_radial = layout; + } UI_block_layout_set_current(block, layout); } } @@ -593,8 +596,9 @@ static void ui_item_enum_expand( for (item = item_array; item->identifier; item++) { if (!item->identifier[0]) { - if (radial) + if (radial && layout_radial) { uiItemS(layout_radial); + } continue; } diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index b82972853e2..d3c8fed5fc1 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -194,7 +194,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - immUniformColor4ubv(bg); + immUniformColor3ubv(bg); immRecti(pos, 0, cdc->xy[1], cdc->winx, (cdc->xy[1] + (cdc->lheight * tot_lines))); immUnbindProgram(); @@ -248,7 +248,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - immUniformColor4ubv(bg); + immUniformColor3ubv(bg); immRecti(pos, 0, cdc->xy[1], cdc->winx, cdc->xy[1] + cdc->lheight); immUnbindProgram(); diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index c3f2d05b0fb..e02c69ea857 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1587,17 +1587,6 @@ static void node_composit_buts_zcombine(uiLayout *layout, bContext *UNUSED(C), P uiItemR(col, ptr, "use_antialias_z", 0, NULL, ICON_NONE); } - -static void node_composit_buts_hue_sat(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) -{ - uiLayout *col; - - col = uiLayoutColumn(layout, false); - uiItemR(col, ptr, "color_hue", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(col, ptr, "color_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(col, ptr, "color_value", UI_ITEM_R_SLIDER, NULL, ICON_NONE); -} - static void node_composit_buts_dilateerode(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE); @@ -2556,9 +2545,6 @@ static void node_composit_set_butfunc(bNodeType *ntype) case CMP_NODE_ALPHAOVER: ntype->draw_buttons = node_composit_buts_alphaover; break; - case CMP_NODE_HUE_SAT: - ntype->draw_buttons = node_composit_buts_hue_sat; - break; case CMP_NODE_TEXTURE: ntype->draw_buttons = node_buts_texture; break; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 3a7e2b6f7f8..fd601e55550 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -595,6 +595,7 @@ typedef struct NodeBilateralBlurData { short iter, pad; } NodeBilateralBlurData; +/* NOTE: Only for do-version code. */ typedef struct NodeHueSat { float hue, sat, val; } NodeHueSat; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index a9e78428212..b35142f2a58 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -4443,34 +4443,6 @@ static void def_cmp_alpha_over(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } -static void def_cmp_hue_saturation(StructRNA *srna) -{ - PropertyRNA *prop; - - RNA_def_struct_sdna_from(srna, "NodeHueSat", "storage"); - - prop = RNA_def_property(srna, "color_hue", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "hue"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_float_default(prop, 0.5f); - RNA_def_property_ui_text(prop, "Hue", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sat"); - RNA_def_property_range(prop, 0.0f, 2.0f); - RNA_def_property_ui_text(prop, "Saturation", ""); - RNA_def_property_float_default(prop, 1.0f); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "color_value", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "val"); - RNA_def_property_range(prop, 0.0f, 2.0f); - RNA_def_property_ui_text(prop, "Value", ""); - RNA_def_property_float_default(prop, 1.0f); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); -} - static void def_cmp_blur(StructRNA *srna) { PropertyRNA *prop; diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index 171d5313c1d..a9c0df7d7e8 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -145,7 +145,7 @@ DefNode( CompositorNode, CMP_NODE_VECBLUR, def_cmp_vector_blur, "VECBL DefNode( CompositorNode, CMP_NODE_SEPRGBA, 0, "SEPRGBA", SepRGBA, "Separate RGBA", "" ) DefNode( CompositorNode, CMP_NODE_SEPHSVA, 0, "SEPHSVA", SepHSVA, "Separate HSVA", "" ) DefNode( CompositorNode, CMP_NODE_SETALPHA, 0, "SETALPHA", SetAlpha, "Set Alpha", "" ) -DefNode( CompositorNode, CMP_NODE_HUE_SAT, def_cmp_hue_saturation, "HUE_SAT", HueSat, "Hue Saturation Value","" ) +DefNode( CompositorNode, CMP_NODE_HUE_SAT, 0, "HUE_SAT", HueSat, "Hue Saturation Value","" ) DefNode( CompositorNode, CMP_NODE_IMAGE, def_cmp_image, "IMAGE", Image, "Image", "" ) DefNode( CompositorNode, CMP_NODE_R_LAYERS, def_cmp_render_layers, "R_LAYERS", RLayers, "Render Layers", "" ) DefNode( CompositorNode, CMP_NODE_COMPOSITE, def_cmp_composite, "COMPOSITE", Composite, "Composite", "" ) diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c index 1c31f4863ca..952ba78aff3 100644 --- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c +++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c @@ -35,8 +35,11 @@ /* **************** Hue Saturation ******************** */ static bNodeSocketTemplate cmp_node_hue_sat_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, + { SOCK_FLOAT, 1, N_("Hue"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1, 0, "" } }; static bNodeSocketTemplate cmp_node_hue_sat_out[] = { @@ -44,23 +47,12 @@ static bNodeSocketTemplate cmp_node_hue_sat_out[] = { { -1, 0, "" } }; -static void node_composit_init_hue_sat(bNodeTree *UNUSED(ntree), bNode *node) -{ - NodeHueSat *nhs = MEM_callocN(sizeof(NodeHueSat), "node hue sat"); - node->storage = nhs; - nhs->hue = 0.5f; - nhs->sat = 1.0f; - nhs->val = 1.0f; -} - void register_node_type_cmp_hue_sat(void) { static bNodeType ntype; cmp_node_type_base(&ntype, CMP_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, 0); node_type_socket_templates(&ntype, cmp_node_hue_sat_in, cmp_node_hue_sat_out); - node_type_init(&ntype, node_composit_init_hue_sat); - node_type_storage(&ntype, "NodeHueSat", node_free_standard_storage, node_copy_standard_storage); nodeRegisterType(&ntype); } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index aff0d2cf15f..52eca5f7005 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -3440,7 +3440,7 @@ bool RE_WriteRenderViewsMovie( ok = mh->append_movie(movie_ctx_arr[0], rd, preview ? scene->r.psfra : scene->r.sfra, scene->r.cfra, (int *) ibuf_arr[2]->rect, ibuf_arr[2]->x, ibuf_arr[2]->y, "", reports); - for (i = 0; i < 2; i++) { + for (i = 0; i < 3; i++) { /* imbuf knows which rects are not part of ibuf */ IMB_freeImBuf(ibuf_arr[i]); } |