Merge branch 'master' into sculpt-dev
This commit is contained in:
commit
373b9b4481
|
@ -23,28 +23,8 @@ from bpy.types import Menu, UIList, Operator
|
|||
from bpy.app.translations import pgettext_iface as iface_
|
||||
|
||||
|
||||
def gpencil_stroke_placement_settings(context, layout):
|
||||
if context.space_data.type == 'VIEW_3D':
|
||||
propname = "annotation_stroke_placement_view3d"
|
||||
elif context.space_data.type == 'SEQUENCE_EDITOR':
|
||||
propname = "annotation_stroke_placement_sequencer_preview"
|
||||
elif context.space_data.type == 'IMAGE_EDITOR':
|
||||
propname = "annotation_stroke_placement_image_editor"
|
||||
else:
|
||||
propname = "annotation_stroke_placement_view2d"
|
||||
|
||||
tool_settings = context.tool_settings
|
||||
|
||||
col = layout.column(align=True)
|
||||
|
||||
if context.space_data.type != 'VIEW_3D':
|
||||
col.label(text="Stroke Placement:")
|
||||
row = col.row(align=True)
|
||||
row.prop_enum(tool_settings, propname, 'VIEW')
|
||||
row.prop_enum(tool_settings, propname, 'CURSOR', text="Cursor")
|
||||
|
||||
|
||||
# XXX: To be replaced with active tools
|
||||
# Currently only used by the clip editor
|
||||
class AnnotationDrawingToolsPanel:
|
||||
# subclass must set
|
||||
# bl_space_type = 'IMAGE_EDITOR'
|
||||
|
@ -55,7 +35,8 @@ class AnnotationDrawingToolsPanel:
|
|||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
is_3d_view = context.space_data.type == 'VIEW_3D'
|
||||
tool_settings = context.tool_settings
|
||||
|
||||
is_clip_editor = context.space_data.type == 'CLIP_EDITOR'
|
||||
|
||||
col = layout.column(align=True)
|
||||
|
@ -72,23 +53,10 @@ class AnnotationDrawingToolsPanel:
|
|||
|
||||
col.separator()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.operator("gpencil.blank_frame_add", icon='FILE_NEW')
|
||||
sub.operator("gpencil.active_frames_delete_all", icon='X', text="Delete Frame(s)")
|
||||
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
if context.space_data.type == 'CLIP_EDITOR':
|
||||
col.separator()
|
||||
col.label(text="Data Source:")
|
||||
row = col.row(align=True)
|
||||
if is_3d_view:
|
||||
row.prop(context.tool_settings, "annotation_source", expand=True)
|
||||
elif is_clip_editor:
|
||||
row.prop(context.space_data, "annotation_source", expand=True)
|
||||
|
||||
gpencil_stroke_placement_settings(context, col)
|
||||
col.label(text="Stroke Placement:")
|
||||
row = col.row(align=True)
|
||||
row.prop_enum(tool_settings, "annotation_stroke_placement_view2d", 'VIEW')
|
||||
row.prop_enum(tool_settings, "annotation_stroke_placement_view2d", 'CURSOR', text="Cursor")
|
||||
|
||||
|
||||
class GreasePencilSculptOptionsPanel:
|
||||
|
@ -447,17 +415,6 @@ class AnnotationDataPanel:
|
|||
bl_region_type = 'UI'
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
# Show this panel as long as someone that might own this exists
|
||||
# AND the owner isn't an object (e.g. GP Object)
|
||||
if context.annotation_data_owner is None:
|
||||
return False
|
||||
elif type(context.annotation_data_owner) is bpy.types.Object:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def draw_header(self, context):
|
||||
if context.space_data.type not in {'VIEW_3D', 'TOPBAR'}:
|
||||
self.layout.prop(context.space_data, "show_annotation", text="")
|
||||
|
@ -466,15 +423,28 @@ class AnnotationDataPanel:
|
|||
layout = self.layout
|
||||
layout.use_property_decorate = False
|
||||
|
||||
is_clip_editor = context.space_data.type == 'CLIP_EDITOR'
|
||||
|
||||
# Grease Pencil owner.
|
||||
gpd_owner = context.annotation_data_owner
|
||||
gpd = context.annotation_data
|
||||
|
||||
# Owner selector.
|
||||
if context.space_data.type == 'CLIP_EDITOR':
|
||||
layout.row().prop(context.space_data, "annotation_source", expand=True)
|
||||
if is_clip_editor:
|
||||
col = layout.column()
|
||||
col.label(text="Data Source:")
|
||||
row = col.row()
|
||||
row.prop(context.space_data, "annotation_source", expand=True)
|
||||
|
||||
layout.template_ID(gpd_owner, "grease_pencil", new="gpencil.annotation_add", unlink="gpencil.data_unlink")
|
||||
# Only allow adding annotation ID if its owner exist
|
||||
if context.annotation_data_owner is None:
|
||||
row = layout.row()
|
||||
row.active = False
|
||||
row.label(text="No annotation source")
|
||||
return
|
||||
|
||||
row = layout.row()
|
||||
row.template_ID(gpd_owner, "grease_pencil", new="gpencil.annotation_add", unlink="gpencil.data_unlink")
|
||||
|
||||
# List of layers/notes.
|
||||
if gpd and gpd.layers:
|
||||
|
|
|
@ -330,6 +330,7 @@ compositor_node_categories = [
|
|||
NodeItem("CompositorNodeHueCorrect"),
|
||||
NodeItem("CompositorNodeBrightContrast"),
|
||||
NodeItem("CompositorNodeGamma"),
|
||||
NodeItem("CompositorNodeExposure"),
|
||||
NodeItem("CompositorNodeColorCorrection"),
|
||||
NodeItem("CompositorNodeTonemap"),
|
||||
NodeItem("CompositorNodeZcombine"),
|
||||
|
|
|
@ -1204,6 +1204,7 @@ void ntreeGPUMaterialNodes(struct bNodeTree *localtree,
|
|||
#define CMP_NODE_SWITCH_VIEW 322
|
||||
#define CMP_NODE_CRYPTOMATTE 323
|
||||
#define CMP_NODE_DENOISE 324
|
||||
#define CMP_NODE_EXPOSURE 325
|
||||
|
||||
/* channel toggles */
|
||||
#define CMP_CHAN_RGB 1
|
||||
|
|
|
@ -4496,6 +4496,7 @@ static void registerCompositNodes(void)
|
|||
register_node_type_cmp_hue_sat();
|
||||
register_node_type_cmp_brightcontrast();
|
||||
register_node_type_cmp_gamma();
|
||||
register_node_type_cmp_exposure();
|
||||
register_node_type_cmp_invert();
|
||||
register_node_type_cmp_alphaover();
|
||||
register_node_type_cmp_zcombine();
|
||||
|
|
|
@ -213,6 +213,8 @@ set(SRC
|
|||
nodes/COM_ColorCorrectionNode.h
|
||||
nodes/COM_ColorCurveNode.cpp
|
||||
nodes/COM_ColorCurveNode.h
|
||||
nodes/COM_ColorExposureNode.cpp
|
||||
nodes/COM_ColorExposureNode.h
|
||||
nodes/COM_ColorRampNode.cpp
|
||||
nodes/COM_ColorRampNode.h
|
||||
nodes/COM_ColorToBWNode.cpp
|
||||
|
@ -399,6 +401,8 @@ set(SRC
|
|||
operations/COM_ChromaMatteOperation.h
|
||||
operations/COM_ColorCurveOperation.cpp
|
||||
operations/COM_ColorCurveOperation.h
|
||||
operations/COM_ColorExposureOperation.cpp
|
||||
operations/COM_ColorExposureOperation.h
|
||||
operations/COM_ColorMatteOperation.cpp
|
||||
operations/COM_ColorMatteOperation.h
|
||||
operations/COM_ColorRampOperation.cpp
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "COM_ColorBalanceNode.h"
|
||||
#include "COM_ColorCorrectionNode.h"
|
||||
#include "COM_ColorCurveNode.h"
|
||||
#include "COM_ColorExposureNode.h"
|
||||
#include "COM_ColorMatteNode.h"
|
||||
#include "COM_ColorNode.h"
|
||||
#include "COM_ColorRampNode.h"
|
||||
|
@ -411,6 +412,9 @@ Node *Converter::convert(bNode *b_node)
|
|||
case CMP_NODE_DENOISE:
|
||||
node = new DenoiseNode(b_node);
|
||||
break;
|
||||
case CMP_NODE_EXPOSURE:
|
||||
node = new ExposureNode(b_node);
|
||||
break;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Copyright 2020, Blender Foundation.
|
||||
*/
|
||||
|
||||
#include "COM_ColorExposureNode.h"
|
||||
#include "COM_ColorExposureOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
ExposureNode::ExposureNode(bNode *editorNode) : Node(editorNode)
|
||||
{
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void ExposureNode::convertToOperations(NodeConverter &converter,
|
||||
const CompositorContext & /*context*/) const
|
||||
{
|
||||
ExposureOperation *operation = new ExposureOperation();
|
||||
converter.addOperation(operation);
|
||||
|
||||
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
|
||||
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
|
||||
converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Copyright 2020, Blender Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __COM_EXPOSURENODE_H__
|
||||
#define __COM_EXPOSURENODE_H__
|
||||
|
||||
#include "COM_Node.h"
|
||||
|
||||
/**
|
||||
* \brief ExposureNode
|
||||
* \ingroup Node
|
||||
*/
|
||||
class ExposureNode : public Node {
|
||||
public:
|
||||
ExposureNode(bNode *editorNode);
|
||||
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Copyright 2020, Blender Foundation.
|
||||
*/
|
||||
|
||||
#include "COM_ColorExposureOperation.h"
|
||||
|
||||
ExposureOperation::ExposureOperation() : NodeOperation()
|
||||
{
|
||||
this->addInputSocket(COM_DT_COLOR);
|
||||
this->addInputSocket(COM_DT_VALUE);
|
||||
this->addOutputSocket(COM_DT_COLOR);
|
||||
this->m_inputProgram = NULL;
|
||||
}
|
||||
|
||||
void ExposureOperation::initExecution()
|
||||
{
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
this->m_inputExposureProgram = this->getInputSocketReader(1);
|
||||
}
|
||||
|
||||
void ExposureOperation::executePixelSampled(float output[4],
|
||||
float x,
|
||||
float y,
|
||||
PixelSampler sampler)
|
||||
{
|
||||
float inputValue[4];
|
||||
float inputExposure[4];
|
||||
this->m_inputProgram->readSampled(inputValue, x, y, sampler);
|
||||
this->m_inputExposureProgram->readSampled(inputExposure, x, y, sampler);
|
||||
const float exposure = pow(2, inputExposure[0]);
|
||||
|
||||
output[0] = inputValue[0] * exposure;
|
||||
output[1] = inputValue[1] * exposure;
|
||||
output[2] = inputValue[2] * exposure;
|
||||
|
||||
output[3] = inputValue[3];
|
||||
}
|
||||
|
||||
void ExposureOperation::deinitExecution()
|
||||
{
|
||||
this->m_inputProgram = NULL;
|
||||
this->m_inputExposureProgram = NULL;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Copyright 2020, Blender Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __COM_COLOREXPOSUREOPERATION_H__
|
||||
#define __COM_COLOREXPOSUREOPERATION_H__
|
||||
#include "COM_NodeOperation.h"
|
||||
|
||||
class ExposureOperation : public NodeOperation {
|
||||
private:
|
||||
/**
|
||||
* Cached reference to the inputProgram
|
||||
*/
|
||||
SocketReader *m_inputProgram;
|
||||
SocketReader *m_inputExposureProgram;
|
||||
|
||||
public:
|
||||
ExposureOperation();
|
||||
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
*/
|
||||
void deinitExecution();
|
||||
};
|
||||
#endif
|
|
@ -103,7 +103,7 @@ typedef struct uiPopupBlockHandle uiPopupBlockHandle;
|
|||
#define UI_SCREEN_MARGIN 10
|
||||
|
||||
/** #uiBlock.emboss and #uiBut.emboss */
|
||||
enum {
|
||||
typedef enum eUIEmbossType {
|
||||
UI_EMBOSS = 0, /* use widget style for drawing */
|
||||
UI_EMBOSS_NONE = 1, /* Nothing, only icon and/or text */
|
||||
UI_EMBOSS_PULLDOWN = 2, /* Pulldown menu style */
|
||||
|
@ -115,7 +115,7 @@ enum {
|
|||
UI_EMBOSS_NONE_OR_STATUS = 4,
|
||||
|
||||
UI_EMBOSS_UNDEFINED = 255, /* For layout engine, use emboss from block. */
|
||||
};
|
||||
} eUIEmbossType;
|
||||
|
||||
/* uiBlock->direction */
|
||||
enum {
|
||||
|
@ -671,7 +671,7 @@ bool UI_popup_block_name_exists(const struct bScreen *screen, const char *name);
|
|||
uiBlock *UI_block_begin(const struct bContext *C,
|
||||
struct ARegion *region,
|
||||
const char *name,
|
||||
char emboss);
|
||||
eUIEmbossType emboss);
|
||||
void UI_block_end_ex(const struct bContext *C, uiBlock *block, const int xy[2], int r_xy[2]);
|
||||
void UI_block_end(const struct bContext *C, uiBlock *block);
|
||||
void UI_block_draw(const struct bContext *C, struct uiBlock *block);
|
||||
|
@ -685,7 +685,7 @@ enum {
|
|||
};
|
||||
void UI_block_theme_style_set(uiBlock *block, char theme_style);
|
||||
char UI_block_emboss_get(uiBlock *block);
|
||||
void UI_block_emboss_set(uiBlock *block, char emboss);
|
||||
void UI_block_emboss_set(uiBlock *block, eUIEmbossType emboss);
|
||||
bool UI_block_is_search_only(const uiBlock *block);
|
||||
void UI_block_set_search_only(uiBlock *block, bool search_only);
|
||||
|
||||
|
@ -1923,7 +1923,7 @@ void uiLayoutSetScaleX(uiLayout *layout, float scale);
|
|||
void uiLayoutSetScaleY(uiLayout *layout, float scale);
|
||||
void uiLayoutSetUnitsX(uiLayout *layout, float unit);
|
||||
void uiLayoutSetUnitsY(uiLayout *layout, float unit);
|
||||
void uiLayoutSetEmboss(uiLayout *layout, char emboss);
|
||||
void uiLayoutSetEmboss(uiLayout *layout, eUIEmbossType emboss);
|
||||
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep);
|
||||
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep);
|
||||
int uiLayoutGetLocalDir(const uiLayout *layout);
|
||||
|
@ -1942,7 +1942,7 @@ float uiLayoutGetScaleX(uiLayout *layout);
|
|||
float uiLayoutGetScaleY(uiLayout *layout);
|
||||
float uiLayoutGetUnitsX(uiLayout *layout);
|
||||
float uiLayoutGetUnitsY(uiLayout *layout);
|
||||
int uiLayoutGetEmboss(uiLayout *layout);
|
||||
eUIEmbossType uiLayoutGetEmboss(uiLayout *layout);
|
||||
bool uiLayoutGetPropSep(uiLayout *layout);
|
||||
bool uiLayoutGetPropDecorate(uiLayout *layout);
|
||||
|
||||
|
|
|
@ -3478,7 +3478,7 @@ void UI_block_region_set(uiBlock *block, ARegion *region)
|
|||
block->oldblock = oldblock;
|
||||
}
|
||||
|
||||
uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, char emboss)
|
||||
uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, eUIEmbossType emboss)
|
||||
{
|
||||
wmWindow *window = CTX_wm_window(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
@ -3529,7 +3529,7 @@ char UI_block_emboss_get(uiBlock *block)
|
|||
return block->emboss;
|
||||
}
|
||||
|
||||
void UI_block_emboss_set(uiBlock *block, char emboss)
|
||||
void UI_block_emboss_set(uiBlock *block, eUIEmbossType emboss)
|
||||
{
|
||||
block->emboss = emboss;
|
||||
}
|
||||
|
|
|
@ -220,8 +220,8 @@ struct uiBut {
|
|||
const char *disabled_info;
|
||||
|
||||
BIFIconID icon;
|
||||
/** emboss: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied from the #uiBlock.emboss */
|
||||
char emboss;
|
||||
/** Copied from the #uiBlock.emboss */
|
||||
eUIEmbossType emboss;
|
||||
/** direction in a pie menu, used for collision detection (RadialDirection) */
|
||||
signed char pie_dir;
|
||||
/** could be made into a single flag */
|
||||
|
@ -502,8 +502,8 @@ struct uiBlock {
|
|||
char direction;
|
||||
/** UI_BLOCK_THEME_STYLE_* */
|
||||
char theme_style;
|
||||
/** UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied to #uiBut.emboss */
|
||||
char emboss;
|
||||
/** Copied to #uiBut.emboss */
|
||||
eUIEmbossType emboss;
|
||||
bool auto_open;
|
||||
char _pad[5];
|
||||
double auto_open_last;
|
||||
|
|
|
@ -172,7 +172,7 @@ struct uiLayout {
|
|||
/** For layouts inside gridflow, they and their items shall never have a fixed maximal size. */
|
||||
bool variable_size;
|
||||
char alignment;
|
||||
char emboss;
|
||||
eUIEmbossType emboss;
|
||||
/** for fixed width or height to avoid UI size changes */
|
||||
float units[2];
|
||||
};
|
||||
|
@ -1189,7 +1189,7 @@ static uiBut *uiItemFullO_ptr_ex(uiLayout *layout,
|
|||
|
||||
const int w = ui_text_icon_width(layout, name, icon, 0);
|
||||
|
||||
const int prev_emboss = layout->emboss;
|
||||
const eUIEmbossType prev_emboss = layout->emboss;
|
||||
if (flag & UI_ITEM_R_NO_BG) {
|
||||
layout->emboss = UI_EMBOSS_NONE;
|
||||
}
|
||||
|
@ -2120,7 +2120,7 @@ void uiItemFullR(uiLayout *layout,
|
|||
int w, h;
|
||||
ui_item_rna_size(layout, name, icon, ptr, prop, index, icon_only, compact, &w, &h);
|
||||
|
||||
const int prev_emboss = layout->emboss;
|
||||
const eUIEmbossType prev_emboss = layout->emboss;
|
||||
if (no_bg) {
|
||||
layout->emboss = UI_EMBOSS_NONE;
|
||||
}
|
||||
|
@ -4914,7 +4914,7 @@ void uiLayoutSetUnitsY(uiLayout *layout, float unit)
|
|||
layout->units[1] = unit;
|
||||
}
|
||||
|
||||
void uiLayoutSetEmboss(uiLayout *layout, char emboss)
|
||||
void uiLayoutSetEmboss(uiLayout *layout, eUIEmbossType emboss)
|
||||
{
|
||||
layout->emboss = emboss;
|
||||
}
|
||||
|
@ -4999,7 +4999,7 @@ float uiLayoutGetUnitsY(uiLayout *layout)
|
|||
return layout->units[1];
|
||||
}
|
||||
|
||||
int uiLayoutGetEmboss(uiLayout *layout)
|
||||
eUIEmbossType uiLayoutGetEmboss(uiLayout *layout)
|
||||
{
|
||||
if (layout->emboss == UI_EMBOSS_UNDEFINED) {
|
||||
return layout->root->block->emboss;
|
||||
|
|
|
@ -264,7 +264,7 @@ typedef struct uiWidgetType {
|
|||
/* converted colors for state */
|
||||
uiWidgetColors wcol;
|
||||
|
||||
void (*state)(struct uiWidgetType *, int state, int drawflag, char emboss);
|
||||
void (*state)(struct uiWidgetType *, int state, int drawflag, eUIEmbossType emboss);
|
||||
void (*draw)(uiWidgetColors *, rcti *, int state, int roundboxalign);
|
||||
void (*custom)(uiBut *, uiWidgetColors *, rcti *, int state, int roundboxalign);
|
||||
void (*text)(const uiFontStyle *, const uiWidgetColors *, uiBut *, rcti *);
|
||||
|
@ -2521,7 +2521,7 @@ static void widget_active_color(uiWidgetColors *wcol)
|
|||
static const uchar *widget_color_blend_from_flags(const uiWidgetStateColors *wcol_state,
|
||||
int state,
|
||||
int drawflag,
|
||||
const char emboss)
|
||||
const eUIEmbossType emboss)
|
||||
{
|
||||
/* Explicitly require #UI_EMBOSS_NONE_OR_STATUS for color blending with no emboss. */
|
||||
if (emboss == UI_EMBOSS_NONE) {
|
||||
|
@ -2547,7 +2547,7 @@ static const uchar *widget_color_blend_from_flags(const uiWidgetStateColors *wco
|
|||
}
|
||||
|
||||
/* copy colors from theme, and set changes in it based on state */
|
||||
static void widget_state(uiWidgetType *wt, int state, int drawflag, char emboss)
|
||||
static void widget_state(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
|
||||
{
|
||||
uiWidgetStateColors *wcol_state = wt->wcol_state;
|
||||
|
||||
|
@ -2625,7 +2625,7 @@ static void widget_state(uiWidgetType *wt, int state, int drawflag, char emboss)
|
|||
* \{ */
|
||||
|
||||
/* sliders use special hack which sets 'item' as inner when drawing filling */
|
||||
static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag, char emboss)
|
||||
static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
|
||||
{
|
||||
uiWidgetStateColors *wcol_state = wt->wcol_state;
|
||||
|
||||
|
@ -2648,7 +2648,10 @@ static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag, ch
|
|||
}
|
||||
|
||||
/* labels use theme colors for text */
|
||||
static void widget_state_option_menu(uiWidgetType *wt, int state, int drawflag, char emboss)
|
||||
static void widget_state_option_menu(uiWidgetType *wt,
|
||||
int state,
|
||||
int drawflag,
|
||||
eUIEmbossType emboss)
|
||||
{
|
||||
const bTheme *btheme = UI_GetTheme();
|
||||
|
||||
|
@ -2668,7 +2671,7 @@ static void widget_state_option_menu(uiWidgetType *wt, int state, int drawflag,
|
|||
static void widget_state_nothing(uiWidgetType *wt,
|
||||
int UNUSED(state),
|
||||
int UNUSED(drawflag),
|
||||
char UNUSED(emboss))
|
||||
eUIEmbossType UNUSED(emboss))
|
||||
{
|
||||
wt->wcol = *(wt->wcol_theme);
|
||||
}
|
||||
|
@ -2677,7 +2680,7 @@ static void widget_state_nothing(uiWidgetType *wt,
|
|||
static void widget_state_pulldown(uiWidgetType *wt,
|
||||
int UNUSED(state),
|
||||
int UNUSED(drawflag),
|
||||
char UNUSED(emboss))
|
||||
eUIEmbossType UNUSED(emboss))
|
||||
{
|
||||
wt->wcol = *(wt->wcol_theme);
|
||||
}
|
||||
|
@ -2686,7 +2689,7 @@ static void widget_state_pulldown(uiWidgetType *wt,
|
|||
static void widget_state_pie_menu_item(uiWidgetType *wt,
|
||||
int state,
|
||||
int UNUSED(drawflag),
|
||||
char UNUSED(emboss))
|
||||
eUIEmbossType UNUSED(emboss))
|
||||
{
|
||||
wt->wcol = *(wt->wcol_theme);
|
||||
|
||||
|
@ -2721,7 +2724,7 @@ static void widget_state_pie_menu_item(uiWidgetType *wt,
|
|||
static void widget_state_menu_item(uiWidgetType *wt,
|
||||
int state,
|
||||
int UNUSED(drawflag),
|
||||
char UNUSED(emboss))
|
||||
eUIEmbossType UNUSED(emboss))
|
||||
{
|
||||
wt->wcol = *(wt->wcol_theme);
|
||||
|
||||
|
@ -4070,7 +4073,7 @@ static void widget_optionbut(uiWidgetColors *wcol,
|
|||
}
|
||||
|
||||
/* labels use Editor theme colors for text */
|
||||
static void widget_state_label(uiWidgetType *wt, int state, int drawflag, char emboss)
|
||||
static void widget_state_label(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
|
||||
{
|
||||
if (state & UI_BUT_LIST_ITEM) {
|
||||
/* Override default label theme's colors. */
|
||||
|
|
|
@ -149,6 +149,7 @@ extern StructRNA RNA_CompositorNodeDilateErode;
|
|||
extern StructRNA RNA_CompositorNodeDisplace;
|
||||
extern StructRNA RNA_CompositorNodeDistanceMatte;
|
||||
extern StructRNA RNA_CompositorNodeDoubleEdgeMask;
|
||||
extern StructRNA RNA_CompositorNodeExposure;
|
||||
extern StructRNA RNA_CompositorNodeFilter;
|
||||
extern StructRNA RNA_CompositorNodeFlip;
|
||||
extern StructRNA RNA_CompositorNodeGamma;
|
||||
|
|
|
@ -73,6 +73,7 @@ set(SRC
|
|||
composite/nodes/node_composite_distanceMatte.c
|
||||
composite/nodes/node_composite_doubleEdgeMask.c
|
||||
composite/nodes/node_composite_ellipsemask.c
|
||||
composite/nodes/node_composite_exposure.c
|
||||
composite/nodes/node_composite_filter.c
|
||||
composite/nodes/node_composite_flip.c
|
||||
composite/nodes/node_composite_gamma.c
|
||||
|
|
|
@ -56,6 +56,7 @@ void register_node_type_cmp_mix_rgb(void);
|
|||
void register_node_type_cmp_hue_sat(void);
|
||||
void register_node_type_cmp_brightcontrast(void);
|
||||
void register_node_type_cmp_gamma(void);
|
||||
void register_node_type_cmp_exposure(void);
|
||||
void register_node_type_cmp_invert(void);
|
||||
void register_node_type_cmp_alphaover(void);
|
||||
void register_node_type_cmp_zcombine(void);
|
||||
|
|
|
@ -222,6 +222,7 @@ DefNode(CompositorNode, CMP_NODE_CORNERPIN, 0, "CORNER
|
|||
DefNode(CompositorNode, CMP_NODE_SUNBEAMS, def_cmp_sunbeams, "SUNBEAMS", SunBeams, "Sun Beams", "" )
|
||||
DefNode(CompositorNode, CMP_NODE_CRYPTOMATTE, def_cmp_cryptomatte, "CRYPTOMATTE", Cryptomatte, "Cryptomatte", "" )
|
||||
DefNode(CompositorNode, CMP_NODE_DENOISE, def_cmp_denoise, "DENOISE", Denoise, "Denoise", "" )
|
||||
DefNode(CompositorNode, CMP_NODE_EXPOSURE, 0, "EXPOSURE", Exposure, "Exposure", "" )
|
||||
|
||||
DefNode(TextureNode, TEX_NODE_OUTPUT, def_tex_output, "OUTPUT", Output, "Output", "" )
|
||||
DefNode(TextureNode, TEX_NODE_CHECKER, 0, "CHECKER", Checker, "Checker", "" )
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2020 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** Exposure ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_exposure_in[] = {
|
||||
{SOCK_RGBA, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{SOCK_FLOAT, N_("Exposure"), 0.0f, 0.0f, 0.0f, 0.0f, -10.0f, 10.0f, PROP_NONE},
|
||||
{-1, ""},
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_exposure_out[] = {
|
||||
{SOCK_RGBA, N_("Image")},
|
||||
{-1, ""},
|
||||
};
|
||||
|
||||
void register_node_type_cmp_exposure(void)
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_EXPOSURE, "Exposure", NODE_CLASS_OP_COLOR, 0);
|
||||
node_type_socket_templates(&ntype, cmp_node_exposure_in, cmp_node_exposure_out);
|
||||
|
||||
nodeRegisterType(&ntype);
|
||||
}
|
Loading…
Reference in New Issue