Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-03-25 03:10:41 +0300
committerMatt Ebb <matt@mke3.net>2010-03-25 03:10:41 +0300
commit78e282fdf1330ebe1f980725d3e3154fa1abd5c5 (patch)
treebb1f033cdaaee23f83f78549a0d2f7dabaf7750c /source
parentf1cfb5f13c76e28a5f56fe9dd03001be0c25c530 (diff)
Patch from Francois Tarlier: extend colour balance node 'lift' value to 0.0-2.0 range
(default 1.0), like the other controls. Thanks!
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenloader/intern/readfile.c54
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c3
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c4
4 files changed, 57 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index b9576c343db..6b656f1d12e 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -45,7 +45,7 @@ struct Scene;
struct Main;
#define BLENDER_VERSION 252
-#define BLENDER_SUBVERSION 0
+#define BLENDER_SUBVERSION 1
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b28610fe6a2..609ff7a1d97 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3727,6 +3727,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
fluidmd->fss= newdataadr(fd, fluidmd->fss);
+ fluidmd->fss->fmd= fluidmd;
fluidmd->fss->meshSurfNormals = 0;
}
else if (md->type==eModifierType_Smoke) {
@@ -10642,13 +10643,62 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
} /* sequencer changes */
}
- /* put 2.50 compatibility code here until next subversion bump */
- {
+ if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 1)) {
Brush *brush;
+ Object *ob;
+ Scene *scene;
+ bNodeTree *ntree;
for (brush= main->brush.first; brush; brush= brush->id.next) {
if (brush->curve) brush->curve->preset = CURVE_PRESET_SMOOTH;
}
+
+ /* properly initialise active flag for fluidsim modifiers */
+ for(ob = main->object.first; ob; ob = ob->id.next) {
+ ModifierData *md;
+ for(md= ob->modifiers.first; md; md= md->next) {
+ if (md->type == eModifierType_Fluidsim) {
+ FluidsimModifierData *fmd = (FluidsimModifierData *)md;
+ fmd->fss->flag |= OB_FLUIDSIM_ACTIVE;
+ }
+ }
+ }
+
+ /* adjustment to color balance node values */
+ for(scene= main->scene.first; scene; scene= scene->id.next) {
+ if(scene->nodetree) {
+ bNode *node=scene->nodetree->nodes.first;
+
+ while(node) {
+ if (node->type == CMP_NODE_COLORBALANCE) {
+ NodeColorBalance *n= (NodeColorBalance *)node->storage;
+ n->lift[0] += 1.f;
+ n->lift[1] += 1.f;
+ n->lift[2] += 1.f;
+ }
+ node= node->next;
+ }
+ }
+ }
+ /* check inside node groups too */
+ for (ntree= main->nodetree.first; ntree; ntree=ntree->id.next) {
+ bNode *node=ntree->nodes.first;
+
+ while(node) {
+ if (node->type == CMP_NODE_COLORBALANCE) {
+ NodeColorBalance *n= (NodeColorBalance *)node->storage;
+ n->lift[0] += 1.f;
+ n->lift[1] += 1.f;
+ n->lift[2] += 1.f;
+ }
+ node= node->next;
+ }
+ }
+
+ }
+ /* put 2.50 compatibility code here until next subversion bump */
+ {
+
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index dae280c08dc..6a30a78cd02 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1927,7 +1927,8 @@ static void def_cmp_colorbalance(StructRNA *srna)
prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "lift");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
+ RNA_def_property_float_array_default(prop, default_1);
+ RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_ui_text(prop, "Lift", "Correction for Shadows");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c
index 7ec28e6461d..b40b27e06ee 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c
@@ -56,7 +56,7 @@ DO_INLINE float colorbalance_cdl(float in, float offset, float power, float slop
DO_INLINE float colorbalance_lgg(float in, float lift, float gamma, float gain)
{
- float x = gain*(in+lift*(1-in));
+ float x = gain*(in+(lift-1)*(1-in));
/* prevent NaN */
if (x < 0.f) x = 0.f;
@@ -150,7 +150,7 @@ static void node_composit_init_colorbalance(bNode *node)
{
NodeColorBalance *n= node->storage= MEM_callocN(sizeof(NodeColorBalance), "node colorbalance");
- n->lift[0] = n->lift[1] = n->lift[2] = 0.0f;
+ n->lift[0] = n->lift[1] = n->lift[2] = 1.0f;
n->gamma[0] = n->gamma[1] = n->gamma[2] = 1.0f;
n->gain[0] = n->gain[1] = n->gain[2] = 1.0f;
}