Merge branch 'master' into blender2.8
This commit is contained in:
commit
c26da06ae6
@ -1 +1 @@
|
|||||||
Subproject commit 47700dfc9835ef7154bbd34b8725c8abf2f290df
|
Subproject commit cd65bc3277eda27e1c0b9f20a25928f6586d89a8
|
@ -1 +1 @@
|
|||||||
Subproject commit 6cdbffbc229bf263fa4b9b82a6e33b591c32934c
|
Subproject commit f5536e5e49c34dfc0a7b8990257cd393339e23c6
|
@ -1 +1 @@
|
|||||||
Subproject commit e88b7dfc3bd68888be2d05437cf50e93e41ef47b
|
Subproject commit 310578043dec1aae382eb6a447ae1d103792d7e6
|
@ -1094,7 +1094,7 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used)
|
|||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
case ID_ME:
|
case ID_ME:
|
||||||
return ELEM(id_type_used, ID_ME, ID_KE, ID_MA);
|
return ELEM(id_type_used, ID_ME, ID_KE, ID_MA, ID_IM);
|
||||||
case ID_CU:
|
case ID_CU:
|
||||||
return ELEM(id_type_used, ID_OB, ID_KE, ID_MA, ID_VF);
|
return ELEM(id_type_used, ID_OB, ID_KE, ID_MA, ID_VF);
|
||||||
case ID_MB:
|
case ID_MB:
|
||||||
|
@ -3173,13 +3173,17 @@ void nodeSynchronizeID(bNode *node, bool copy_to_id)
|
|||||||
|
|
||||||
void nodeLabel(bNodeTree *ntree, bNode *node, char *label, int maxlen)
|
void nodeLabel(bNodeTree *ntree, bNode *node, char *label, int maxlen)
|
||||||
{
|
{
|
||||||
|
label[0] = '\0';
|
||||||
|
|
||||||
if (node->label[0] != '\0') {
|
if (node->label[0] != '\0') {
|
||||||
BLI_strncpy(label, node->label, maxlen);
|
BLI_strncpy(label, node->label, maxlen);
|
||||||
}
|
}
|
||||||
else if (node->typeinfo->labelfunc) {
|
else if (node->typeinfo->labelfunc) {
|
||||||
node->typeinfo->labelfunc(ntree, node, label, maxlen);
|
node->typeinfo->labelfunc(ntree, node, label, maxlen);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
/* The previous methods (labelfunc) could not provide an adequate label for the node. */
|
||||||
|
if (label[0] == '\0') {
|
||||||
/* Kind of hacky and weak... Ideally would be better to use RNA here. :| */
|
/* Kind of hacky and weak... Ideally would be better to use RNA here. :| */
|
||||||
const char *tmp = CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, node->typeinfo->ui_name);
|
const char *tmp = CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, node->typeinfo->ui_name);
|
||||||
if (tmp == node->typeinfo->ui_name) {
|
if (tmp == node->typeinfo->ui_name) {
|
||||||
|
@ -4119,10 +4119,6 @@ static void lib_link_material(FileData *fd, Main *main)
|
|||||||
IDP_LibLinkProperty(ma->id.properties, fd);
|
IDP_LibLinkProperty(ma->id.properties, fd);
|
||||||
lib_link_animdata(fd, &ma->id, ma->adt);
|
lib_link_animdata(fd, &ma->id, ma->adt);
|
||||||
|
|
||||||
/* Link ID Properties -- and copy this comment EXACTLY for easy finding
|
|
||||||
* of library blocks that implement this.*/
|
|
||||||
IDP_LibLinkProperty(ma->id.properties, fd);
|
|
||||||
|
|
||||||
ma->ipo = newlibadr_us(fd, ma->id.lib, ma->ipo); // XXX deprecated - old animation system
|
ma->ipo = newlibadr_us(fd, ma->id.lib, ma->ipo); // XXX deprecated - old animation system
|
||||||
ma->group = newlibadr_us(fd, ma->id.lib, ma->group);
|
ma->group = newlibadr_us(fd, ma->id.lib, ma->group);
|
||||||
|
|
||||||
|
@ -37,14 +37,11 @@ void LuminanceMatteNode::convertToOperations(NodeConverter &converter, const Com
|
|||||||
NodeOutput *outputSocketImage = this->getOutputSocket(0);
|
NodeOutput *outputSocketImage = this->getOutputSocket(0);
|
||||||
NodeOutput *outputSocketMatte = this->getOutputSocket(1);
|
NodeOutput *outputSocketMatte = this->getOutputSocket(1);
|
||||||
|
|
||||||
ConvertRGBToYUVOperation *rgbToYUV = new ConvertRGBToYUVOperation();
|
|
||||||
LuminanceMatteOperation *operationSet = new LuminanceMatteOperation();
|
LuminanceMatteOperation *operationSet = new LuminanceMatteOperation();
|
||||||
operationSet->setSettings((NodeChroma *)editorsnode->storage);
|
operationSet->setSettings((NodeChroma *)editorsnode->storage);
|
||||||
converter.addOperation(rgbToYUV);
|
|
||||||
converter.addOperation(operationSet);
|
converter.addOperation(operationSet);
|
||||||
|
|
||||||
converter.mapInputSocket(inputSocket, rgbToYUV->getInputSocket(0));
|
converter.mapInputSocket(inputSocket, operationSet->getInputSocket(0));
|
||||||
converter.addLink(rgbToYUV->getOutputSocket(), operationSet->getInputSocket(0));
|
|
||||||
converter.mapOutputSocket(outputSocketMatte, operationSet->getOutputSocket(0));
|
converter.mapOutputSocket(outputSocketMatte, operationSet->getOutputSocket(0));
|
||||||
|
|
||||||
SetAlphaOperation *operation = new SetAlphaOperation();
|
SetAlphaOperation *operation = new SetAlphaOperation();
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
#include "COM_LuminanceMatteOperation.h"
|
#include "COM_LuminanceMatteOperation.h"
|
||||||
#include "BLI_math.h"
|
#include "BLI_math.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "IMB_colormanagement.h"
|
||||||
|
}
|
||||||
|
|
||||||
LuminanceMatteOperation::LuminanceMatteOperation() : NodeOperation()
|
LuminanceMatteOperation::LuminanceMatteOperation() : NodeOperation()
|
||||||
{
|
{
|
||||||
addInputSocket(COM_DT_COLOR);
|
addInputSocket(COM_DT_COLOR);
|
||||||
@ -43,41 +47,34 @@ void LuminanceMatteOperation::deinitExecution()
|
|||||||
void LuminanceMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
void LuminanceMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inColor[4];
|
float inColor[4];
|
||||||
|
this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
|
||||||
|
|
||||||
const float high = this->m_settings->t1;
|
const float high = this->m_settings->t1;
|
||||||
const float low = this->m_settings->t2;
|
const float low = this->m_settings->t2;
|
||||||
|
const float luminance = IMB_colormanagement_get_luminance(inColor);
|
||||||
|
|
||||||
float alpha;
|
float alpha;
|
||||||
|
|
||||||
this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
|
|
||||||
|
|
||||||
/* one line thread-friend algorithm:
|
/* one line thread-friend algorithm:
|
||||||
* output[0] = max(inputValue[3], min(high, max(low, ((inColor[0] - low) / (high - low))));
|
* output[0] = min(inputValue[3], min(1.0f, max(0.0f, ((luminance - low) / (high - low))));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* test range */
|
/* test range */
|
||||||
if (inColor[0] > high) {
|
if (luminance > high) {
|
||||||
alpha = 1.0f;
|
alpha = 1.0f;
|
||||||
}
|
}
|
||||||
else if (inColor[0] < low) {
|
else if (luminance < low) {
|
||||||
alpha = 0.0f;
|
alpha = 0.0f;
|
||||||
}
|
}
|
||||||
else { /*blend */
|
else { /*blend */
|
||||||
alpha = (inColor[0] - low) / (high - low);
|
alpha = (luminance - low) / (high - low);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* store matte(alpha) value in [0] to go with
|
/* store matte(alpha) value in [0] to go with
|
||||||
* COM_SetAlphaOperation and the Value output
|
* COM_SetAlphaOperation and the Value output
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* don't make something that was more transparent less transparent */
|
/* don't make something that was more transparent less transparent */
|
||||||
if (alpha < inColor[3]) {
|
output[0] = min_ff(alpha, inColor[3]);
|
||||||
output[0] = alpha;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* leave now it was before */
|
|
||||||
output[0] = inColor[3];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5286,14 +5286,14 @@ static void def_cmp_luma_matte(StructRNA *srna)
|
|||||||
prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
|
prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "t1");
|
RNA_def_property_float_sdna(prop, NULL, "t1");
|
||||||
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
|
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
|
||||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
RNA_def_property_ui_range(prop, 0, 1, 0.1f, 3);
|
||||||
RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
|
RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
|
||||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
|
prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "t2");
|
RNA_def_property_float_sdna(prop, NULL, "t2");
|
||||||
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
|
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
|
||||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
RNA_def_property_ui_range(prop, 0, 1, 0.1f, 3);
|
||||||
RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
|
RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
|
||||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||||
}
|
}
|
||||||
@ -5396,14 +5396,14 @@ static void def_cmp_channel_matte(StructRNA *srna)
|
|||||||
prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
|
prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "t1");
|
RNA_def_property_float_sdna(prop, NULL, "t1");
|
||||||
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
|
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
|
||||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
RNA_def_property_ui_range(prop, 0, 1, 0.1f, 3);
|
||||||
RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
|
RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
|
||||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
|
prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "t2");
|
RNA_def_property_float_sdna(prop, NULL, "t2");
|
||||||
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
|
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
|
||||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
RNA_def_property_ui_range(prop, 0, 1, 0.1f, 3);
|
||||||
RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
|
RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
|
||||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||||
}
|
}
|
||||||
|
@ -1265,7 +1265,8 @@ static void rna_def_field(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
|
prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "f_size");
|
RNA_def_property_float_sdna(prop, NULL, "f_size");
|
||||||
RNA_def_property_range(prop, 0.0f, 10.0f);
|
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
||||||
|
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1.0f, 3);
|
||||||
RNA_def_property_ui_text(prop, "Size", "Size of the turbulence");
|
RNA_def_property_ui_text(prop, "Size", "Size of the turbulence");
|
||||||
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
|
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
|
||||||
|
|
||||||
@ -1289,7 +1290,8 @@ static void rna_def_field(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop = RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
|
prop = RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "maxdist");
|
RNA_def_property_float_sdna(prop, NULL, "maxdist");
|
||||||
RNA_def_property_range(prop, 0.0f, 1000.0f);
|
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
||||||
|
RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 1.0f, 3);
|
||||||
RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for the field to work");
|
RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for the field to work");
|
||||||
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
|
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@
|
|||||||
static bNodeSocketTemplate cmp_node_hue_sat_in[] = {
|
static bNodeSocketTemplate cmp_node_hue_sat_in[] = {
|
||||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
{ 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_("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_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.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_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR},
|
||||||
{ SOCK_FLOAT, 1, N_("Fac"), 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, "" }
|
{ -1, 0, "" }
|
||||||
};
|
};
|
||||||
|
@ -341,6 +341,7 @@ void register_node_type_cmp_image(void)
|
|||||||
node_type_init(&ntype, node_composit_init_image);
|
node_type_init(&ntype, node_composit_init_image);
|
||||||
node_type_storage(&ntype, "ImageUser", node_composit_free_image, node_composit_copy_image);
|
node_type_storage(&ntype, "ImageUser", node_composit_free_image, node_composit_copy_image);
|
||||||
node_type_update(&ntype, cmp_node_image_update, NULL);
|
node_type_update(&ntype, cmp_node_image_update, NULL);
|
||||||
|
node_type_label(&ntype, node_image_label);
|
||||||
|
|
||||||
nodeRegisterType(&ntype);
|
nodeRegisterType(&ntype);
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,12 @@ void node_blend_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int ma
|
|||||||
BLI_strncpy(label, IFACE_(name), maxlen);
|
BLI_strncpy(label, IFACE_(name), maxlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void node_image_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen)
|
||||||
|
{
|
||||||
|
/* if there is no loaded image, return an empty string, and let nodeLabel() fill in the proper type translation. */
|
||||||
|
BLI_strncpy(label, (node->id) ? node->id->name + 2 : "", maxlen);
|
||||||
|
}
|
||||||
|
|
||||||
void node_math_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen)
|
void node_math_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen)
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
|
@ -72,6 +72,7 @@ extern void *node_initexec_curves(struct bNodeExecContext *context, struct bNode
|
|||||||
/**** Labels ****/
|
/**** Labels ****/
|
||||||
|
|
||||||
void node_blend_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
void node_blend_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
||||||
|
void node_image_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
||||||
void node_math_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
void node_math_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
||||||
void node_vect_math_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
void node_vect_math_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
||||||
void node_filter_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
void node_filter_label(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
||||||
|
@ -106,6 +106,7 @@ void register_node_type_tex_image(void)
|
|||||||
node_type_init(&ntype, init);
|
node_type_init(&ntype, init);
|
||||||
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
|
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
|
||||||
node_type_exec(&ntype, NULL, NULL, exec);
|
node_type_exec(&ntype, NULL, NULL, exec);
|
||||||
|
node_type_label(&ntype, node_image_label);
|
||||||
|
|
||||||
nodeRegisterType(&ntype);
|
nodeRegisterType(&ntype);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user