2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-12-24 10:33:10 +00:00
|
|
|
* 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
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2008-12-24 10:33:10 +00:00
|
|
|
*
|
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-24 10:33:10 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2005 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup spnode
|
|
|
|
* \brief lower level node drawing for nodes (boarders, headers etc), also node layout.
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
#include "BLI_blenlib.h"
|
2009-11-10 20:43:45 +00:00
|
|
|
#include "BLI_math.h"
|
2019-08-27 08:13:23 -06:00
|
|
|
#include "BLI_system.h"
|
2008-12-24 10:33:10 +00:00
|
|
|
|
|
|
|
#include "DNA_node_types.h"
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
#include "DNA_screen_types.h"
|
2014-04-05 12:49:04 +02:00
|
|
|
#include "DNA_userdef_types.h"
|
2015-01-29 21:56:32 +11:00
|
|
|
#include "DNA_text_types.h"
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2008-12-29 00:55:23 +00:00
|
|
|
#include "BKE_context.h"
|
2009-02-07 14:03:34 +00:00
|
|
|
#include "BKE_curve.h"
|
2008-12-24 10:33:10 +00:00
|
|
|
#include "BKE_image.h"
|
|
|
|
#include "BKE_main.h"
|
2011-09-05 21:01:50 +00:00
|
|
|
#include "BKE_node.h"
|
2012-06-19 17:29:58 +00:00
|
|
|
#include "BKE_tracking.h"
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2012-05-22 14:13:33 +00:00
|
|
|
#include "BLF_api.h"
|
2015-08-16 17:32:01 +10:00
|
|
|
#include "BLT_translation.h"
|
2012-05-22 14:13:33 +00:00
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
#include "BIF_glutil.h"
|
|
|
|
|
2016-10-14 23:45:55 -04:00
|
|
|
#include "GPU_draw.h"
|
2018-04-05 15:41:17 +02:00
|
|
|
#include "GPU_batch.h"
|
2018-07-15 10:34:31 +02:00
|
|
|
#include "GPU_batch_presets.h"
|
2016-10-14 23:45:55 -04:00
|
|
|
#include "GPU_immediate.h"
|
2017-03-21 17:49:21 -04:00
|
|
|
#include "GPU_matrix.h"
|
2018-06-27 19:07:23 -06:00
|
|
|
#include "GPU_state.h"
|
2016-10-14 23:45:55 -04:00
|
|
|
|
2008-12-29 00:55:23 +00:00
|
|
|
#include "RNA_access.h"
|
2013-03-18 16:34:57 +00:00
|
|
|
#include "RNA_define.h"
|
2008-12-29 00:55:23 +00:00
|
|
|
|
2010-11-06 17:55:43 +00:00
|
|
|
#include "ED_node.h"
|
2019-04-23 09:15:45 -06:00
|
|
|
#include "ED_space_api.h"
|
2010-11-06 17:55:43 +00:00
|
|
|
|
2008-12-29 00:55:23 +00:00
|
|
|
#include "WM_api.h"
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
#include "UI_resources.h"
|
2016-10-14 23:45:55 -04:00
|
|
|
#include "UI_view2d.h"
|
2008-12-24 10:33:10 +00:00
|
|
|
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
#include "IMB_colormanagement.h"
|
2008-12-26 18:00:38 +00:00
|
|
|
#include "IMB_imbuf_types.h"
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
#include "node_intern.h" /* own include */
|
2013-03-18 16:34:57 +00:00
|
|
|
#include "NOD_composite.h"
|
|
|
|
#include "NOD_shader.h"
|
|
|
|
#include "NOD_texture.h"
|
2008-12-29 00:55:23 +00:00
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
/* ****************** SOCKET BUTTON DRAW FUNCTIONS ***************** */
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_socket_button_label(bContext *UNUSED(C),
|
|
|
|
uiLayout *layout,
|
|
|
|
PointerRNA *UNUSED(ptr),
|
|
|
|
PointerRNA *UNUSED(node_ptr),
|
2013-05-08 14:58:41 +00:00
|
|
|
const char *text)
|
2011-09-05 21:01:50 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemL(layout, text, 0);
|
2012-05-02 07:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
/* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_value(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
/* first output stores value */
|
|
|
|
bNodeSocket *output = node->outputs.first;
|
|
|
|
PointerRNA sockptr;
|
2019-08-23 09:52:12 +02:00
|
|
|
RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, &sockptr, "default_value", 0, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
/* first output stores value */
|
|
|
|
bNodeSocket *output = node->outputs.first;
|
|
|
|
PointerRNA sockptr;
|
|
|
|
uiLayout *col;
|
2019-08-23 09:52:12 +02:00
|
|
|
RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiTemplateColorPicker(col, &sockptr, "default_value", 1, 0, 0, 0);
|
|
|
|
uiItemR(col, &sockptr, "default_value", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_mix_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row, *col;
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-08-23 09:52:12 +02:00
|
|
|
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
row = uiLayoutRow(col, true);
|
|
|
|
uiItemR(row, ptr, "blend_type", 0, "", ICON_NONE);
|
|
|
|
if (ELEM(ntree->type, NTREE_COMPOSIT, NTREE_TEXTURE)) {
|
|
|
|
uiItemR(row, ptr, "use_alpha", 0, "", ICON_IMAGE_RGB_ALPHA);
|
|
|
|
}
|
2012-07-10 09:12:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(col, ptr, "use_clamp", 0, NULL, ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_time(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row;
|
2009-09-16 18:59:13 +00:00
|
|
|
#if 0
|
2019-04-17 06:17:24 +02:00
|
|
|
/* XXX no context access here .. */
|
|
|
|
bNode *node = ptr->data;
|
|
|
|
CurveMapping *cumap = node->storage;
|
|
|
|
|
|
|
|
if (cumap) {
|
|
|
|
cumap->flag |= CUMA_DRAW_CFRA;
|
2019-05-31 23:21:16 +10:00
|
|
|
if (node->custom1 < node->custom2) {
|
2019-04-17 06:17:24 +02:00
|
|
|
cumap->sample[0] = (float)(CFRA - node->custom1) / (float)(node->custom2 - node->custom1);
|
2019-05-31 23:21:16 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2009-09-16 18:59:13 +00:00
|
|
|
#endif
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateCurveMapping(layout, ptr, "curve", 's', false, false, false, false);
|
2009-09-16 18:59:13 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "frame_start", 0, IFACE_("Sta"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "frame_end", 0, IFACE_("End"), ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_colorramp(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateColorRamp(layout, ptr, "color_ramp", 0);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_curvevec(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateCurveMapping(layout, ptr, "mapping", 'v', false, false, false, false);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2012-06-21 14:12:14 +00:00
|
|
|
#define SAMPLE_FLT_ISNONE FLT_MAX
|
2019-01-15 23:24:20 +11:00
|
|
|
/* bad bad, 2.5 will do better?... no it won't... */
|
|
|
|
static float _sample_col[4] = {SAMPLE_FLT_ISNONE};
|
2012-06-21 14:12:14 +00:00
|
|
|
void ED_node_sample_set(const float col[4])
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
if (col) {
|
|
|
|
copy_v4_v4(_sample_col, col);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
copy_v4_fl(_sample_col, SAMPLE_FLT_ISNONE);
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_curvecol(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
CurveMapping *cumap = node->storage;
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (_sample_col[0] != SAMPLE_FLT_ISNONE) {
|
|
|
|
cumap->flag |= CUMA_DRAW_SAMPLE;
|
|
|
|
copy_v3_v3(cumap->sample, _sample_col);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
cumap->flag &= ~CUMA_DRAW_SAMPLE;
|
|
|
|
}
|
2009-09-16 18:59:13 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateCurveMapping(layout, ptr, "mapping", 'c', false, false, false, true);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_normal(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
/* first output stores normal */
|
|
|
|
bNodeSocket *output = node->outputs.first;
|
|
|
|
PointerRNA sockptr;
|
2019-08-23 09:52:12 +02:00
|
|
|
RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, &sockptr, "default_value", 0, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
2013-03-18 16:34:57 +00:00
|
|
|
|
2012-07-09 23:07:15 +00:00
|
|
|
#if 0 /* not used in 2.5x yet */
|
2008-12-29 00:55:23 +00:00
|
|
|
static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
Main *bmain = CTX_data_main(C);
|
|
|
|
bNodeTree *ntree = ntree_v;
|
|
|
|
bNode *node = node_v;
|
|
|
|
Tex *tex;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-05-31 23:21:16 +10:00
|
|
|
if (node->menunr < 1) {
|
2019-04-17 08:24:14 +02:00
|
|
|
return;
|
2019-05-31 23:21:16 +10:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (node->id) {
|
|
|
|
id_us_min(node->id);
|
|
|
|
node->id = NULL;
|
|
|
|
}
|
|
|
|
tex = BLI_findlink(&bmain->tex, node->menunr - 1);
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
node->id = &tex->id;
|
|
|
|
id_us_plus(node->id);
|
|
|
|
BLI_strncpy(node->name, node->id->name + 2, sizeof(node->name));
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
nodeSetActive(ntree, node);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-05-31 23:21:16 +10:00
|
|
|
if (ntree->type == NTREE_TEXTURE) {
|
2019-04-17 06:17:24 +02:00
|
|
|
ntreeTexCheckCyclics(ntree);
|
2019-05-31 23:21:16 +10:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
// allqueue(REDRAWBUTSSHADING, 0);
|
|
|
|
// allqueue(REDRAWNODE, 0);
|
|
|
|
NodeTagChanged(ntree, node);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
node->menunr = 0;
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
2009-11-06 22:51:08 +00:00
|
|
|
#endif
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_texture(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
2009-09-16 18:59:13 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
short multi = (node->id && ((Tex *)node->id)->use_nodes && (node->type != CMP_NODE_TEXTURE) &&
|
|
|
|
(node->type != TEX_NODE_TEXTURE));
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "texture", 0, "", ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (multi) {
|
|
|
|
/* Number Drawing not optimal here, better have a list*/
|
|
|
|
uiItemR(layout, ptr, "node_output", 0, "", ICON_NONE);
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2019-08-14 10:53:19 +02:00
|
|
|
static void node_buts_map_range(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
uiItemR(layout, ptr, "clamp", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_buts_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "operation", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "use_clamp", 0, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2011-09-05 21:01:50 +00:00
|
|
|
static int node_resize_area_default(bNode *node, int x, int y)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
if (node->flag & NODE_HIDDEN) {
|
|
|
|
rctf totr = node->totr;
|
|
|
|
/* right part of node */
|
|
|
|
totr.xmin = node->totr.xmax - 20.0f;
|
|
|
|
if (BLI_rctf_isect_pt(&totr, x, y)) {
|
|
|
|
return NODE_RESIZE_RIGHT;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
const float size = NODE_RESIZE_MARGIN;
|
|
|
|
rctf totr = node->totr;
|
|
|
|
int dir = 0;
|
|
|
|
|
|
|
|
if (x >= totr.xmax - size && x < totr.xmax && y >= totr.ymin && y < totr.ymax) {
|
|
|
|
dir |= NODE_RESIZE_RIGHT;
|
|
|
|
}
|
|
|
|
if (x >= totr.xmin && x < totr.xmin + size && y >= totr.ymin && y < totr.ymax) {
|
|
|
|
dir |= NODE_RESIZE_LEFT;
|
|
|
|
}
|
|
|
|
return dir;
|
|
|
|
}
|
2011-09-05 21:01:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ****************** BUTTON CALLBACKS FOR COMMON NODES ***************** */
|
|
|
|
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_draw_buttons_group(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2011-11-04 13:31:15 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateIDBrowse(layout, C, ptr, "node_tree", NULL, NULL, NULL, UI_TEMPLATE_ID_FILTER_ALL);
|
2011-11-04 13:31:15 +00:00
|
|
|
}
|
|
|
|
|
2012-05-22 14:13:33 +00:00
|
|
|
/* XXX Does a bounding box update by iterating over all children.
|
|
|
|
* Not ideal to do this in every draw call, but doing as transform callback doesn't work,
|
|
|
|
* since the child node totr rects are not updated properly at that point.
|
|
|
|
*/
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_draw_frame_prepare(const bContext *UNUSED(C), bNodeTree *ntree, bNode *node)
|
2012-05-22 14:13:33 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
const float margin = 1.5f * U.widget_unit;
|
|
|
|
NodeFrame *data = (NodeFrame *)node->storage;
|
|
|
|
bool bbinit;
|
|
|
|
bNode *tnode;
|
|
|
|
rctf rect, noderect;
|
|
|
|
float xmax, ymax;
|
|
|
|
|
|
|
|
/* init rect from current frame size */
|
|
|
|
node_to_view(node, node->offsetx, node->offsety, &rect.xmin, &rect.ymax);
|
|
|
|
node_to_view(
|
|
|
|
node, node->offsetx + node->width, node->offsety - node->height, &rect.xmax, &rect.ymin);
|
|
|
|
|
|
|
|
/* frame can be resized manually only if shrinking is disabled or no children are attached */
|
|
|
|
data->flag |= NODE_FRAME_RESIZEABLE;
|
|
|
|
/* for shrinking bbox, initialize the rect from first child node */
|
|
|
|
bbinit = (data->flag & NODE_FRAME_SHRINK);
|
|
|
|
/* fit bounding box to all children */
|
|
|
|
for (tnode = ntree->nodes.first; tnode; tnode = tnode->next) {
|
|
|
|
if (tnode->parent != node) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* add margin to node rect */
|
|
|
|
noderect = tnode->totr;
|
|
|
|
noderect.xmin -= margin;
|
|
|
|
noderect.xmax += margin;
|
|
|
|
noderect.ymin -= margin;
|
|
|
|
noderect.ymax += margin;
|
|
|
|
|
|
|
|
/* first child initializes frame */
|
|
|
|
if (bbinit) {
|
|
|
|
bbinit = 0;
|
|
|
|
rect = noderect;
|
|
|
|
data->flag &= ~NODE_FRAME_RESIZEABLE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BLI_rctf_union(&rect, &noderect);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now adjust the frame size from view-space bounding box */
|
|
|
|
node_from_view(node, rect.xmin, rect.ymax, &node->offsetx, &node->offsety);
|
|
|
|
node_from_view(node, rect.xmax, rect.ymin, &xmax, &ymax);
|
|
|
|
node->width = xmax - node->offsetx;
|
|
|
|
node->height = -ymax + node->offsety;
|
|
|
|
|
|
|
|
node->totr = rect;
|
2012-05-22 14:13:33 +00:00
|
|
|
}
|
|
|
|
|
2013-11-12 18:18:04 +00:00
|
|
|
static void node_draw_frame_label(bNodeTree *ntree, bNode *node, const float aspect)
|
2011-09-05 21:01:50 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
/* XXX font id is crap design */
|
|
|
|
const int fontid = UI_style_get()->widgetlabel.uifont_id;
|
|
|
|
NodeFrame *data = (NodeFrame *)node->storage;
|
|
|
|
rctf *rct = &node->totr;
|
|
|
|
int color_id = node_get_colorid(node);
|
|
|
|
char label[MAX_NAME];
|
|
|
|
/* XXX a bit hacky, should use separate align values for x and y */
|
|
|
|
float width, ascender;
|
|
|
|
float x, y;
|
|
|
|
const int font_size = data->label_size / aspect;
|
|
|
|
const float margin = (float)(NODE_DY / 4);
|
|
|
|
int label_height;
|
|
|
|
unsigned char color[3];
|
|
|
|
|
|
|
|
nodeLabel(ntree, node, label, sizeof(label));
|
|
|
|
|
|
|
|
BLF_enable(fontid, BLF_ASPECT);
|
|
|
|
BLF_aspect(fontid, aspect, aspect, 1.0f);
|
|
|
|
/* clamp otherwise it can suck up a LOT of memory */
|
|
|
|
BLF_size(fontid, MIN2(24, font_size), U.dpi);
|
|
|
|
|
|
|
|
/* title color */
|
|
|
|
UI_GetThemeColorBlendShade3ubv(TH_TEXT, color_id, 0.4f, 10, color);
|
|
|
|
BLF_color3ubv(fontid, color);
|
|
|
|
|
|
|
|
width = BLF_width(fontid, label, sizeof(label));
|
|
|
|
ascender = BLF_ascender(fontid);
|
|
|
|
label_height = ((margin / aspect) + (ascender * aspect));
|
|
|
|
|
|
|
|
/* 'x' doesn't need aspect correction */
|
|
|
|
x = BLI_rctf_cent_x(rct) - (0.5f * width);
|
|
|
|
y = rct->ymax - label_height;
|
|
|
|
|
|
|
|
BLF_position(fontid, x, y, 0);
|
|
|
|
BLF_draw(fontid, label, BLF_DRAW_STR_DUMMY_MAX);
|
|
|
|
|
|
|
|
/* draw text body */
|
|
|
|
if (node->id) {
|
|
|
|
Text *text = (Text *)node->id;
|
|
|
|
TextLine *line;
|
|
|
|
const int line_height_max = BLF_height_max(fontid);
|
|
|
|
const float line_spacing = (line_height_max * aspect);
|
|
|
|
const float line_width = (BLI_rctf_size_x(rct) - margin) / aspect;
|
|
|
|
int y_min;
|
|
|
|
|
|
|
|
/* 'x' doesn't need aspect correction */
|
|
|
|
x = rct->xmin + margin;
|
|
|
|
y = rct->ymax - (label_height + line_spacing);
|
|
|
|
/* early exit */
|
|
|
|
y_min = y + ((margin * 2) - (y - rct->ymin));
|
|
|
|
|
|
|
|
BLF_enable(fontid, BLF_CLIPPING | BLF_WORD_WRAP);
|
|
|
|
BLF_clipping(fontid,
|
|
|
|
rct->xmin,
|
|
|
|
/* round to avoid clipping half-way through a line */
|
|
|
|
y - (floorf(((y - rct->ymin) - (margin * 2)) / line_spacing) * line_spacing),
|
|
|
|
rct->xmin + line_width,
|
|
|
|
rct->ymax);
|
|
|
|
|
|
|
|
BLF_wordwrap(fontid, line_width);
|
|
|
|
|
|
|
|
for (line = text->lines.first; line; line = line->next) {
|
|
|
|
struct ResultBLF info;
|
|
|
|
if (line->line[0]) {
|
|
|
|
BLF_position(fontid, x, y, 0);
|
|
|
|
BLF_draw_ex(fontid, line->line, line->len, &info);
|
|
|
|
y -= line_spacing * info.lines;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
y -= line_spacing;
|
|
|
|
}
|
|
|
|
if (y < y_min) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BLF_disable(fontid, BLF_CLIPPING | BLF_WORD_WRAP);
|
|
|
|
}
|
|
|
|
|
|
|
|
BLF_disable(fontid, BLF_ASPECT);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void node_draw_frame(const bContext *C,
|
|
|
|
ARegion *ar,
|
|
|
|
SpaceNode *snode,
|
|
|
|
bNodeTree *ntree,
|
|
|
|
bNode *node,
|
|
|
|
bNodeInstanceKey UNUSED(key))
|
|
|
|
{
|
|
|
|
rctf *rct = &node->totr;
|
|
|
|
int color_id = node_get_colorid(node);
|
|
|
|
float color[4];
|
|
|
|
float alpha;
|
|
|
|
|
|
|
|
/* skip if out of view */
|
|
|
|
if (BLI_rctf_isect(&node->totr, &ar->v2d.cur, NULL) == false) {
|
|
|
|
UI_block_end(C, node->block);
|
|
|
|
node->block = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
UI_GetThemeColor4fv(TH_NODE_FRAME, color);
|
|
|
|
alpha = color[3];
|
|
|
|
|
|
|
|
/* shadow */
|
|
|
|
node_draw_shadow(snode, node, BASIS_RAD, alpha);
|
|
|
|
|
|
|
|
/* body */
|
|
|
|
if (node->flag & NODE_CUSTOM_COLOR) {
|
|
|
|
rgba_float_args_set(color, node->color[0], node->color[1], node->color[2], alpha);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
UI_GetThemeColor4fv(TH_NODE_FRAME, color);
|
|
|
|
}
|
|
|
|
|
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_ALL);
|
|
|
|
UI_draw_roundbox_aa(true, rct->xmin, rct->ymin, rct->xmax, rct->ymax, BASIS_RAD, color);
|
|
|
|
|
|
|
|
/* outline active and selected emphasis */
|
|
|
|
if (node->flag & SELECT) {
|
|
|
|
if (node->flag & NODE_ACTIVE) {
|
|
|
|
UI_GetThemeColorShadeAlpha4fv(TH_ACTIVE, 0, -40, color);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
UI_GetThemeColorShadeAlpha4fv(TH_SELECT, 0, -40, color);
|
|
|
|
}
|
|
|
|
|
|
|
|
UI_draw_roundbox_aa(false, rct->xmin, rct->ymin, rct->xmax, rct->ymax, BASIS_RAD, color);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* label */
|
|
|
|
node_draw_frame_label(ntree, node, snode->aspect);
|
|
|
|
|
|
|
|
UI_ThemeClearColor(color_id);
|
|
|
|
|
|
|
|
UI_block_end(C, node->block);
|
|
|
|
UI_block_draw(C, node->block);
|
|
|
|
node->block = NULL;
|
2012-05-22 14:13:33 +00:00
|
|
|
}
|
2011-09-05 21:01:50 +00:00
|
|
|
|
2012-05-22 14:13:33 +00:00
|
|
|
static int node_resize_area_frame(bNode *node, int x, int y)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
const float size = 10.0f;
|
|
|
|
NodeFrame *data = (NodeFrame *)node->storage;
|
|
|
|
rctf totr = node->totr;
|
|
|
|
int dir = 0;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
/* shrinking frame size is determined by child nodes */
|
|
|
|
if (!(data->flag & NODE_FRAME_RESIZEABLE)) {
|
|
|
|
return 0;
|
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (x >= totr.xmax - size && x < totr.xmax && y >= totr.ymin && y < totr.ymax) {
|
|
|
|
dir |= NODE_RESIZE_RIGHT;
|
|
|
|
}
|
|
|
|
if (x >= totr.xmin && x < totr.xmin + size && y >= totr.ymin && y < totr.ymax) {
|
|
|
|
dir |= NODE_RESIZE_LEFT;
|
|
|
|
}
|
|
|
|
if (x >= totr.xmin && x < totr.xmax && y >= totr.ymax - size && y < totr.ymax) {
|
|
|
|
dir |= NODE_RESIZE_TOP;
|
|
|
|
}
|
|
|
|
if (x >= totr.xmin && x < totr.xmax && y >= totr.ymin && y < totr.ymin + size) {
|
|
|
|
dir |= NODE_RESIZE_BOTTOM;
|
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
return dir;
|
2012-05-22 14:13:33 +00:00
|
|
|
}
|
2011-09-05 21:01:50 +00:00
|
|
|
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_buts_frame_ex(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2012-05-22 14:13:33 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "label_size", 0, IFACE_("Label Size"), ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "shrink", 0, IFACE_("Shrink"), ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "text", 0, NULL, ICON_NONE);
|
2011-09-05 21:01:50 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
#define NODE_REROUTE_SIZE 8.0f
|
2012-06-01 12:38:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_draw_reroute_prepare(const bContext *UNUSED(C),
|
|
|
|
bNodeTree *UNUSED(ntree),
|
|
|
|
bNode *node)
|
2012-06-01 12:38:03 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNodeSocket *nsock;
|
|
|
|
float locx, locy;
|
|
|
|
float size = NODE_REROUTE_SIZE;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
/* get "global" coords */
|
|
|
|
node_to_view(node, 0.0f, 0.0f, &locx, &locy);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
/* reroute node has exactly one input and one output, both in the same place */
|
|
|
|
nsock = node->outputs.first;
|
|
|
|
nsock->locx = locx;
|
|
|
|
nsock->locy = locy;
|
2012-06-01 12:38:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
nsock = node->inputs.first;
|
|
|
|
nsock->locx = locx;
|
|
|
|
nsock->locy = locy;
|
2012-07-09 23:07:15 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
node->width = size * 2;
|
|
|
|
node->totr.xmin = locx - size;
|
|
|
|
node->totr.xmax = locx + size;
|
|
|
|
node->totr.ymax = locy + size;
|
|
|
|
node->totr.ymin = locy - size;
|
2012-06-01 12:38:03 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_draw_reroute(const bContext *C,
|
|
|
|
ARegion *ar,
|
|
|
|
SpaceNode *UNUSED(snode),
|
|
|
|
bNodeTree *ntree,
|
|
|
|
bNode *node,
|
|
|
|
bNodeInstanceKey UNUSED(key))
|
2012-06-01 12:38:03 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
char showname[128]; /* 128 used below */
|
|
|
|
rctf *rct = &node->totr;
|
2013-01-22 21:35:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
/* skip if out of view */
|
|
|
|
if (node->totr.xmax < ar->v2d.cur.xmin || node->totr.xmin > ar->v2d.cur.xmax ||
|
|
|
|
node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax) {
|
|
|
|
UI_block_end(C, node->block);
|
|
|
|
node->block = NULL;
|
|
|
|
return;
|
|
|
|
}
|
2012-06-01 12:38:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
/* XXX only kept for debugging
|
|
|
|
* selection state is indicated by socket outline below!
|
|
|
|
*/
|
2012-06-17 09:58:26 +00:00
|
|
|
#if 0
|
2019-04-17 06:17:24 +02:00
|
|
|
float size = NODE_REROUTE_SIZE;
|
|
|
|
|
|
|
|
/* body */
|
|
|
|
float debug_color[4];
|
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_ALL);
|
|
|
|
UI_GetThemeColor4fv(TH_NODE, debug_color);
|
|
|
|
UI_draw_roundbox_aa(true, rct->xmin, rct->ymin, rct->xmax, rct->ymax, size, debug_color);
|
|
|
|
|
|
|
|
/* outline active and selected emphasis */
|
|
|
|
if (node->flag & SELECT) {
|
|
|
|
GPU_blend(true);
|
|
|
|
GPU_line_smooth(true);
|
|
|
|
/* using different shades of TH_TEXT_HI for the empasis, like triangle */
|
|
|
|
if (node->flag & NODE_ACTIVE) {
|
|
|
|
UI_GetThemeColorShadeAlpha4fv(TH_TEXT_HI, 0, -40, debug_color);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
UI_GetThemeColorShadeAlpha4fv(TH_TEXT_HI, -20, -120, debug_color);
|
|
|
|
}
|
|
|
|
UI_draw_roundbox_4fv(false, rct->xmin, rct->ymin, rct->xmax, rct->ymax, size, debug_color);
|
|
|
|
|
|
|
|
GPU_line_smooth(false);
|
|
|
|
GPU_blend(false);
|
|
|
|
}
|
2012-06-17 09:58:26 +00:00
|
|
|
#endif
|
2012-06-01 12:38:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (node->label[0] != '\0') {
|
|
|
|
/* draw title (node label) */
|
|
|
|
BLI_strncpy(showname, node->label, sizeof(showname));
|
|
|
|
uiDefBut(node->block,
|
|
|
|
UI_BTYPE_LABEL,
|
|
|
|
0,
|
|
|
|
showname,
|
|
|
|
(int)(rct->xmin - NODE_DYS),
|
|
|
|
(int)(rct->ymax),
|
|
|
|
(short)512,
|
|
|
|
(short)NODE_DY,
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* only draw input socket. as they all are placed on the same position.
|
|
|
|
* highlight also if node itself is selected, since we don't display the node body separately!
|
|
|
|
*/
|
|
|
|
node_draw_sockets(&ar->v2d, C, ntree, node, false, node->flag & SELECT);
|
|
|
|
|
|
|
|
UI_block_end(C, node->block);
|
|
|
|
UI_block_draw(C, node->block);
|
|
|
|
node->block = NULL;
|
2012-06-01 12:38:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Special tweak area for reroute node.
|
|
|
|
* Since this node is quite small, we use a larger tweak area for grabbing than for selection.
|
|
|
|
*/
|
|
|
|
static int node_tweak_area_reroute(bNode *node, int x, int y)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
/* square of tweak radius */
|
|
|
|
const float tweak_radius_sq = SQUARE(24);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
bNodeSocket *sock = node->inputs.first;
|
|
|
|
float dx = sock->locx - x;
|
|
|
|
float dy = sock->locy - y;
|
|
|
|
return (dx * dx + dy * dy <= tweak_radius_sq);
|
2012-06-01 12:38:03 +00:00
|
|
|
}
|
|
|
|
|
2011-09-05 21:01:50 +00:00
|
|
|
static void node_common_set_butfunc(bNodeType *ntype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
switch (ntype->type) {
|
|
|
|
case NODE_GROUP:
|
|
|
|
ntype->draw_buttons = node_draw_buttons_group;
|
|
|
|
break;
|
|
|
|
case NODE_FRAME:
|
|
|
|
ntype->draw_nodetype = node_draw_frame;
|
|
|
|
ntype->draw_nodetype_prepare = node_draw_frame_prepare;
|
|
|
|
ntype->draw_buttons_ex = node_buts_frame_ex;
|
|
|
|
ntype->resize_area_func = node_resize_area_frame;
|
|
|
|
break;
|
|
|
|
case NODE_REROUTE:
|
|
|
|
ntype->draw_nodetype = node_draw_reroute;
|
|
|
|
ntype->draw_nodetype_prepare = node_draw_reroute_prepare;
|
|
|
|
ntype->tweak_area_func = node_tweak_area_reroute;
|
|
|
|
break;
|
|
|
|
}
|
2011-09-05 21:01:50 +00:00
|
|
|
}
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
/* ****************** BUTTON CALLBACKS FOR SHADER NODES ***************** */
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_buts_image_user(uiLayout *layout,
|
|
|
|
bContext *C,
|
|
|
|
PointerRNA *ptr,
|
|
|
|
PointerRNA *imaptr,
|
|
|
|
PointerRNA *iuserptr,
|
2018-01-26 08:39:38 +01:00
|
|
|
bool compositor)
|
2012-06-04 19:38:33 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
|
|
|
int source;
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (!imaptr->data) {
|
|
|
|
return;
|
|
|
|
}
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(col, imaptr, "source", 0, "", ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
source = RNA_enum_get(imaptr, "source");
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (source == IMA_SRC_SEQUENCE) {
|
|
|
|
/* don't use iuser->framenr directly
|
|
|
|
* because it may not be updated if auto-refresh is off */
|
|
|
|
Scene *scene = CTX_data_scene(C);
|
|
|
|
ImageUser *iuser = iuserptr->data;
|
|
|
|
/* Image *ima = imaptr->data; */ /* UNUSED */
|
2014-01-20 18:54:03 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
char numstr[32];
|
|
|
|
const int framenr = BKE_image_user_frame_get(iuser, CFRA, NULL);
|
|
|
|
BLI_snprintf(numstr, sizeof(numstr), IFACE_("Frame: %d"), framenr);
|
|
|
|
uiItemL(layout, numstr, ICON_NONE);
|
|
|
|
}
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (ELEM(source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
|
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "frame_duration", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "frame_start", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "frame_offset", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "use_cyclic", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "use_auto_refresh", 0, NULL, ICON_NONE);
|
|
|
|
}
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (compositor && RNA_enum_get(imaptr, "type") == IMA_TYPE_MULTILAYER &&
|
|
|
|
RNA_boolean_get(ptr, "has_layers")) {
|
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "layer", 0, NULL, ICON_NONE);
|
|
|
|
}
|
2019-04-23 13:56:30 +02:00
|
|
|
|
|
|
|
uiLayout *split = uiLayoutSplit(layout, 0.5f, true);
|
|
|
|
PointerRNA colorspace_settings_ptr = RNA_pointer_get(imaptr, "colorspace_settings");
|
|
|
|
uiItemL(split, IFACE_("Color Space"), ICON_NONE);
|
|
|
|
uiItemR(split, &colorspace_settings_ptr, "name", 0, "", ICON_NONE);
|
2019-05-22 10:06:31 +02:00
|
|
|
|
|
|
|
/* Avoid losing changes image is painted. */
|
|
|
|
if (BKE_image_is_dirty(imaptr->data)) {
|
|
|
|
uiLayoutSetEnabled(split, false);
|
|
|
|
}
|
2012-06-04 19:38:33 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row, *col, *sub;
|
2014-02-04 13:21:30 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "vector_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
2013-09-25 20:28:49 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, false);
|
2014-02-04 13:21:30 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(row, true);
|
|
|
|
uiItemL(col, IFACE_("Location:"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "translation", 0, "", ICON_NONE);
|
2014-02-04 13:21:30 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(row, true);
|
|
|
|
uiItemL(col, IFACE_("Rotation:"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "rotation", 0, "", ICON_NONE);
|
2014-02-04 13:21:30 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(row, true);
|
|
|
|
uiItemL(col, IFACE_("Scale:"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "scale", 0, "", ICON_NONE);
|
2014-02-04 13:21:30 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, false);
|
2014-02-04 13:21:30 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(row, true);
|
|
|
|
uiItemR(col, ptr, "use_min", 0, IFACE_("Min"), ICON_NONE);
|
|
|
|
sub = uiLayoutColumn(col, true);
|
|
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min"));
|
|
|
|
uiItemR(sub, ptr, "min", 0, "", ICON_NONE);
|
2014-02-04 13:21:30 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(row, true);
|
|
|
|
uiItemR(col, ptr, "use_max", 0, IFACE_("Max"), ICON_NONE);
|
|
|
|
sub = uiLayoutColumn(col, true);
|
|
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max"));
|
|
|
|
uiItemR(sub, ptr, "max", 0, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_shader_buts_vect_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "operation", 0, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2013-07-31 21:18:23 +00:00
|
|
|
static void node_shader_buts_vect_transform(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "vector_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "convert_from", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "convert_to", 0, "", ICON_NONE);
|
2013-07-31 21:18:23 +00:00
|
|
|
}
|
|
|
|
|
2011-11-08 11:38:16 +00:00
|
|
|
static void node_shader_buts_attribute(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "attribute_name", 0, IFACE_("Name"), ICON_NONE);
|
2011-11-08 11:38:16 +00:00
|
|
|
}
|
|
|
|
|
2013-05-20 15:58:37 +00:00
|
|
|
static void node_shader_buts_wireframe(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_pixel_size", 0, NULL, 0);
|
2013-05-20 15:58:37 +00:00
|
|
|
}
|
|
|
|
|
2011-11-08 11:38:16 +00:00
|
|
|
static void node_shader_buts_tex_image(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
PointerRNA imaptr = RNA_pointer_get(ptr, "image");
|
|
|
|
PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user");
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
|
|
|
|
uiTemplateID(layout,
|
|
|
|
C,
|
|
|
|
ptr,
|
|
|
|
"image",
|
|
|
|
"IMAGE_OT_new",
|
|
|
|
"IMAGE_OT_open",
|
|
|
|
NULL,
|
|
|
|
UI_TEMPLATE_ID_FILTER_ALL,
|
|
|
|
false);
|
|
|
|
uiItemR(layout, ptr, "interpolation", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "projection", 0, "", ICON_NONE);
|
2012-09-04 13:29:07 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "projection") == SHD_PROJ_BOX) {
|
|
|
|
uiItemR(layout, ptr, "projection_blend", 0, "Blend", ICON_NONE);
|
|
|
|
}
|
2011-11-08 11:38:16 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "extension", 0, "", ICON_NONE);
|
2015-07-21 22:09:52 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
/* note: image user properties used directly here, unlike compositor image node,
|
|
|
|
* which redefines them in the node struct RNA to get proper updates.
|
|
|
|
*/
|
|
|
|
node_buts_image_user(layout, C, &iuserptr, &imaptr, &iuserptr, false);
|
2012-06-04 19:38:33 +00:00
|
|
|
}
|
2012-03-08 19:52:58 +00:00
|
|
|
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_shader_buts_tex_image_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2013-07-22 08:56:51 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user");
|
|
|
|
uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0, 0);
|
2013-07-22 08:56:51 +00:00
|
|
|
}
|
|
|
|
|
2012-03-08 19:52:58 +00:00
|
|
|
static void node_shader_buts_tex_environment(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
PointerRNA imaptr = RNA_pointer_get(ptr, "image");
|
|
|
|
PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user");
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
|
|
|
|
uiTemplateID(layout,
|
|
|
|
C,
|
|
|
|
ptr,
|
|
|
|
"image",
|
|
|
|
"IMAGE_OT_new",
|
|
|
|
"IMAGE_OT_open",
|
|
|
|
NULL,
|
|
|
|
UI_TEMPLATE_ID_FILTER_ALL,
|
|
|
|
false);
|
2012-06-04 19:38:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "interpolation", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "projection", 0, "", ICON_NONE);
|
2019-04-23 13:56:30 +02:00
|
|
|
|
|
|
|
node_buts_image_user(layout, C, &iuserptr, &imaptr, &iuserptr, false);
|
2012-03-08 19:52:58 +00:00
|
|
|
}
|
|
|
|
|
2015-02-09 22:25:12 +01:00
|
|
|
static void node_shader_buts_tex_environment_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
PointerRNA imaptr = RNA_pointer_get(ptr, "image");
|
|
|
|
PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user");
|
|
|
|
Image *ima = imaptr.data;
|
|
|
|
|
|
|
|
uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
|
|
|
|
uiTemplateID(layout,
|
|
|
|
C,
|
|
|
|
ptr,
|
|
|
|
"image",
|
|
|
|
"IMAGE_OT_new",
|
|
|
|
"IMAGE_OT_open",
|
|
|
|
NULL,
|
|
|
|
UI_TEMPLATE_ID_FILTER_ALL,
|
|
|
|
false);
|
|
|
|
|
|
|
|
if (!ima) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
uiItemR(layout, &imaptr, "source", 0, IFACE_("Source"), ICON_NONE);
|
|
|
|
|
|
|
|
if (!(ELEM(ima->source, IMA_SRC_GENERATED, IMA_SRC_VIEWER))) {
|
|
|
|
uiLayout *row = uiLayoutRow(layout, true);
|
|
|
|
const bool is_packed = BKE_image_has_packedfile(ima);
|
|
|
|
|
|
|
|
if (is_packed) {
|
|
|
|
uiItemO(row, "", ICON_PACKAGE, "image.unpack");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemO(row, "", ICON_UGLYPACKAGE, "image.pack");
|
|
|
|
}
|
|
|
|
|
|
|
|
row = uiLayoutRow(row, true);
|
|
|
|
uiLayoutSetEnabled(row, !is_packed);
|
|
|
|
uiItemR(row, &imaptr, "filepath", 0, "", ICON_NONE);
|
|
|
|
uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* multilayer? */
|
|
|
|
if (ima->type == IMA_TYPE_MULTILAYER && ima->rr) {
|
|
|
|
uiTemplateImageLayers(layout, C, ima, iuserptr.data);
|
|
|
|
}
|
|
|
|
else if (ima->source != IMA_SRC_GENERATED) {
|
|
|
|
uiTemplateImageInfo(layout, C, ima, iuserptr.data);
|
|
|
|
}
|
|
|
|
|
|
|
|
uiItemR(layout, ptr, "interpolation", 0, IFACE_("Interpolation"), ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "projection", 0, IFACE_("Projection"), ICON_NONE);
|
2015-02-09 22:25:12 +01:00
|
|
|
}
|
|
|
|
|
2011-11-08 11:38:16 +00:00
|
|
|
static void node_shader_buts_tex_sky(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "sky_type", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "sun_direction", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "turbidity", 0, NULL, ICON_NONE);
|
2016-04-05 12:25:54 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "sky_type") == SHD_SKY_NEW) {
|
|
|
|
uiItemR(layout, ptr, "ground_albedo", 0, NULL, ICON_NONE);
|
|
|
|
}
|
2011-11-08 11:38:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_shader_buts_tex_gradient(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "gradient_type", 0, "", ICON_NONE);
|
2011-11-08 11:38:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_shader_buts_tex_magic(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "turbulence_depth", 0, NULL, ICON_NONE);
|
2011-11-08 11:38:16 +00:00
|
|
|
}
|
|
|
|
|
2012-09-04 13:29:07 +00:00
|
|
|
static void node_shader_buts_tex_brick(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "offset", UI_ITEM_R_SLIDER, IFACE_("Offset"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "offset_frequency", 0, IFACE_("Frequency"), ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "squash", 0, IFACE_("Squash"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "squash_frequency", 0, IFACE_("Frequency"), ICON_NONE);
|
2012-09-04 13:29:07 +00:00
|
|
|
}
|
|
|
|
|
2011-11-08 11:38:16 +00:00
|
|
|
static void node_shader_buts_tex_wave(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "wave_type", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "wave_profile", 0, "", ICON_NONE);
|
2011-11-08 11:38:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_shader_buts_tex_musgrave(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "musgrave_type", 0, "", ICON_NONE);
|
2011-11-08 11:38:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_shader_buts_tex_voronoi(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "coloring", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "distance", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "feature", 0, "", ICON_NONE);
|
|
|
|
}
|
|
|
|
|
2019-09-04 17:54:32 +02:00
|
|
|
static void node_shader_buts_tex_noise(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
uiItemR(layout, ptr, "dimensions", 0, "", ICON_NONE);
|
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_shader_buts_tex_pointdensity(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
bNode *node = ptr->data;
|
|
|
|
NodeShaderTexPointDensity *shader_point_density = node->storage;
|
|
|
|
Object *ob = (Object *)node->id;
|
|
|
|
PointerRNA ob_ptr, obdata_ptr;
|
|
|
|
|
|
|
|
RNA_id_pointer_create((ID *)ob, &ob_ptr);
|
|
|
|
RNA_id_pointer_create(ob ? (ID *)ob->data : NULL, &obdata_ptr);
|
|
|
|
|
|
|
|
uiItemR(layout, ptr, "point_source", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "object", 0, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
if (node->id && shader_point_density->point_source == SHD_POINTDENSITY_SOURCE_PSYS) {
|
|
|
|
PointerRNA dataptr;
|
|
|
|
RNA_id_pointer_create((ID *)node->id, &dataptr);
|
|
|
|
uiItemPointerR(layout, ptr, "particle_system", &dataptr, "particle_systems", NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
uiItemR(layout, ptr, "space", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "radius", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "interpolation", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "resolution", 0, NULL, ICON_NONE);
|
|
|
|
if (shader_point_density->point_source == SHD_POINTDENSITY_SOURCE_PSYS) {
|
|
|
|
uiItemR(layout, ptr, "particle_color_source", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(layout, ptr, "vertex_color_source", 0, NULL, ICON_NONE);
|
|
|
|
if (shader_point_density->ob_color_source == SHD_POINTDENSITY_COLOR_VERTWEIGHT) {
|
|
|
|
if (ob_ptr.data) {
|
|
|
|
uiItemPointerR(
|
|
|
|
layout, ptr, "vertex_attribute_name", &ob_ptr, "vertex_groups", "", ICON_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (shader_point_density->ob_color_source == SHD_POINTDENSITY_COLOR_VERTCOL) {
|
|
|
|
if (obdata_ptr.data) {
|
|
|
|
uiItemPointerR(
|
|
|
|
layout, ptr, "vertex_attribute_name", &obdata_ptr, "vertex_colors", "", ICON_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-07-18 22:36:09 +02:00
|
|
|
}
|
|
|
|
|
2012-10-04 21:40:39 +00:00
|
|
|
static void node_shader_buts_tex_coord(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "object", 0, NULL, 0);
|
|
|
|
uiItemR(layout, ptr, "from_instancer", 0, NULL, 0);
|
2012-10-04 21:40:39 +00:00
|
|
|
}
|
|
|
|
|
2013-05-10 16:57:17 +00:00
|
|
|
static void node_shader_buts_bump(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "invert", 0, NULL, 0);
|
2013-05-10 16:57:17 +00:00
|
|
|
}
|
|
|
|
|
2014-04-02 11:40:29 +02:00
|
|
|
static void node_shader_buts_uvmap(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "from_instancer", 0, NULL, 0);
|
2014-04-02 11:40:29 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (!RNA_boolean_get(ptr, "from_instancer")) {
|
|
|
|
PointerRNA obptr = CTX_data_pointer_get(C, "active_object");
|
2014-04-02 11:40:29 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) {
|
|
|
|
PointerRNA dataptr = RNA_pointer_get(&obptr, "data");
|
|
|
|
uiItemPointerR(layout, ptr, "uv_map", &dataptr, "uv_layers", "", ICON_NONE);
|
|
|
|
}
|
|
|
|
}
|
2014-04-02 11:40:29 +02:00
|
|
|
}
|
|
|
|
|
2014-08-11 17:13:38 +09:00
|
|
|
static void node_shader_buts_uvalongstroke(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2014-07-20 12:14:31 +09:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_tips", 0, NULL, 0);
|
2014-07-20 12:14:31 +09:00
|
|
|
}
|
|
|
|
|
2012-11-06 20:48:26 +00:00
|
|
|
static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2012-11-06 19:59:02 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "space", 0, "", 0);
|
2012-11-06 19:59:02 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "space") == SHD_SPACE_TANGENT) {
|
|
|
|
PointerRNA obptr = CTX_data_pointer_get(C, "active_object");
|
2012-11-06 20:48:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) {
|
|
|
|
PointerRNA dataptr = RNA_pointer_get(&obptr, "data");
|
|
|
|
uiItemPointerR(layout, ptr, "uv_map", &dataptr, "uv_layers", "", ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(layout, ptr, "uv_map", 0, "", 0);
|
|
|
|
}
|
|
|
|
}
|
2012-11-06 19:59:02 +00:00
|
|
|
}
|
|
|
|
|
2018-01-21 00:40:42 +01:00
|
|
|
static void node_shader_buts_displacement(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "space", 0, "", 0);
|
2018-01-21 00:40:42 +01:00
|
|
|
}
|
|
|
|
|
2012-11-06 20:48:26 +00:00
|
|
|
static void node_shader_buts_tangent(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2012-11-06 19:59:02 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *split, *row;
|
2012-11-06 19:59:02 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
split = uiLayoutSplit(layout, 0.0f, false);
|
2012-11-06 19:59:02 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(split, ptr, "direction_type", 0, "", 0);
|
2012-11-06 19:59:02 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(split, false);
|
2012-11-06 19:59:02 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "direction_type") == SHD_TANGENT_UVMAP) {
|
|
|
|
PointerRNA obptr = CTX_data_pointer_get(C, "active_object");
|
2012-11-06 20:48:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) {
|
|
|
|
PointerRNA dataptr = RNA_pointer_get(&obptr, "data");
|
|
|
|
uiItemPointerR(row, ptr, "uv_map", &dataptr, "uv_layers", "", ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(row, ptr, "uv_map", 0, "", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(row, ptr, "axis", UI_ITEM_R_EXPAND, NULL, 0);
|
|
|
|
}
|
2012-11-06 19:59:02 +00:00
|
|
|
}
|
|
|
|
|
2011-11-08 11:38:16 +00:00
|
|
|
static void node_shader_buts_glossy(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "distribution", 0, "", ICON_NONE);
|
2011-11-08 11:38:16 +00:00
|
|
|
}
|
|
|
|
|
2018-02-08 16:19:04 +01:00
|
|
|
static void node_shader_buts_principled(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "distribution", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "subsurface_method", 0, "", ICON_NONE);
|
2018-02-08 16:19:04 +01:00
|
|
|
}
|
|
|
|
|
2014-06-08 12:16:28 +02:00
|
|
|
static void node_shader_buts_anisotropic(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "distribution", 0, "", ICON_NONE);
|
2014-06-08 12:16:28 +02:00
|
|
|
}
|
|
|
|
|
2016-01-15 05:24:15 +11:00
|
|
|
static void node_shader_buts_subsurface(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2013-09-27 10:53:55 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "falloff", 0, "", ICON_NONE);
|
2013-08-18 14:15:57 +00:00
|
|
|
}
|
|
|
|
|
2013-05-23 17:45:20 +00:00
|
|
|
static void node_shader_buts_toon(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "component", 0, "", ICON_NONE);
|
2013-05-23 17:45:20 +00:00
|
|
|
}
|
|
|
|
|
2013-09-15 23:58:00 +00:00
|
|
|
static void node_shader_buts_hair(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "component", 0, "", ICON_NONE);
|
2013-09-15 23:58:00 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_shader_buts_principled_hair(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
2018-07-18 11:14:43 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "parametrization", 0, "", ICON_NONE);
|
2018-07-18 11:14:43 +02:00
|
|
|
}
|
|
|
|
|
Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.
Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.
The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.
The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.
Reviewers: #cycles, dingto, sergey, brecht
Reviewed By: #cycles, dingto, brecht
Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey
Differential Revision: https://developer.blender.org/D1543
2018-05-27 00:46:37 +02:00
|
|
|
static void node_shader_buts_ies(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row;
|
Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.
Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.
The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.
The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.
Reviewers: #cycles, dingto, sergey, brecht
Reviewed By: #cycles, dingto, brecht
Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey
Differential Revision: https://developer.blender.org/D1543
2018-05-27 00:46:37 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.
Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.
The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.
The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.
Reviewers: #cycles, dingto, sergey, brecht
Reviewed By: #cycles, dingto, brecht
Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey
Differential Revision: https://developer.blender.org/D1543
2018-05-27 00:46:37 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, true);
|
Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.
Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.
The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.
The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.
Reviewers: #cycles, dingto, sergey, brecht
Reviewed By: #cycles, dingto, brecht
Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey
Differential Revision: https://developer.blender.org/D1543
2018-05-27 00:46:37 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "mode") == NODE_IES_INTERNAL) {
|
|
|
|
uiItemR(row, ptr, "ies", 0, "", ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(row, ptr, "filepath", 0, "", ICON_NONE);
|
|
|
|
}
|
Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.
Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.
The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.
The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.
Reviewers: #cycles, dingto, sergey, brecht
Reviewed By: #cycles, dingto, brecht
Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey
Differential Revision: https://developer.blender.org/D1543
2018-05-27 00:46:37 +02:00
|
|
|
}
|
|
|
|
|
2012-11-03 14:32:26 +00:00
|
|
|
static void node_shader_buts_script(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row;
|
2012-11-03 14:32:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
2012-11-03 14:32:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, true);
|
2012-11-03 14:32:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "mode") == NODE_SCRIPT_INTERNAL) {
|
|
|
|
uiItemR(row, ptr, "script", 0, "", ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(row, ptr, "filepath", 0, "", ICON_NONE);
|
|
|
|
}
|
2012-11-03 14:32:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemO(row, "", ICON_FILE_REFRESH, "node.shader_script_update");
|
2012-11-03 14:32:26 +00:00
|
|
|
}
|
|
|
|
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_shader_buts_script_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2012-11-03 14:32:26 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemS(layout);
|
2012-11-03 14:32:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
node_shader_buts_script(layout, C, ptr);
|
2012-11-03 14:32:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
#if 0 /* not implemented yet */
|
2019-05-31 23:21:16 +10:00
|
|
|
if (RNA_enum_get(ptr, "mode") == NODE_SCRIPT_EXTERNAL) {
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_auto_update", 0, NULL, ICON_NONE);
|
2019-05-31 23:21:16 +10:00
|
|
|
}
|
2012-11-18 01:22:31 +00:00
|
|
|
#endif
|
2012-11-03 14:32:26 +00:00
|
|
|
}
|
|
|
|
|
2018-07-05 12:44:15 +02:00
|
|
|
static void node_buts_output_shader(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "target", 0, "", ICON_NONE);
|
2018-07-05 12:44:15 +02:00
|
|
|
}
|
|
|
|
|
2014-07-16 22:25:37 +09:00
|
|
|
static void node_buts_output_linestyle(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row, *col;
|
2014-07-16 22:25:37 +09:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
row = uiLayoutRow(col, true);
|
|
|
|
uiItemR(row, ptr, "blend_type", 0, "", ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "use_clamp", 0, NULL, ICON_NONE);
|
2014-07-16 22:25:37 +09:00
|
|
|
}
|
|
|
|
|
2017-08-18 18:37:05 +02:00
|
|
|
static void node_shader_buts_bevel(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "samples", 0, NULL, ICON_NONE);
|
2017-08-18 18:37:05 +02:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_shader_buts_ambient_occlusion(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
2018-06-15 11:03:29 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "samples", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "inside", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "only_local", 0, NULL, ICON_NONE);
|
2018-06-15 11:03:29 +02:00
|
|
|
}
|
|
|
|
|
2019-08-21 20:04:09 +02:00
|
|
|
static void node_shader_buts_white_noise(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
uiItemR(layout, ptr, "dimensions", 0, "", ICON_NONE);
|
|
|
|
}
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
/* only once called */
|
|
|
|
static void node_shader_set_butfunc(bNodeType *ntype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
switch (ntype->type) {
|
|
|
|
case SH_NODE_NORMAL:
|
|
|
|
ntype->draw_buttons = node_buts_normal;
|
|
|
|
break;
|
|
|
|
case SH_NODE_CURVE_VEC:
|
|
|
|
ntype->draw_buttons = node_buts_curvevec;
|
|
|
|
break;
|
|
|
|
case SH_NODE_CURVE_RGB:
|
|
|
|
ntype->draw_buttons = node_buts_curvecol;
|
|
|
|
break;
|
|
|
|
case SH_NODE_MAPPING:
|
|
|
|
ntype->draw_buttons = node_shader_buts_mapping;
|
|
|
|
break;
|
|
|
|
case SH_NODE_VALUE:
|
|
|
|
ntype->draw_buttons = node_buts_value;
|
|
|
|
break;
|
|
|
|
case SH_NODE_RGB:
|
|
|
|
ntype->draw_buttons = node_buts_rgb;
|
|
|
|
break;
|
|
|
|
case SH_NODE_MIX_RGB:
|
|
|
|
ntype->draw_buttons = node_buts_mix_rgb;
|
|
|
|
break;
|
|
|
|
case SH_NODE_VALTORGB:
|
|
|
|
ntype->draw_buttons = node_buts_colorramp;
|
|
|
|
break;
|
2019-08-14 10:53:19 +02:00
|
|
|
case SH_NODE_MAP_RANGE:
|
|
|
|
ntype->draw_buttons = node_buts_map_range;
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
case SH_NODE_MATH:
|
|
|
|
ntype->draw_buttons = node_buts_math;
|
|
|
|
break;
|
Shading: Add more operators to Vector Math node.
Add Multiply, Divide, Project, Reflect, Distance, Length, Scale, Snap,
Floor, Ceil, Modulo, Fraction, Absolute, Minimum, and Maximum operators
to the Vector Math node. The Value output has been removed from operators
whose output is a vector, and the other way around. All of those removals
has been handled properly in versioning code.
The patch doesn't include tests for the new operators. Tests will be added
in a later patch.
Reviewers: brecht, JacquesLucke
Differential Revision: https://developer.blender.org/D5523
2019-08-21 19:36:33 +02:00
|
|
|
case SH_NODE_VECTOR_MATH:
|
2019-04-17 06:17:24 +02:00
|
|
|
ntype->draw_buttons = node_shader_buts_vect_math;
|
|
|
|
break;
|
|
|
|
case SH_NODE_VECT_TRANSFORM:
|
|
|
|
ntype->draw_buttons = node_shader_buts_vect_transform;
|
|
|
|
break;
|
|
|
|
case SH_NODE_ATTRIBUTE:
|
|
|
|
ntype->draw_buttons = node_shader_buts_attribute;
|
|
|
|
break;
|
|
|
|
case SH_NODE_WIREFRAME:
|
|
|
|
ntype->draw_buttons = node_shader_buts_wireframe;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_SKY:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_sky;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_IMAGE:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_image;
|
|
|
|
ntype->draw_buttons_ex = node_shader_buts_tex_image_ex;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_ENVIRONMENT:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_environment;
|
|
|
|
ntype->draw_buttons_ex = node_shader_buts_tex_environment_ex;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_GRADIENT:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_gradient;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_MAGIC:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_magic;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_BRICK:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_brick;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_WAVE:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_wave;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_MUSGRAVE:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_musgrave;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_VORONOI:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_voronoi;
|
|
|
|
break;
|
2019-09-04 17:54:32 +02:00
|
|
|
case SH_NODE_TEX_NOISE:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_noise;
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
case SH_NODE_TEX_POINTDENSITY:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_pointdensity;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_COORD:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tex_coord;
|
|
|
|
break;
|
|
|
|
case SH_NODE_BUMP:
|
|
|
|
ntype->draw_buttons = node_shader_buts_bump;
|
|
|
|
break;
|
|
|
|
case SH_NODE_NORMAL_MAP:
|
|
|
|
ntype->draw_buttons = node_shader_buts_normal_map;
|
|
|
|
break;
|
|
|
|
case SH_NODE_DISPLACEMENT:
|
|
|
|
case SH_NODE_VECTOR_DISPLACEMENT:
|
|
|
|
ntype->draw_buttons = node_shader_buts_displacement;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TANGENT:
|
|
|
|
ntype->draw_buttons = node_shader_buts_tangent;
|
|
|
|
break;
|
|
|
|
case SH_NODE_BSDF_GLOSSY:
|
|
|
|
case SH_NODE_BSDF_GLASS:
|
|
|
|
case SH_NODE_BSDF_REFRACTION:
|
|
|
|
ntype->draw_buttons = node_shader_buts_glossy;
|
|
|
|
break;
|
|
|
|
case SH_NODE_BSDF_PRINCIPLED:
|
|
|
|
ntype->draw_buttons = node_shader_buts_principled;
|
|
|
|
break;
|
|
|
|
case SH_NODE_BSDF_ANISOTROPIC:
|
|
|
|
ntype->draw_buttons = node_shader_buts_anisotropic;
|
|
|
|
break;
|
|
|
|
case SH_NODE_SUBSURFACE_SCATTERING:
|
|
|
|
ntype->draw_buttons = node_shader_buts_subsurface;
|
|
|
|
break;
|
|
|
|
case SH_NODE_BSDF_TOON:
|
|
|
|
ntype->draw_buttons = node_shader_buts_toon;
|
|
|
|
break;
|
|
|
|
case SH_NODE_BSDF_HAIR:
|
|
|
|
ntype->draw_buttons = node_shader_buts_hair;
|
|
|
|
break;
|
|
|
|
case SH_NODE_BSDF_HAIR_PRINCIPLED:
|
|
|
|
ntype->draw_buttons = node_shader_buts_principled_hair;
|
|
|
|
break;
|
|
|
|
case SH_NODE_SCRIPT:
|
|
|
|
ntype->draw_buttons = node_shader_buts_script;
|
|
|
|
ntype->draw_buttons_ex = node_shader_buts_script_ex;
|
|
|
|
break;
|
|
|
|
case SH_NODE_UVMAP:
|
|
|
|
ntype->draw_buttons = node_shader_buts_uvmap;
|
|
|
|
break;
|
|
|
|
case SH_NODE_UVALONGSTROKE:
|
|
|
|
ntype->draw_buttons = node_shader_buts_uvalongstroke;
|
|
|
|
break;
|
|
|
|
case SH_NODE_OUTPUT_MATERIAL:
|
|
|
|
case SH_NODE_OUTPUT_LIGHT:
|
|
|
|
case SH_NODE_OUTPUT_WORLD:
|
|
|
|
ntype->draw_buttons = node_buts_output_shader;
|
|
|
|
break;
|
|
|
|
case SH_NODE_OUTPUT_LINESTYLE:
|
|
|
|
ntype->draw_buttons = node_buts_output_linestyle;
|
|
|
|
break;
|
|
|
|
case SH_NODE_TEX_IES:
|
|
|
|
ntype->draw_buttons = node_shader_buts_ies;
|
|
|
|
break;
|
|
|
|
case SH_NODE_BEVEL:
|
|
|
|
ntype->draw_buttons = node_shader_buts_bevel;
|
|
|
|
break;
|
|
|
|
case SH_NODE_AMBIENT_OCCLUSION:
|
|
|
|
ntype->draw_buttons = node_shader_buts_ambient_occlusion;
|
|
|
|
break;
|
2019-08-21 20:04:09 +02:00
|
|
|
case SH_NODE_TEX_WHITE_NOISE:
|
|
|
|
ntype->draw_buttons = node_shader_buts_white_noise;
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_buts_image_views(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr,
|
|
|
|
PointerRNA *imaptr)
|
2015-04-06 10:40:12 -03:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (!imaptr->data) {
|
|
|
|
return;
|
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_boolean_get(ptr, "has_views")) {
|
|
|
|
if (RNA_enum_get(ptr, "view") == 0) {
|
|
|
|
uiItemR(col, ptr, "view", 0, NULL, ICON_CAMERA_STEREO);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(col, ptr, "view", 0, NULL, ICON_SCENE);
|
|
|
|
}
|
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
|
2010-10-16 02:40:31 +00:00
|
|
|
static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
PointerRNA imaptr, iuserptr;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-08-23 09:52:12 +02:00
|
|
|
RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr);
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
|
|
|
|
uiTemplateID(layout,
|
|
|
|
C,
|
|
|
|
ptr,
|
|
|
|
"image",
|
|
|
|
"IMAGE_OT_new",
|
|
|
|
"IMAGE_OT_open",
|
|
|
|
NULL,
|
|
|
|
UI_TEMPLATE_ID_FILTER_ALL,
|
|
|
|
false);
|
|
|
|
if (!node->id) {
|
|
|
|
return;
|
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
imaptr = RNA_pointer_get(ptr, "image");
|
2014-01-20 18:54:03 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
node_buts_image_user(layout, C, ptr, &imaptr, &iuserptr, true);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
node_buts_image_views(layout, C, ptr, &imaptr);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_composit_buts_image_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2012-09-25 10:14:07 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
PointerRNA iuserptr;
|
2012-09-25 10:14:07 +00:00
|
|
|
|
2019-08-23 09:52:12 +02:00
|
|
|
RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr);
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
|
|
|
|
uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0, 1);
|
2012-09-25 10:14:07 +00:00
|
|
|
}
|
|
|
|
|
2017-11-22 10:52:39 -02:00
|
|
|
static void node_composit_buts_viewlayers(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
uiLayout *col, *row;
|
|
|
|
PointerRNA op_ptr;
|
|
|
|
PointerRNA scn_ptr;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
const char *layer_name;
|
|
|
|
char scene_name[MAX_ID_NAME - 2];
|
2012-01-22 03:30:07 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(layout, C, ptr, "scene", NULL, NULL, NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (!node->id) {
|
|
|
|
return;
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
row = uiLayoutRow(col, true);
|
|
|
|
uiItemR(row, ptr, "layer", 0, "", ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
prop = RNA_struct_find_property(ptr, "layer");
|
|
|
|
if (!(RNA_property_enum_identifier(
|
|
|
|
C, ptr, prop, RNA_property_enum_get(ptr, prop), &layer_name))) {
|
|
|
|
return;
|
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
scn_ptr = RNA_pointer_get(ptr, "scene");
|
|
|
|
RNA_string_get(&scn_ptr, "name", scene_name);
|
2016-08-03 23:31:48 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemFullO(
|
|
|
|
row, "RENDER_OT_render", "", ICON_RENDER_STILL, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
|
|
|
|
RNA_string_set(&op_ptr, "layer", layer_name);
|
|
|
|
RNA_string_set(&op_ptr, "scene", scene_name);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_blur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col, *row;
|
|
|
|
int reference;
|
|
|
|
int filter;
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
filter = RNA_enum_get(ptr, "filter_type");
|
|
|
|
reference = RNA_boolean_get(ptr, "use_variable_size");
|
|
|
|
|
|
|
|
uiItemR(col, ptr, "filter_type", 0, "", ICON_NONE);
|
|
|
|
if (filter != R_FILTER_FAST_GAUSS) {
|
|
|
|
uiItemR(col, ptr, "use_variable_size", 0, NULL, ICON_NONE);
|
|
|
|
if (!reference) {
|
|
|
|
uiItemR(col, ptr, "use_bokeh", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
uiItemR(col, ptr, "use_gamma_correction", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
uiItemR(col, ptr, "use_relative", 0, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
if (RNA_boolean_get(ptr, "use_relative")) {
|
|
|
|
uiItemL(col, IFACE_("Aspect Correction"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "aspect_correction", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "factor_x", 0, IFACE_("X"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "factor_y", 0, IFACE_("Y"), ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "size_x", 0, IFACE_("X"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "size_y", 0, IFACE_("Y"), ICON_NONE);
|
|
|
|
}
|
|
|
|
uiItemR(col, ptr, "use_extended_bounds", 0, NULL, ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_dblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "use_wrap", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemL(col, IFACE_("Center:"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "center_x", 0, IFACE_("X"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "center_y", 0, IFACE_("Y"), ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemS(layout);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "distance", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "angle", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemS(layout);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "spin", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "zoom", 0, NULL, ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_bilateralblur(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "iterations", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "sigma_color", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "sigma_space", 0, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2014-02-05 13:51:51 +01:00
|
|
|
static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *sub, *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemL(col, IFACE_("Bokeh Type:"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "bokeh", 0, "", ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "angle", 0, NULL, ICON_NONE);
|
2009-09-18 21:04:54 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_gamma_correction", 0, NULL, ICON_NONE);
|
2009-09-18 21:04:54 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_zbuffer") == true);
|
|
|
|
uiItemR(col, ptr, "f_stop", 0, NULL, ICON_NONE);
|
2009-09-18 21:04:54 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "blur_max", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "threshold", 0, NULL, ICON_NONE);
|
2009-11-10 04:01:44 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "use_preview", 0, NULL, ICON_NONE);
|
2014-02-05 13:51:51 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(layout, C, ptr, "scene", NULL, NULL, NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
2014-02-05 13:51:51 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "use_zbuffer", 0, NULL, ICON_NONE);
|
|
|
|
sub = uiLayoutColumn(col, false);
|
|
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_zbuffer") == false);
|
|
|
|
uiItemR(sub, ptr, "z_scale", 0, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* qdn: glare node */
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_glare(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "glare_type", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "quality", 0, "", ICON_NONE);
|
2009-09-18 21:04:54 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "glare_type") != 1) {
|
|
|
|
uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "glare_type") != 0) {
|
|
|
|
uiItemR(layout, ptr, "color_modulation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "mix", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "threshold", 0, NULL, ICON_NONE);
|
2009-09-18 21:04:54 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "glare_type") == 2) {
|
|
|
|
uiItemR(layout, ptr, "streaks", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "angle_offset", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
if (RNA_enum_get(ptr, "glare_type") == 0 || RNA_enum_get(ptr, "glare_type") == 2) {
|
|
|
|
uiItemR(layout, ptr, "fade", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "glare_type") == 0) {
|
|
|
|
uiItemR(layout, ptr, "use_rotate_45", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (RNA_enum_get(ptr, "glare_type") == 1) {
|
|
|
|
uiItemR(layout, ptr, "size", 0, NULL, ICON_NONE);
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_tonemap(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2009-09-18 21:04:54 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "tonemap_type", 0, "", ICON_NONE);
|
|
|
|
if (RNA_enum_get(ptr, "tonemap_type") == 0) {
|
|
|
|
uiItemR(col, ptr, "key", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "offset", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "gamma", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(col, ptr, "intensity", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "adaptation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "correction", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_lensdist(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2009-09-17 15:06:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "use_projector", 0, NULL, ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(col, false);
|
|
|
|
uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_projector") == false);
|
|
|
|
uiItemR(col, ptr, "use_jitter", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "use_fit", 0, NULL, ICON_NONE);
|
2009-09-18 21:04:54 +00:00
|
|
|
}
|
2009-09-16 18:59:13 +00:00
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_vecblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "samples", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "factor", 0, IFACE_("Blur"), ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemL(col, IFACE_("Speed:"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "speed_min", 0, IFACE_("Min"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "speed_max", 0, IFACE_("Max"), ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_curved", 0, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_filter(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "filter_type", 0, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_flip(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "axis", 0, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_crop(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2011-04-21 13:11:51 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_crop_size", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "relative", 0, NULL, ICON_NONE);
|
2010-08-25 02:18:37 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
if (RNA_boolean_get(ptr, "relative")) {
|
|
|
|
uiItemR(col, ptr, "rel_min_x", 0, IFACE_("Left"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "rel_max_x", 0, IFACE_("Right"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "rel_min_y", 0, IFACE_("Up"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "rel_max_y", 0, IFACE_("Down"), ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(col, ptr, "min_x", 0, IFACE_("Left"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "max_x", 0, IFACE_("Right"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "min_y", 0, IFACE_("Up"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "max_y", 0, IFACE_("Down"), ICON_NONE);
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_splitviewer(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row, *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "factor", 0, NULL, ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_double_edge_mask(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
2012-01-10 19:08:08 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2012-01-10 19:08:08 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
2012-01-10 19:08:08 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemL(col, IFACE_("Inner Edge:"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "inner_mode", 0, "", ICON_NONE);
|
|
|
|
uiItemL(col, IFACE_("Buffer Edge:"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "edge_mode", 0, "", ICON_NONE);
|
2012-01-10 19:08:08 +00:00
|
|
|
}
|
|
|
|
|
2012-11-14 19:53:46 +00:00
|
|
|
static void node_composit_buts_map_range(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2012-11-14 19:53:46 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "use_clamp", 0, NULL, ICON_NONE);
|
2012-11-14 19:53:46 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_map_value(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *sub, *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "offset", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "size", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "use_min", 0, NULL, ICON_NONE);
|
|
|
|
sub = uiLayoutColumn(col, false);
|
|
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min"));
|
|
|
|
uiItemR(sub, ptr, "min", 0, "", ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "use_max", 0, NULL, ICON_NONE);
|
|
|
|
sub = uiLayoutColumn(col, false);
|
|
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max"));
|
|
|
|
uiItemR(sub, ptr, "max", 0, "", ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_alphaover(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "use_premultiply", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "premul", 0, NULL, ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2010-11-12 14:59:01 +00:00
|
|
|
static void node_composit_buts_zcombine(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "use_alpha", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "use_antialias_z", 0, NULL, ICON_NONE);
|
2010-11-12 14:59:01 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_dilateerode(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "distance", 0, NULL, ICON_NONE);
|
|
|
|
switch (RNA_enum_get(ptr, "mode")) {
|
|
|
|
case CMP_NODE_DILATEERODE_DISTANCE_THRESH:
|
|
|
|
uiItemR(layout, ptr, "edge", 0, NULL, ICON_NONE);
|
|
|
|
break;
|
|
|
|
case CMP_NODE_DILATEERODE_DISTANCE_FEATHER:
|
|
|
|
uiItemR(layout, ptr, "falloff", 0, NULL, ICON_NONE);
|
|
|
|
break;
|
|
|
|
}
|
2009-09-10 04:12:22 +00:00
|
|
|
}
|
|
|
|
|
2012-08-06 13:45:11 +00:00
|
|
|
static void node_composit_buts_inpaint(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "distance", 0, NULL, ICON_NONE);
|
2012-08-06 13:45:11 +00:00
|
|
|
}
|
|
|
|
|
2012-08-23 06:48:01 +00:00
|
|
|
static void node_composit_buts_despeckle(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2012-08-23 06:48:01 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "threshold", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "threshold_neighbor", 0, NULL, ICON_NONE);
|
2012-08-23 06:48:01 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_diff_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-10 04:12:22 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "tolerance", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "falloff", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_distance_matte(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col, *row;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
2013-02-04 00:18:09 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemL(layout, IFACE_("Color Space:"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
2012-04-29 20:07:29 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(col, ptr, "tolerance", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "falloff", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row, *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemL(layout, IFACE_("Despill Channel:"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
2010-03-12 18:47:35 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
|
2010-03-12 18:47:35 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "limit_method") == 0) {
|
|
|
|
uiItemL(col, IFACE_("Limiting Channel:"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
}
|
2010-03-12 18:47:35 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(col, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "use_unspill", 0, NULL, ICON_NONE);
|
|
|
|
if (RNA_boolean_get(ptr, "use_unspill") == true) {
|
|
|
|
uiItemR(col, ptr, "unspill_red", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "unspill_green", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "unspill_blue", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
}
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "tolerance", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "threshold", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
/*uiItemR(col, ptr, "lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE); Removed for now */
|
|
|
|
uiItemR(col, ptr, "gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
/*uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, NULL, ICON_NONE); Removed for now*/
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_color_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-16 18:59:13 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
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);
|
2009-09-16 18:59:13 +00:00
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_channel_matte(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col, *row;
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemL(layout, IFACE_("Color Space:"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "color_space", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemL(col, IFACE_("Key Channel:"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "matte_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
2009-11-10 04:01:44 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
2010-03-13 14:47:26 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
|
|
|
|
if (RNA_enum_get(ptr, "limit_method") == 0) {
|
|
|
|
uiItemL(col, IFACE_("Limiting Channel:"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
}
|
2011-04-21 15:53:30 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(col, ptr, "limit_max", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "limit_min", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_luma_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-10 04:12:22 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "limit_max", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "limit_min", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
2009-09-10 04:12:22 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_map_uv(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "alpha", 0, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "index", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "use_antialiasing", 0, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
PointerRNA imfptr = RNA_pointer_get(ptr, "format");
|
|
|
|
const bool multilayer = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (multilayer) {
|
|
|
|
uiItemL(layout, IFACE_("Path:"), ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemL(layout, IFACE_("Base Path:"), ICON_NONE);
|
|
|
|
}
|
|
|
|
uiItemR(layout, ptr, "base_path", 0, "", ICON_NONE);
|
Adds a new node type for saving multiple image files from a single node.
Unlike the existing file output node this node has an arbitrary number of
possible input slots. It has a base path string that can be set to a general
base folder. Every input socket then uses its name as an extension of the base
path for file organization. This can include further subfolders on top of the
base path. Example:
Base path: '/home/user/myproject'
Input 1: 'Compo'
Input 2: 'Diffuse/'
Input 3: 'details/Normals'
would create output files
in /home/user/myproject: Compo0001.png, Compo0002.png, ...
in /home/user/myproject/Diffuse: 0001.png, 0002.png, ... (no filename base
given)
in /home/user/myproject/details: Normals0001.png, Normals0002.png, ...
Most settings for the node can be found in the sidebar (NKEY). New input sockets
can be added with the "Add Input" button. There is a list of input sockets and
below that the details for each socket can be changed, including the sub-path
and filename. Sockets can be removed here as well. By default each socket uses
the render settings file output format, but each can use its own format if
necessary.
To my knowledge this is the first node making use of such dynamic sockets in
trunk. So this is also a design test, other nodes might use this in the future.
Adding operator buttons on top of a node is a bit unwieldy atm, because all node
operators generally work on selected and/or active node(s). The operator button
would therefore either have to make sure the node is activated before the
operator is called (block callback maybe?) OR it has to store the node name
(risky, weak reference). For now it is only used in the sidebar, where only the
active node's buttons are displayed.
Also adds a new struct_type value to bNodeSocket, in order to distinguish
different socket types with the same data type (file inputs are SOCK_RGBA color
sockets). Would be nicer to use data type only for actual data evaluation, but
used in too many places, this works ok for now.
2012-02-22 12:24:04 +00:00
|
|
|
}
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
Adds a new node type for saving multiple image files from a single node.
Unlike the existing file output node this node has an arbitrary number of
possible input slots. It has a base path string that can be set to a general
base folder. Every input socket then uses its name as an extension of the base
path for file organization. This can include further subfolders on top of the
base path. Example:
Base path: '/home/user/myproject'
Input 1: 'Compo'
Input 2: 'Diffuse/'
Input 3: 'details/Normals'
would create output files
in /home/user/myproject: Compo0001.png, Compo0002.png, ...
in /home/user/myproject/Diffuse: 0001.png, 0002.png, ... (no filename base
given)
in /home/user/myproject/details: Normals0001.png, Normals0002.png, ...
Most settings for the node can be found in the sidebar (NKEY). New input sockets
can be added with the "Add Input" button. There is a list of input sockets and
below that the details for each socket can be changed, including the sub-path
and filename. Sockets can be removed here as well. By default each socket uses
the render settings file output format, but each can use its own format if
necessary.
To my knowledge this is the first node making use of such dynamic sockets in
trunk. So this is also a design test, other nodes might use this in the future.
Adding operator buttons on top of a node is a bit unwieldy atm, because all node
operators generally work on selected and/or active node(s). The operator button
would therefore either have to make sure the node is activated before the
operator is called (block callback maybe?) OR it has to store the node name
(risky, weak reference). For now it is only used in the sidebar, where only the
active node's buttons are displayed.
Also adds a new struct_type value to bNodeSocket, in order to distinguish
different socket types with the same data type (file inputs are SOCK_RGBA color
sockets). Would be nicer to use data type only for actual data evaluation, but
used in too many places, this works ok for now.
2012-02-22 12:24:04 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
Scene *scene = CTX_data_scene(C);
|
|
|
|
PointerRNA imfptr = RNA_pointer_get(ptr, "format");
|
|
|
|
PointerRNA active_input_ptr, op_ptr;
|
|
|
|
wmOperatorType *ot;
|
|
|
|
uiLayout *row, *col;
|
|
|
|
int active_index;
|
|
|
|
const bool multilayer = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER;
|
|
|
|
const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0;
|
|
|
|
|
|
|
|
node_composit_buts_file_output(layout, C, ptr);
|
|
|
|
uiTemplateImageSettings(layout, &imfptr, false);
|
|
|
|
|
|
|
|
/* disable stereo output for multilayer, too much work for something that no one will use */
|
|
|
|
/* if someone asks for that we can implement it */
|
|
|
|
if (is_multiview) {
|
|
|
|
uiTemplateImageFormatViews(layout, &imfptr, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
uiItemS(layout);
|
|
|
|
|
|
|
|
uiItemO(layout, IFACE_("Add Input"), ICON_ADD, "NODE_OT_output_file_add_socket");
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
col = uiLayoutColumn(row, true);
|
|
|
|
|
|
|
|
active_index = RNA_int_get(ptr, "active_input_index");
|
|
|
|
/* using different collection properties if multilayer format is enabled */
|
|
|
|
if (multilayer) {
|
|
|
|
uiTemplateList(col,
|
|
|
|
C,
|
|
|
|
"UI_UL_list",
|
|
|
|
"file_output_node",
|
|
|
|
ptr,
|
|
|
|
"layer_slots",
|
|
|
|
ptr,
|
|
|
|
"active_input_index",
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
false,
|
|
|
|
false);
|
|
|
|
RNA_property_collection_lookup_int(
|
|
|
|
ptr, RNA_struct_find_property(ptr, "layer_slots"), active_index, &active_input_ptr);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiTemplateList(col,
|
|
|
|
C,
|
|
|
|
"UI_UL_list",
|
|
|
|
"file_output_node",
|
|
|
|
ptr,
|
|
|
|
"file_slots",
|
|
|
|
ptr,
|
|
|
|
"active_input_index",
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
false,
|
|
|
|
false);
|
|
|
|
RNA_property_collection_lookup_int(
|
|
|
|
ptr, RNA_struct_find_property(ptr, "file_slots"), active_index, &active_input_ptr);
|
|
|
|
}
|
|
|
|
/* XXX collection lookup does not return the ID part of the pointer,
|
|
|
|
* setting this manually here */
|
2019-08-23 09:52:12 +02:00
|
|
|
active_input_ptr.owner_id = ptr->owner_id;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
|
|
|
col = uiLayoutColumn(row, true);
|
|
|
|
ot = WM_operatortype_find("NODE_OT_output_file_move_active_socket", false);
|
|
|
|
uiItemFullO_ptr(col, ot, "", ICON_TRIA_UP, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
|
|
|
|
RNA_enum_set(&op_ptr, "direction", 1);
|
|
|
|
uiItemFullO_ptr(col, ot, "", ICON_TRIA_DOWN, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
|
|
|
|
RNA_enum_set(&op_ptr, "direction", 2);
|
|
|
|
|
|
|
|
if (active_input_ptr.data) {
|
|
|
|
if (multilayer) {
|
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
|
|
|
|
uiItemL(col, IFACE_("Layer:"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &active_input_ptr, "name", 0, "", ICON_NONE);
|
|
|
|
uiItemFullO(row,
|
|
|
|
"NODE_OT_output_file_remove_active_socket",
|
|
|
|
"",
|
|
|
|
ICON_X,
|
|
|
|
NULL,
|
|
|
|
WM_OP_EXEC_DEFAULT,
|
|
|
|
UI_ITEM_R_ICON_ONLY,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
|
|
|
|
uiItemL(col, IFACE_("File Subpath:"), ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &active_input_ptr, "path", 0, "", ICON_NONE);
|
|
|
|
uiItemFullO(row,
|
|
|
|
"NODE_OT_output_file_remove_active_socket",
|
|
|
|
"",
|
|
|
|
ICON_X,
|
|
|
|
NULL,
|
|
|
|
WM_OP_EXEC_DEFAULT,
|
|
|
|
UI_ITEM_R_ICON_ONLY,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* format details for individual files */
|
|
|
|
imfptr = RNA_pointer_get(&active_input_ptr, "format");
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemL(col, IFACE_("Format:"), ICON_NONE);
|
|
|
|
uiItemR(col, &active_input_ptr, "use_node_format", 0, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format") == false);
|
|
|
|
uiTemplateImageSettings(col, &imfptr, false);
|
|
|
|
|
|
|
|
if (is_multiview) {
|
|
|
|
uiTemplateImageFormatViews(layout, &imfptr, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
Adds a new node type for saving multiple image files from a single node.
Unlike the existing file output node this node has an arbitrary number of
possible input slots. It has a base path string that can be set to a general
base folder. Every input socket then uses its name as an extension of the base
path for file organization. This can include further subfolders on top of the
base path. Example:
Base path: '/home/user/myproject'
Input 1: 'Compo'
Input 2: 'Diffuse/'
Input 3: 'details/Normals'
would create output files
in /home/user/myproject: Compo0001.png, Compo0002.png, ...
in /home/user/myproject/Diffuse: 0001.png, 0002.png, ... (no filename base
given)
in /home/user/myproject/details: Normals0001.png, Normals0002.png, ...
Most settings for the node can be found in the sidebar (NKEY). New input sockets
can be added with the "Add Input" button. There is a list of input sockets and
below that the details for each socket can be changed, including the sub-path
and filename. Sockets can be removed here as well. By default each socket uses
the render settings file output format, but each can use its own format if
necessary.
To my knowledge this is the first node making use of such dynamic sockets in
trunk. So this is also a design test, other nodes might use this in the future.
Adding operator buttons on top of a node is a bit unwieldy atm, because all node
operators generally work on selected and/or active node(s). The operator button
would therefore either have to make sure the node is activated before the
operator is called (block callback maybe?) OR it has to store the node name
(risky, weak reference). For now it is only used in the sidebar, where only the
active node's buttons are displayed.
Also adds a new struct_type value to bNodeSocket, in order to distinguish
different socket types with the same data type (file inputs are SOCK_RGBA color
sockets). Would be nicer to use data type only for actual data evaluation, but
used in too many places, this works ok for now.
2012-02-22 12:24:04 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_scale(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "space", 0, "", ICON_NONE);
|
2012-06-14 16:55:55 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "space") == CMP_SCALE_RENDERPERCENT) {
|
|
|
|
uiLayout *row;
|
|
|
|
uiItemR(layout, ptr, "frame_method", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "offset_x", 0, "X", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "offset_y", 0, "Y", ICON_NONE);
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_rotate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2010-03-15 22:36:39 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "filter_type", 0, "", ICON_NONE);
|
2010-03-15 22:36:39 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_invert(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemR(col, ptr, "invert_rgb", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "invert_alpha", 0, NULL, ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_premulkey(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "mapping", 0, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_view_levels(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2009-09-10 04:12:22 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
2009-09-10 04:12:22 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_colorbalance(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2010-01-20 04:19:55 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *split, *col, *row;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "correction_method", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "correction_method") == 0) {
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
split = uiLayoutSplit(layout, 0.0f, false);
|
|
|
|
col = uiLayoutColumn(split, false);
|
|
|
|
uiTemplateColorPicker(col, ptr, "lift", 1, 1, 0, 1);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "lift", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(split, false);
|
|
|
|
uiTemplateColorPicker(col, ptr, "gamma", 1, 1, 1, 1);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "gamma", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(split, false);
|
|
|
|
uiTemplateColorPicker(col, ptr, "gain", 1, 1, 1, 1);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "gain", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
2010-01-27 00:22:29 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
split = uiLayoutSplit(layout, 0.0f, false);
|
|
|
|
col = uiLayoutColumn(split, false);
|
|
|
|
uiTemplateColorPicker(col, ptr, "offset", 1, 1, 0, 1);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "offset", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "offset_basis", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(split, false);
|
|
|
|
uiTemplateColorPicker(col, ptr, "power", 1, 1, 0, 1);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "power", 0, NULL, ICON_NONE);
|
2010-01-20 04:19:55 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(split, false);
|
|
|
|
uiTemplateColorPicker(col, ptr, "slope", 1, 1, 0, 1);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, ptr, "slope", 0, NULL, ICON_NONE);
|
|
|
|
}
|
2010-01-20 04:19:55 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_colorbalance_ex(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
2011-07-04 18:48:36 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "correction_method", 0, NULL, ICON_NONE);
|
2011-07-04 18:48:36 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (RNA_enum_get(ptr, "correction_method") == 0) {
|
2011-07-04 18:48:36 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateColorPicker(layout, ptr, "lift", 1, 1, 0, 1);
|
|
|
|
uiItemR(layout, ptr, "lift", 0, NULL, ICON_NONE);
|
2011-07-04 18:48:36 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateColorPicker(layout, ptr, "gamma", 1, 1, 1, 1);
|
|
|
|
uiItemR(layout, ptr, "gamma", 0, NULL, ICON_NONE);
|
2011-07-04 18:48:36 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateColorPicker(layout, ptr, "gain", 1, 1, 1, 1);
|
|
|
|
uiItemR(layout, ptr, "gain", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiTemplateColorPicker(layout, ptr, "offset", 1, 1, 0, 1);
|
|
|
|
uiItemR(layout, ptr, "offset", 0, NULL, ICON_NONE);
|
2011-07-04 18:48:36 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateColorPicker(layout, ptr, "power", 1, 1, 0, 1);
|
|
|
|
uiItemR(layout, ptr, "power", 0, NULL, ICON_NONE);
|
2011-07-04 18:48:36 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateColorPicker(layout, ptr, "slope", 1, 1, 0, 1);
|
|
|
|
uiItemR(layout, ptr, "slope", 0, NULL, ICON_NONE);
|
|
|
|
}
|
2011-07-04 18:48:36 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_composit_buts_huecorrect(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2010-01-21 00:00:45 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
CurveMapping *cumap = node->storage;
|
2012-06-21 14:37:56 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (_sample_col[0] != SAMPLE_FLT_ISNONE) {
|
|
|
|
cumap->flag |= CUMA_DRAW_SAMPLE;
|
|
|
|
copy_v3_v3(cumap->sample, _sample_col);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
cumap->flag &= ~CUMA_DRAW_SAMPLE;
|
|
|
|
}
|
2012-06-21 14:37:56 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateCurveMapping(layout, ptr, "mapping", 'h', false, false, false, false);
|
2010-01-21 00:00:45 +00:00
|
|
|
}
|
|
|
|
|
2010-12-13 21:17:00 +00:00
|
|
|
static void node_composit_buts_ycc(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "mode", 0, "", ICON_NONE);
|
2010-12-13 21:17:00 +00:00
|
|
|
}
|
|
|
|
|
2011-11-07 12:56:05 +00:00
|
|
|
static void node_composit_buts_movieclip(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(
|
|
|
|
layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
2011-11-07 12:56:05 +00:00
|
|
|
}
|
|
|
|
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_composit_buts_movieclip_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2012-09-25 10:14:07 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
PointerRNA clipptr;
|
2012-09-25 10:14:07 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(
|
|
|
|
layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
2012-09-25 10:14:07 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (!node->id) {
|
|
|
|
return;
|
|
|
|
}
|
2012-09-25 10:14:07 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
clipptr = RNA_pointer_get(ptr, "clip");
|
2012-09-25 10:14:07 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateColorspaceSettings(layout, &clipptr, "colorspace_settings");
|
2012-09-25 10:14:07 +00:00
|
|
|
}
|
|
|
|
|
2011-11-07 12:56:05 +00:00
|
|
|
static void node_composit_buts_stabilize2d(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
2011-11-07 12:56:05 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(
|
|
|
|
layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
2011-11-07 12:56:05 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (!node->id) {
|
|
|
|
return;
|
|
|
|
}
|
2011-11-07 12:56:05 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "filter_type", 0, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "invert", 0, NULL, ICON_NONE);
|
2011-11-07 12:56:05 +00:00
|
|
|
}
|
|
|
|
|
2013-01-31 15:08:37 +00:00
|
|
|
static void node_composit_buts_translate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_relative", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "wrap_axis", 0, NULL, ICON_NONE);
|
2013-01-31 15:08:37 +00:00
|
|
|
}
|
|
|
|
|
2011-11-07 12:56:05 +00:00
|
|
|
static void node_composit_buts_transform(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "filter_type", 0, "", ICON_NONE);
|
2011-11-07 12:56:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_composit_buts_moviedistortion(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
|
|
|
|
uiTemplateID(
|
|
|
|
layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
|
|
|
|
|
|
|
if (!node->id) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
uiItemR(layout, ptr, "distortion_type", 0, "", ICON_NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void node_composit_buts_colorcorrection(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
uiLayout *row;
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "red", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "green", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "blue", 0, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemL(row, "", ICON_NONE);
|
|
|
|
uiItemL(row, IFACE_("Saturation"), ICON_NONE);
|
|
|
|
uiItemL(row, IFACE_("Contrast"), ICON_NONE);
|
|
|
|
uiItemL(row, IFACE_("Gamma"), ICON_NONE);
|
|
|
|
uiItemL(row, IFACE_("Gain"), ICON_NONE);
|
|
|
|
uiItemL(row, IFACE_("Lift"), ICON_NONE);
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemL(row, IFACE_("Master"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_gain", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_lift", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemL(row, IFACE_("Highlights"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_gain", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_lift", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemL(row, IFACE_("Midtones"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_gain", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemL(row, IFACE_("Shadows"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_gain", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_lift", UI_ITEM_R_SLIDER, "", ICON_NONE);
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "midtones_start", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_end", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void node_composit_buts_colorcorrection_ex(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
uiLayout *row;
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "red", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "green", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "blue", 0, NULL, ICON_NONE);
|
|
|
|
row = layout;
|
|
|
|
uiItemL(row, IFACE_("Saturation"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
uiItemL(row, IFACE_("Contrast"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
uiItemL(row, IFACE_("Gamma"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
uiItemL(row, IFACE_("Gain"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
uiItemL(row, IFACE_("Lift"), ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "master_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "highlights_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "shadows_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
uiItemR(row, ptr, "midtones_start", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "midtones_end", 0, NULL, ICON_NONE);
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_composit_buts_switch(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "check", 0, NULL, ICON_NONE);
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_switch_view_ex(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *UNUSED(ptr))
|
2015-04-06 10:40:12 -03:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemFullO(layout,
|
|
|
|
"NODE_OT_switch_view_update",
|
|
|
|
"Update Views",
|
|
|
|
ICON_FILE_REFRESH,
|
|
|
|
NULL,
|
|
|
|
WM_OP_INVOKE_DEFAULT,
|
|
|
|
0,
|
|
|
|
NULL);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
static void node_composit_buts_boxmask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "x", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "y", 0, NULL, ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "rotation", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "mask_type", 0, NULL, ICON_NONE);
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_composit_buts_bokehimage(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "flaps", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "angle", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "rounding", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "catadioptric", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "shift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
2012-08-14 14:31:39 +00:00
|
|
|
static void node_composit_buts_bokehblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_variable_size", 0, NULL, ICON_NONE);
|
|
|
|
// uiItemR(layout, ptr, "f_stop", 0, NULL, ICON_NONE); // UNUSED
|
|
|
|
uiItemR(layout, ptr, "blur_max", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "use_extended_bounds", 0, NULL, ICON_NONE);
|
2012-08-14 14:31:39 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_backdrop_viewer(
|
|
|
|
SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
// node_composit_backdrop_canvas(snode, backdrop, node, x, y);
|
|
|
|
if (node->custom1 == 0) {
|
|
|
|
const float backdropWidth = backdrop->x;
|
|
|
|
const float backdropHeight = backdrop->y;
|
|
|
|
const float cx = x + snode->zoom * backdropWidth * node->custom3;
|
|
|
|
const float cy = y + snode->zoom * backdropHeight * node->custom4;
|
|
|
|
const float cross_size = 12 * U.pixelsize;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
GPUVertFormat *format = immVertexFormat();
|
|
|
|
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immUniformColor3f(1.0f, 1.0f, 1.0f);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immBegin(GPU_PRIM_LINES, 4);
|
|
|
|
immVertex2f(pos, cx - cross_size, cy - cross_size);
|
|
|
|
immVertex2f(pos, cx + cross_size, cy + cross_size);
|
|
|
|
immVertex2f(pos, cx + cross_size, cy - cross_size);
|
|
|
|
immVertex2f(pos, cx - cross_size, cy + cross_size);
|
|
|
|
immEnd();
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immUnbindProgram();
|
|
|
|
}
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_backdrop_boxmask(
|
|
|
|
SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
NodeBoxMask *boxmask = node->storage;
|
|
|
|
const float backdropWidth = backdrop->x;
|
|
|
|
const float backdropHeight = backdrop->y;
|
|
|
|
const float aspect = backdropWidth / backdropHeight;
|
|
|
|
const float rad = -boxmask->rotation;
|
|
|
|
const float cosine = cosf(rad);
|
|
|
|
const float sine = sinf(rad);
|
|
|
|
const float halveBoxWidth = backdropWidth * (boxmask->width / 2.0f);
|
|
|
|
const float halveBoxHeight = backdropHeight * (boxmask->height / 2.0f) * aspect;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
float cx, cy, x1, x2, x3, x4;
|
|
|
|
float y1, y2, y3, y4;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
cx = x + snode->zoom * backdropWidth * boxmask->x;
|
|
|
|
cy = y + snode->zoom * backdropHeight * boxmask->y;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
x1 = cx - (cosine * halveBoxWidth + sine * halveBoxHeight) * snode->zoom;
|
|
|
|
x2 = cx - (cosine * -halveBoxWidth + sine * halveBoxHeight) * snode->zoom;
|
|
|
|
x3 = cx - (cosine * -halveBoxWidth + sine * -halveBoxHeight) * snode->zoom;
|
|
|
|
x4 = cx - (cosine * halveBoxWidth + sine * -halveBoxHeight) * snode->zoom;
|
|
|
|
y1 = cy - (-sine * halveBoxWidth + cosine * halveBoxHeight) * snode->zoom;
|
|
|
|
y2 = cy - (-sine * -halveBoxWidth + cosine * halveBoxHeight) * snode->zoom;
|
|
|
|
y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom;
|
|
|
|
y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
GPUVertFormat *format = immVertexFormat();
|
|
|
|
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immUniformColor3f(1.0f, 1.0f, 1.0f);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immBegin(GPU_PRIM_LINE_LOOP, 4);
|
|
|
|
immVertex2f(pos, x1, y1);
|
|
|
|
immVertex2f(pos, x2, y2);
|
|
|
|
immVertex2f(pos, x3, y3);
|
|
|
|
immVertex2f(pos, x4, y4);
|
|
|
|
immEnd();
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immUnbindProgram();
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_backdrop_ellipsemask(
|
|
|
|
SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
NodeEllipseMask *ellipsemask = node->storage;
|
|
|
|
const float backdropWidth = backdrop->x;
|
|
|
|
const float backdropHeight = backdrop->y;
|
|
|
|
const float aspect = backdropWidth / backdropHeight;
|
|
|
|
const float rad = -ellipsemask->rotation;
|
|
|
|
const float cosine = cosf(rad);
|
|
|
|
const float sine = sinf(rad);
|
|
|
|
const float halveBoxWidth = backdropWidth * (ellipsemask->width / 2.0f);
|
|
|
|
const float halveBoxHeight = backdropHeight * (ellipsemask->height / 2.0f) * aspect;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
float cx, cy, x1, x2, x3, x4;
|
|
|
|
float y1, y2, y3, y4;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
cx = x + snode->zoom * backdropWidth * ellipsemask->x;
|
|
|
|
cy = y + snode->zoom * backdropHeight * ellipsemask->y;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
x1 = cx - (cosine * halveBoxWidth + sine * halveBoxHeight) * snode->zoom;
|
|
|
|
x2 = cx - (cosine * -halveBoxWidth + sine * halveBoxHeight) * snode->zoom;
|
|
|
|
x3 = cx - (cosine * -halveBoxWidth + sine * -halveBoxHeight) * snode->zoom;
|
|
|
|
x4 = cx - (cosine * halveBoxWidth + sine * -halveBoxHeight) * snode->zoom;
|
|
|
|
y1 = cy - (-sine * halveBoxWidth + cosine * halveBoxHeight) * snode->zoom;
|
|
|
|
y2 = cy - (-sine * -halveBoxWidth + cosine * halveBoxHeight) * snode->zoom;
|
|
|
|
y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom;
|
|
|
|
y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom;
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
GPUVertFormat *format = immVertexFormat();
|
|
|
|
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immUniformColor3f(1.0f, 1.0f, 1.0f);
|
2016-12-01 17:07:39 +01:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immBegin(GPU_PRIM_LINE_LOOP, 4);
|
|
|
|
immVertex2f(pos, x1, y1);
|
|
|
|
immVertex2f(pos, x2, y2);
|
|
|
|
immVertex2f(pos, x3, y3);
|
|
|
|
immVertex2f(pos, x4, y4);
|
|
|
|
immEnd();
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
immUnbindProgram();
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_composit_buts_ellipsemask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row;
|
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "x", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "y", 0, NULL, ICON_NONE);
|
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
uiItemR(row, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "rotation", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "mask_type", 0, NULL, ICON_NONE);
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
2013-02-10 12:20:10 +00:00
|
|
|
static void node_composit_buts_composite(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_alpha", 0, NULL, ICON_NONE);
|
2013-02-10 12:20:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_composit_buts_viewer(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_alpha", 0, NULL, ICON_NONE);
|
2013-02-10 12:20:10 +00:00
|
|
|
}
|
|
|
|
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_composit_buts_viewer_ex(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_alpha", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "tile_order", 0, NULL, ICON_NONE);
|
|
|
|
if (RNA_enum_get(ptr, "tile_order") == 0) {
|
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "center_x", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "center_y", 0, NULL, ICON_NONE);
|
|
|
|
}
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
}
|
|
|
|
|
2012-06-04 16:42:58 +00:00
|
|
|
static void node_composit_buts_mask(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
2012-07-27 09:32:47 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(layout, C, ptr, "mask", NULL, NULL, NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
|
|
|
uiItemR(layout, ptr, "use_feather", 0, NULL, ICON_NONE);
|
2012-06-13 19:57:23 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "size_source", 0, "", ICON_NONE);
|
2012-07-26 13:29:38 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (node->custom1 & (CMP_NODEFLAG_MASK_FIXED | CMP_NODEFLAG_MASK_FIXED_SCENE)) {
|
|
|
|
uiItemR(layout, ptr, "size_x", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "size_y", 0, NULL, ICON_NONE);
|
|
|
|
}
|
2012-07-27 09:32:47 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_motion_blur", 0, NULL, ICON_NONE);
|
|
|
|
if (node->custom1 & CMP_NODEFLAG_MASK_MOTION_BLUR) {
|
|
|
|
uiItemR(layout, ptr, "motion_blur_samples", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "motion_blur_shutter", 0, NULL, ICON_NONE);
|
|
|
|
}
|
2012-06-04 16:42:58 +00:00
|
|
|
}
|
|
|
|
|
2012-06-14 12:18:42 +00:00
|
|
|
static void node_composit_buts_keyingscreen(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
2012-06-14 12:18:42 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(layout, C, ptr, "clip", NULL, NULL, NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
2012-06-14 12:18:42 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (node->id) {
|
|
|
|
MovieClip *clip = (MovieClip *)node->id;
|
|
|
|
uiLayout *col;
|
|
|
|
PointerRNA tracking_ptr;
|
2012-06-14 12:18:42 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
RNA_pointer_create(&clip->id, &RNA_MovieTracking, &clip->tracking, &tracking_ptr);
|
2012-06-14 12:18:42 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
|
|
|
|
}
|
2012-06-14 12:18:42 +00:00
|
|
|
}
|
|
|
|
|
2012-05-29 14:00:47 +00:00
|
|
|
static void node_composit_buts_keying(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
/* bNode *node = ptr->data; */ /* UNUSED */
|
2012-05-29 14:00:47 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "blur_pre", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "screen_balance", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "despill_factor", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "despill_balance", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "edge_kernel_radius", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "edge_kernel_tolerance", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "clip_black", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "clip_white", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "dilate_distance", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "feather_falloff", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "feather_distance", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "blur_post", 0, NULL, ICON_NONE);
|
2012-05-29 14:00:47 +00:00
|
|
|
}
|
|
|
|
|
2012-06-19 17:29:58 +00:00
|
|
|
static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
2012-06-19 17:29:58 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(
|
|
|
|
layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
2012-06-19 17:29:58 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (node->id) {
|
|
|
|
MovieClip *clip = (MovieClip *)node->id;
|
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingObject *object;
|
|
|
|
uiLayout *col;
|
|
|
|
PointerRNA tracking_ptr;
|
|
|
|
NodeTrackPosData *data = node->storage;
|
2012-06-19 17:29:58 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
RNA_pointer_create(&clip->id, &RNA_MovieTracking, tracking, &tracking_ptr);
|
2012-06-19 17:29:58 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
|
2012-06-19 17:29:58 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
object = BKE_tracking_object_get_named(tracking, data->tracking_object);
|
|
|
|
if (object) {
|
|
|
|
PointerRNA object_ptr;
|
2012-06-19 17:29:58 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
RNA_pointer_create(&clip->id, &RNA_MovieTrackingObject, object, &object_ptr);
|
2012-06-19 17:29:58 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemPointerR(col, ptr, "track_name", &object_ptr, "tracks", "", ICON_ANIM_DATA);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(layout, ptr, "track_name", 0, "", ICON_ANIM_DATA);
|
|
|
|
}
|
2012-07-10 11:01:25 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "position", 0, NULL, ICON_NONE);
|
2012-07-27 11:07:12 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (ELEM(node->custom1, CMP_TRACKPOS_RELATIVE_FRAME, CMP_TRACKPOS_ABSOLUTE_FRAME)) {
|
|
|
|
uiItemR(layout, ptr, "frame_relative", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
}
|
2012-06-19 17:29:58 +00:00
|
|
|
}
|
|
|
|
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
static void node_composit_buts_planetrackdeform(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
NodePlaneTrackDeformData *data = node->storage;
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(
|
|
|
|
layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (node->id) {
|
|
|
|
MovieClip *clip = (MovieClip *)node->id;
|
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingObject *object;
|
|
|
|
uiLayout *col;
|
|
|
|
PointerRNA tracking_ptr;
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
RNA_pointer_create(&clip->id, &RNA_MovieTracking, tracking, &tracking_ptr);
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
object = BKE_tracking_object_get_named(tracking, data->tracking_object);
|
|
|
|
if (object) {
|
|
|
|
PointerRNA object_ptr;
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
RNA_pointer_create(&clip->id, &RNA_MovieTrackingObject, object, &object_ptr);
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemPointerR(
|
|
|
|
col, ptr, "plane_track_name", &object_ptr, "plane_tracks", "", ICON_ANIM_DATA);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiItemR(layout, ptr, "plane_track_name", 0, "", ICON_ANIM_DATA);
|
|
|
|
}
|
|
|
|
}
|
2015-02-04 01:16:28 +05:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_motion_blur", 0, NULL, ICON_NONE);
|
|
|
|
if (data->flag & CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR) {
|
|
|
|
uiItemR(layout, ptr, "motion_blur_samples", 0, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "motion_blur_shutter", 0, NULL, ICON_NONE);
|
|
|
|
}
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_cornerpin(uiLayout *UNUSED(layout),
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *UNUSED(ptr))
|
2014-03-11 14:07:49 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-07-26 12:59:29 +02:00
|
|
|
static void node_composit_buts_sunbeams(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "source", UI_ITEM_R_EXPAND, "", ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "ray_length", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
2014-07-26 12:59:29 +02:00
|
|
|
}
|
|
|
|
|
2018-07-18 13:03:09 +02:00
|
|
|
static void node_composit_buts_cryptomatte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col = uiLayoutColumn(layout, true);
|
2018-07-18 13:03:09 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemL(col, IFACE_("Matte Objects:"), ICON_NONE);
|
2018-07-18 13:03:09 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *row = uiLayoutRow(col, true);
|
|
|
|
uiTemplateCryptoPicker(row, ptr, "add");
|
|
|
|
uiTemplateCryptoPicker(row, ptr, "remove");
|
2018-07-18 13:03:09 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(col, ptr, "matte_id", 0, "", ICON_NONE);
|
2018-07-18 13:03:09 +02:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_cryptomatte_ex(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *UNUSED(ptr))
|
2018-07-18 13:03:09 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemO(layout, IFACE_("Add Crypto Layer"), ICON_ADD, "NODE_OT_cryptomatte_layer_add");
|
|
|
|
uiItemO(layout, IFACE_("Remove Crypto Layer"), ICON_REMOVE, "NODE_OT_cryptomatte_layer_remove");
|
2018-07-18 13:03:09 +02:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_composit_buts_brightcontrast(uiLayout *layout,
|
|
|
|
bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr)
|
2017-05-22 17:12:13 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "use_premultiply", 0, NULL, ICON_NONE);
|
2017-05-22 17:12:13 +02:00
|
|
|
}
|
|
|
|
|
Compositor: Added denoising node
This node is built on Intel's OpenImageDenoise library.
Other denoisers could be integrated, for example Lukas' Cycles denoiser.
Compositor: Made OpenImageDenoise optional, added CMake and build_env files to find OIDN
Compositor: Fixed some warnings in the denoising operator
build_environment: Updated OpenImageDenoise to 0.8.1
build_environment: Updated OpenImageDenoise in `make deps` for macOS
Reviewers: sergey, jbakker, brecht
Reviewed By: brecht
Subscribers: YAFU, LazyDodo, Zen_YS, slumber, samgreen, tjvoll, yeus, ponomarovmax, getrad, coder.kalyan, vitos1k, Yegor, DeepBlender, kumaran7, Darkfie9825, aliasguru, aafra, ace_dragon, juang3d, pandrodor, cdog, lordodin, jtheninja, mavek, marcog, 5k1n2, Atair, rawalanche, 0o00o0oo, filibis, poor, lukasstockner97
Tags: #compositing
Differential Revision: https://developer.blender.org/D4304
2019-08-14 15:30:26 +02:00
|
|
|
static void node_composit_buts_denoise(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
#ifndef WITH_OPENIMAGEDENOISE
|
|
|
|
uiItemL(layout, IFACE_("Disabled, built without OpenImageDenoise"), ICON_ERROR);
|
2019-08-27 14:03:49 +02:00
|
|
|
#else
|
|
|
|
if (!BLI_cpu_support_sse41()) {
|
|
|
|
uiItemL(layout, IFACE_("Disabled, CPU with SSE4.1 is required"), ICON_ERROR);
|
|
|
|
}
|
Compositor: Added denoising node
This node is built on Intel's OpenImageDenoise library.
Other denoisers could be integrated, for example Lukas' Cycles denoiser.
Compositor: Made OpenImageDenoise optional, added CMake and build_env files to find OIDN
Compositor: Fixed some warnings in the denoising operator
build_environment: Updated OpenImageDenoise to 0.8.1
build_environment: Updated OpenImageDenoise in `make deps` for macOS
Reviewers: sergey, jbakker, brecht
Reviewed By: brecht
Subscribers: YAFU, LazyDodo, Zen_YS, slumber, samgreen, tjvoll, yeus, ponomarovmax, getrad, coder.kalyan, vitos1k, Yegor, DeepBlender, kumaran7, Darkfie9825, aliasguru, aafra, ace_dragon, juang3d, pandrodor, cdog, lordodin, jtheninja, mavek, marcog, 5k1n2, Atair, rawalanche, 0o00o0oo, filibis, poor, lukasstockner97
Tags: #compositing
Differential Revision: https://developer.blender.org/D4304
2019-08-14 15:30:26 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
uiItemR(layout, ptr, "use_hdr", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
/* only once called */
|
|
|
|
static void node_composit_set_butfunc(bNodeType *ntype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
switch (ntype->type) {
|
|
|
|
case CMP_NODE_IMAGE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_image;
|
|
|
|
ntype->draw_buttons_ex = node_composit_buts_image_ex;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_R_LAYERS:
|
|
|
|
ntype->draw_buttons = node_composit_buts_viewlayers;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_NORMAL:
|
|
|
|
ntype->draw_buttons = node_buts_normal;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_CURVE_VEC:
|
|
|
|
ntype->draw_buttons = node_buts_curvevec;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_CURVE_RGB:
|
|
|
|
ntype->draw_buttons = node_buts_curvecol;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_VALUE:
|
|
|
|
ntype->draw_buttons = node_buts_value;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_RGB:
|
|
|
|
ntype->draw_buttons = node_buts_rgb;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_FLIP:
|
|
|
|
ntype->draw_buttons = node_composit_buts_flip;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_SPLITVIEWER:
|
|
|
|
ntype->draw_buttons = node_composit_buts_splitviewer;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MIX_RGB:
|
|
|
|
ntype->draw_buttons = node_buts_mix_rgb;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_VALTORGB:
|
|
|
|
ntype->draw_buttons = node_buts_colorramp;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_CROP:
|
|
|
|
ntype->draw_buttons = node_composit_buts_crop;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_BLUR:
|
|
|
|
ntype->draw_buttons = node_composit_buts_blur;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_DBLUR:
|
|
|
|
ntype->draw_buttons = node_composit_buts_dblur;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_BILATERALBLUR:
|
|
|
|
ntype->draw_buttons = node_composit_buts_bilateralblur;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_DEFOCUS:
|
|
|
|
ntype->draw_buttons = node_composit_buts_defocus;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_GLARE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_glare;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_TONEMAP:
|
|
|
|
ntype->draw_buttons = node_composit_buts_tonemap;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_LENSDIST:
|
|
|
|
ntype->draw_buttons = node_composit_buts_lensdist;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_VECBLUR:
|
|
|
|
ntype->draw_buttons = node_composit_buts_vecblur;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_FILTER:
|
|
|
|
ntype->draw_buttons = node_composit_buts_filter;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MAP_VALUE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_map_value;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MAP_RANGE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_map_range;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_TIME:
|
|
|
|
ntype->draw_buttons = node_buts_time;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_ALPHAOVER:
|
|
|
|
ntype->draw_buttons = node_composit_buts_alphaover;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_TEXTURE:
|
|
|
|
ntype->draw_buttons = node_buts_texture;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_DILATEERODE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_dilateerode;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_INPAINT:
|
|
|
|
ntype->draw_buttons = node_composit_buts_inpaint;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_DESPECKLE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_despeckle;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_OUTPUT_FILE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_file_output;
|
|
|
|
ntype->draw_buttons_ex = node_composit_buts_file_output_ex;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_DIFF_MATTE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_diff_matte;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_DIST_MATTE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_distance_matte;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_COLOR_SPILL:
|
|
|
|
ntype->draw_buttons = node_composit_buts_color_spill;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_CHROMA_MATTE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_chroma_matte;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_COLOR_MATTE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_color_matte;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_SCALE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_scale;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_ROTATE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_rotate;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_CHANNEL_MATTE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_channel_matte;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_LUMA_MATTE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_luma_matte;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MAP_UV:
|
|
|
|
ntype->draw_buttons = node_composit_buts_map_uv;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_ID_MASK:
|
|
|
|
ntype->draw_buttons = node_composit_buts_id_mask;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_DOUBLEEDGEMASK:
|
|
|
|
ntype->draw_buttons = node_composit_buts_double_edge_mask;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MATH:
|
|
|
|
ntype->draw_buttons = node_buts_math;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_INVERT:
|
|
|
|
ntype->draw_buttons = node_composit_buts_invert;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_PREMULKEY:
|
|
|
|
ntype->draw_buttons = node_composit_buts_premulkey;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_VIEW_LEVELS:
|
|
|
|
ntype->draw_buttons = node_composit_buts_view_levels;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_COLORBALANCE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_colorbalance;
|
|
|
|
ntype->draw_buttons_ex = node_composit_buts_colorbalance_ex;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_HUECORRECT:
|
|
|
|
ntype->draw_buttons = node_composit_buts_huecorrect;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_ZCOMBINE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_zcombine;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_COMBYCCA:
|
|
|
|
case CMP_NODE_SEPYCCA:
|
|
|
|
ntype->draw_buttons = node_composit_buts_ycc;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MOVIECLIP:
|
|
|
|
ntype->draw_buttons = node_composit_buts_movieclip;
|
|
|
|
ntype->draw_buttons_ex = node_composit_buts_movieclip_ex;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_STABILIZE2D:
|
|
|
|
ntype->draw_buttons = node_composit_buts_stabilize2d;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_TRANSFORM:
|
|
|
|
ntype->draw_buttons = node_composit_buts_transform;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_TRANSLATE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_translate;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MOVIEDISTORTION:
|
|
|
|
ntype->draw_buttons = node_composit_buts_moviedistortion;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_COLORCORRECTION:
|
|
|
|
ntype->draw_buttons = node_composit_buts_colorcorrection;
|
|
|
|
ntype->draw_buttons_ex = node_composit_buts_colorcorrection_ex;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_SWITCH:
|
|
|
|
ntype->draw_buttons = node_composit_buts_switch;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_SWITCH_VIEW:
|
|
|
|
ntype->draw_buttons_ex = node_composit_buts_switch_view_ex;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MASK_BOX:
|
|
|
|
ntype->draw_buttons = node_composit_buts_boxmask;
|
|
|
|
ntype->draw_backdrop = node_composit_backdrop_boxmask;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MASK_ELLIPSE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_ellipsemask;
|
|
|
|
ntype->draw_backdrop = node_composit_backdrop_ellipsemask;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_BOKEHIMAGE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_bokehimage;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_BOKEHBLUR:
|
|
|
|
ntype->draw_buttons = node_composit_buts_bokehblur;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_VIEWER:
|
|
|
|
ntype->draw_buttons = node_composit_buts_viewer;
|
|
|
|
ntype->draw_buttons_ex = node_composit_buts_viewer_ex;
|
|
|
|
ntype->draw_backdrop = node_composit_backdrop_viewer;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_COMPOSITE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_composite;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_MASK:
|
|
|
|
ntype->draw_buttons = node_composit_buts_mask;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_KEYINGSCREEN:
|
|
|
|
ntype->draw_buttons = node_composit_buts_keyingscreen;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_KEYING:
|
|
|
|
ntype->draw_buttons = node_composit_buts_keying;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_TRACKPOS:
|
|
|
|
ntype->draw_buttons = node_composit_buts_trackpos;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_PLANETRACKDEFORM:
|
|
|
|
ntype->draw_buttons = node_composit_buts_planetrackdeform;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_CORNERPIN:
|
|
|
|
ntype->draw_buttons = node_composit_buts_cornerpin;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_SUNBEAMS:
|
|
|
|
ntype->draw_buttons = node_composit_buts_sunbeams;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_CRYPTOMATTE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_cryptomatte;
|
|
|
|
ntype->draw_buttons_ex = node_composit_buts_cryptomatte_ex;
|
|
|
|
break;
|
|
|
|
case CMP_NODE_BRIGHTCONTRAST:
|
|
|
|
ntype->draw_buttons = node_composit_buts_brightcontrast;
|
Compositor: Added denoising node
This node is built on Intel's OpenImageDenoise library.
Other denoisers could be integrated, for example Lukas' Cycles denoiser.
Compositor: Made OpenImageDenoise optional, added CMake and build_env files to find OIDN
Compositor: Fixed some warnings in the denoising operator
build_environment: Updated OpenImageDenoise to 0.8.1
build_environment: Updated OpenImageDenoise in `make deps` for macOS
Reviewers: sergey, jbakker, brecht
Reviewed By: brecht
Subscribers: YAFU, LazyDodo, Zen_YS, slumber, samgreen, tjvoll, yeus, ponomarovmax, getrad, coder.kalyan, vitos1k, Yegor, DeepBlender, kumaran7, Darkfie9825, aliasguru, aafra, ace_dragon, juang3d, pandrodor, cdog, lordodin, jtheninja, mavek, marcog, 5k1n2, Atair, rawalanche, 0o00o0oo, filibis, poor, lukasstockner97
Tags: #compositing
Differential Revision: https://developer.blender.org/D4304
2019-08-14 15:30:26 +02:00
|
|
|
break;
|
|
|
|
case CMP_NODE_DENOISE:
|
|
|
|
ntype->draw_buttons = node_composit_buts_denoise;
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ****************** BUTTON CALLBACKS FOR TEXTURE NODES ***************** */
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_texture_buts_bricks(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiLayout *col;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "offset", UI_ITEM_R_SLIDER, IFACE_("Offset"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "offset_frequency", 0, IFACE_("Frequency"), ICON_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
col = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(col, ptr, "squash", 0, IFACE_("Squash"), ICON_NONE);
|
|
|
|
uiItemR(col, ptr, "squash_frequency", 0, IFACE_("Frequency"), ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
PointerRNA tex_ptr;
|
|
|
|
bNode *node = ptr->data;
|
2019-08-23 09:52:12 +02:00
|
|
|
ID *id = ptr->owner_id;
|
2019-04-17 06:17:24 +02:00
|
|
|
Tex *tex = (Tex *)node->storage;
|
|
|
|
uiLayout *col, *row;
|
|
|
|
|
|
|
|
RNA_pointer_create(id, &RNA_Texture, tex, &tex_ptr);
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, false);
|
|
|
|
|
|
|
|
switch (tex->type) {
|
|
|
|
case TEX_BLEND:
|
|
|
|
uiItemR(col, &tex_ptr, "progression", 0, "", ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "use_flip_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TEX_MARBLE:
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "marble_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "noise_basis_2", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TEX_MAGIC:
|
|
|
|
uiItemR(col, &tex_ptr, "noise_depth", 0, NULL, ICON_NONE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TEX_STUCCI:
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "stucci_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TEX_WOOD:
|
|
|
|
uiItemR(col, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
|
|
|
|
uiItemR(col, &tex_ptr, "wood_type", 0, "", ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "noise_basis_2", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiLayoutSetActive(row, !(ELEM(tex->stype, TEX_BAND, TEX_RING)));
|
|
|
|
uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TEX_CLOUDS:
|
|
|
|
uiItemR(col, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "cloud_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
row = uiLayoutRow(col, false);
|
|
|
|
uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
uiItemR(col, &tex_ptr, "noise_depth", UI_ITEM_R_EXPAND, IFACE_("Depth"), ICON_NONE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TEX_DISTNOISE:
|
|
|
|
uiItemR(col, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
|
|
|
|
uiItemR(col, &tex_ptr, "noise_distortion", 0, "", ICON_NONE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TEX_MUSGRAVE:
|
|
|
|
uiItemR(col, &tex_ptr, "musgrave_type", 0, "", ICON_NONE);
|
|
|
|
uiItemR(col, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
|
|
|
|
break;
|
|
|
|
case TEX_VORONOI:
|
|
|
|
uiItemR(col, &tex_ptr, "distance_metric", 0, "", ICON_NONE);
|
|
|
|
if (tex->vn_distm == TEX_MINKOVSKY) {
|
|
|
|
uiItemR(col, &tex_ptr, "minkovsky_exponent", 0, NULL, ICON_NONE);
|
|
|
|
}
|
|
|
|
uiItemR(col, &tex_ptr, "color_mode", 0, "", ICON_NONE);
|
|
|
|
break;
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-16 02:40:31 +00:00
|
|
|
static void node_texture_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateID(layout,
|
|
|
|
C,
|
|
|
|
ptr,
|
|
|
|
"image",
|
|
|
|
"IMAGE_OT_new",
|
|
|
|
"IMAGE_OT_open",
|
|
|
|
NULL,
|
|
|
|
UI_TEMPLATE_ID_FILTER_ALL,
|
|
|
|
false);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2013-10-10 11:33:20 +00:00
|
|
|
static void node_texture_buts_image_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
2013-07-22 08:56:51 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
PointerRNA iuserptr;
|
2013-07-22 08:56:51 +00:00
|
|
|
|
2019-08-23 09:52:12 +02:00
|
|
|
RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr);
|
2019-04-17 06:17:24 +02:00
|
|
|
uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0, 0);
|
2013-07-22 08:56:51 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 01:22:14 +00:00
|
|
|
static void node_texture_buts_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemR(layout, ptr, "filepath", 0, "", ICON_NONE);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* only once called */
|
|
|
|
static void node_texture_set_butfunc(bNodeType *ntype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
if (ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX) {
|
|
|
|
ntype->draw_buttons = node_texture_buts_proc;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
switch (ntype->type) {
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_MATH:
|
|
|
|
ntype->draw_buttons = node_buts_math;
|
|
|
|
break;
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_MIX_RGB:
|
|
|
|
ntype->draw_buttons = node_buts_mix_rgb;
|
|
|
|
break;
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_VALTORGB:
|
|
|
|
ntype->draw_buttons = node_buts_colorramp;
|
|
|
|
break;
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_CURVE_RGB:
|
|
|
|
ntype->draw_buttons = node_buts_curvecol;
|
|
|
|
break;
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_CURVE_TIME:
|
|
|
|
ntype->draw_buttons = node_buts_time;
|
|
|
|
break;
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_TEXTURE:
|
|
|
|
ntype->draw_buttons = node_buts_texture;
|
|
|
|
break;
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_BRICKS:
|
|
|
|
ntype->draw_buttons = node_texture_buts_bricks;
|
|
|
|
break;
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_IMAGE:
|
|
|
|
ntype->draw_buttons = node_texture_buts_image;
|
|
|
|
ntype->draw_buttons_ex = node_texture_buts_image_ex;
|
|
|
|
break;
|
2012-04-28 06:31:57 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
case TEX_NODE_OUTPUT:
|
|
|
|
ntype->draw_buttons = node_texture_buts_output;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2019-01-15 23:24:20 +11:00
|
|
|
/* ****** init draw callbacks for all tree types, only called in usiblender.c, once ************ */
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
static void node_property_update_default(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
|
2008-12-24 10:33:10 +00:00
|
|
|
{
|
2019-08-23 09:52:12 +02:00
|
|
|
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node = ptr->data;
|
|
|
|
ED_node_tag_update_nodetree(bmain, ntree, node);
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_socket_template_properties_update(bNodeType *ntype, bNodeSocketTemplate *stemp)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
StructRNA *srna = ntype->ext.srna;
|
|
|
|
PropertyRNA *prop = RNA_struct_type_find_property(srna, stemp->identifier);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (prop) {
|
|
|
|
RNA_def_property_update_runtime(prop, node_property_update_default);
|
|
|
|
}
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void node_template_properties_update(bNodeType *ntype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNodeSocketTemplate *stemp;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (ntype->inputs) {
|
|
|
|
for (stemp = ntype->inputs; stemp->type >= 0; ++stemp) {
|
|
|
|
node_socket_template_properties_update(ntype, stemp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ntype->outputs) {
|
|
|
|
for (stemp = ntype->outputs; stemp->type >= 0; ++stemp) {
|
|
|
|
node_socket_template_properties_update(ntype, stemp);
|
|
|
|
}
|
|
|
|
}
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_socket_undefined_draw(bContext *UNUSED(C),
|
|
|
|
uiLayout *layout,
|
|
|
|
PointerRNA *UNUSED(ptr),
|
|
|
|
PointerRNA *UNUSED(node_ptr),
|
2013-05-08 14:58:41 +00:00
|
|
|
const char *UNUSED(text))
|
2013-03-19 13:40:16 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemL(layout, IFACE_("Undefined Socket Type"), ICON_ERROR);
|
2013-03-19 13:40:16 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_socket_undefined_draw_color(bContext *UNUSED(C),
|
|
|
|
PointerRNA *UNUSED(ptr),
|
|
|
|
PointerRNA *UNUSED(node_ptr),
|
|
|
|
float *r_color)
|
2013-03-19 13:40:16 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
r_color[0] = 1.0f;
|
|
|
|
r_color[1] = 0.0f;
|
|
|
|
r_color[2] = 0.0f;
|
|
|
|
r_color[3] = 1.0f;
|
2013-03-19 13:40:16 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_socket_undefined_interface_draw(bContext *UNUSED(C),
|
|
|
|
uiLayout *layout,
|
|
|
|
PointerRNA *UNUSED(ptr))
|
2013-03-19 13:40:16 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
uiItemL(layout, IFACE_("Undefined Socket Type"), ICON_ERROR);
|
2013-03-19 13:40:16 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_socket_undefined_interface_draw_color(bContext *UNUSED(C),
|
|
|
|
PointerRNA *UNUSED(ptr),
|
|
|
|
float *r_color)
|
2013-03-19 13:40:16 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
r_color[0] = 1.0f;
|
|
|
|
r_color[1] = 0.0f;
|
|
|
|
r_color[2] = 0.0f;
|
|
|
|
r_color[3] = 1.0f;
|
2013-03-19 13:40:16 +00:00
|
|
|
}
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
void ED_node_init_butfuncs(void)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
/* Fallback types for undefined tree, nodes, sockets
|
|
|
|
* Defined in blenkernel, but not registered in type hashes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* default ui functions */
|
|
|
|
NodeTypeUndefined.draw_nodetype = node_draw_default;
|
|
|
|
NodeTypeUndefined.draw_nodetype_prepare = node_update_default;
|
|
|
|
NodeTypeUndefined.select_area_func = node_select_area_default;
|
|
|
|
NodeTypeUndefined.tweak_area_func = node_tweak_area_default;
|
|
|
|
NodeTypeUndefined.draw_buttons = NULL;
|
|
|
|
NodeTypeUndefined.draw_buttons_ex = NULL;
|
|
|
|
NodeTypeUndefined.resize_area_func = node_resize_area_default;
|
|
|
|
|
|
|
|
NodeSocketTypeUndefined.draw = node_socket_undefined_draw;
|
|
|
|
NodeSocketTypeUndefined.draw_color = node_socket_undefined_draw_color;
|
|
|
|
NodeSocketTypeUndefined.interface_draw = node_socket_undefined_interface_draw;
|
|
|
|
NodeSocketTypeUndefined.interface_draw_color = node_socket_undefined_interface_draw_color;
|
|
|
|
|
|
|
|
/* node type ui functions */
|
|
|
|
NODE_TYPES_BEGIN (ntype) {
|
|
|
|
/* default ui functions */
|
|
|
|
ntype->draw_nodetype = node_draw_default;
|
|
|
|
ntype->draw_nodetype_prepare = node_update_default;
|
|
|
|
ntype->select_area_func = node_select_area_default;
|
|
|
|
ntype->tweak_area_func = node_tweak_area_default;
|
|
|
|
ntype->draw_buttons = NULL;
|
|
|
|
ntype->draw_buttons_ex = NULL;
|
|
|
|
ntype->resize_area_func = node_resize_area_default;
|
|
|
|
|
|
|
|
node_common_set_butfunc(ntype);
|
|
|
|
|
|
|
|
node_composit_set_butfunc(ntype);
|
|
|
|
node_shader_set_butfunc(ntype);
|
|
|
|
node_texture_set_butfunc(ntype);
|
|
|
|
|
|
|
|
/* define update callbacks for socket properties */
|
|
|
|
node_template_properties_update(ntype);
|
|
|
|
}
|
|
|
|
NODE_TYPES_END;
|
|
|
|
|
|
|
|
/* tree type icons */
|
|
|
|
ntreeType_Composite->ui_icon = ICON_NODE_COMPOSITING;
|
|
|
|
ntreeType_Shader->ui_icon = ICON_NODE_MATERIAL;
|
|
|
|
ntreeType_Texture->ui_icon = ICON_NODE_TEXTURE;
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ED_init_custom_node_type(bNodeType *ntype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
/* default ui functions */
|
|
|
|
ntype->draw_nodetype = node_draw_default;
|
|
|
|
ntype->draw_nodetype_prepare = node_update_default;
|
|
|
|
ntype->resize_area_func = node_resize_area_default;
|
|
|
|
ntype->select_area_func = node_select_area_default;
|
|
|
|
ntype->tweak_area_func = node_tweak_area_default;
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ED_init_custom_node_socket_type(bNodeSocketType *stype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
/* default ui functions */
|
|
|
|
stype->draw = node_socket_button_label;
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* maps standard socket integer type to a color */
|
|
|
|
static const float std_node_socket_colors[][4] = {
|
2019-04-17 06:17:24 +02:00
|
|
|
{0.63, 0.63, 0.63, 1.0}, /* SOCK_FLOAT */
|
|
|
|
{0.39, 0.39, 0.78, 1.0}, /* SOCK_VECTOR */
|
|
|
|
{0.78, 0.78, 0.16, 1.0}, /* SOCK_RGBA */
|
|
|
|
{0.39, 0.78, 0.39, 1.0}, /* SOCK_SHADER */
|
|
|
|
{0.70, 0.65, 0.19, 1.0}, /* SOCK_BOOLEAN */
|
|
|
|
{0.0, 0.0, 0.0, 1.0}, /*__SOCK_MESH (deprecated) */
|
|
|
|
{0.06, 0.52, 0.15, 1.0}, /* SOCK_INT */
|
|
|
|
{0.39, 0.39, 0.39, 1.0}, /* SOCK_STRING */
|
2013-03-18 16:34:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* common color callbacks for standard types */
|
2019-04-17 06:17:24 +02:00
|
|
|
static void std_node_socket_draw_color(bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr,
|
|
|
|
PointerRNA *UNUSED(node_ptr),
|
|
|
|
float *r_color)
|
2013-03-18 16:34:57 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNodeSocket *sock = ptr->data;
|
|
|
|
int type = sock->typeinfo->type;
|
|
|
|
copy_v4_v4(r_color, std_node_socket_colors[type]);
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
static void std_node_socket_interface_draw_color(bContext *UNUSED(C),
|
|
|
|
PointerRNA *ptr,
|
|
|
|
float *r_color)
|
2013-03-18 16:34:57 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNodeSocket *sock = ptr->data;
|
|
|
|
int type = sock->typeinfo->type;
|
|
|
|
copy_v4_v4(r_color, std_node_socket_colors[type]);
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
2019-01-15 23:24:20 +11:00
|
|
|
/* draw function for file output node sockets,
|
|
|
|
* displays only sub-path and format, no value button */
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_file_output_socket_draw(bContext *C,
|
|
|
|
uiLayout *layout,
|
|
|
|
PointerRNA *ptr,
|
|
|
|
PointerRNA *node_ptr)
|
|
|
|
{
|
2019-08-23 09:52:12 +02:00
|
|
|
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
|
2019-04-17 06:17:24 +02:00
|
|
|
bNodeSocket *sock = ptr->data;
|
|
|
|
uiLayout *row;
|
|
|
|
PointerRNA inputptr, imfptr;
|
|
|
|
int imtype;
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
|
|
|
|
imfptr = RNA_pointer_get(node_ptr, "format");
|
|
|
|
imtype = RNA_enum_get(&imfptr, "file_format");
|
|
|
|
|
|
|
|
if (imtype == R_IMF_IMTYPE_MULTILAYER) {
|
|
|
|
NodeImageMultiFileSocket *input = sock->storage;
|
|
|
|
RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotLayer, input, &inputptr);
|
|
|
|
|
|
|
|
uiItemL(row, input->layer, ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
NodeImageMultiFileSocket *input = sock->storage;
|
|
|
|
PropertyRNA *imtype_prop;
|
|
|
|
const char *imtype_name;
|
|
|
|
uiBlock *block;
|
|
|
|
RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotFile, input, &inputptr);
|
|
|
|
|
|
|
|
uiItemL(row, input->path, ICON_NONE);
|
|
|
|
|
|
|
|
if (!RNA_boolean_get(&inputptr, "use_node_format")) {
|
|
|
|
imfptr = RNA_pointer_get(&inputptr, "format");
|
|
|
|
}
|
|
|
|
|
|
|
|
imtype_prop = RNA_struct_find_property(&imfptr, "file_format");
|
|
|
|
RNA_property_enum_name((bContext *)C,
|
|
|
|
&imfptr,
|
|
|
|
imtype_prop,
|
|
|
|
RNA_property_enum_get(&imfptr, imtype_prop),
|
|
|
|
&imtype_name);
|
|
|
|
block = uiLayoutGetBlock(row);
|
|
|
|
UI_block_emboss_set(block, UI_EMBOSS_PULLDOWN);
|
|
|
|
uiItemL(row, imtype_name, ICON_NONE);
|
|
|
|
UI_block_emboss_set(block, UI_EMBOSS_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void std_node_socket_draw(
|
|
|
|
bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *node_ptr, const char *text)
|
|
|
|
{
|
|
|
|
bNode *node = node_ptr->data;
|
|
|
|
bNodeSocket *sock = ptr->data;
|
|
|
|
int type = sock->typeinfo->type;
|
|
|
|
/*int subtype = sock->typeinfo->subtype;*/
|
|
|
|
|
|
|
|
/* XXX not nice, eventually give this node its own socket type ... */
|
|
|
|
if (node->type == CMP_NODE_OUTPUT_FILE) {
|
|
|
|
node_file_output_socket_draw(C, layout, ptr, node_ptr);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((sock->in_out == SOCK_OUT) || (sock->flag & SOCK_IN_USE) || (sock->flag & SOCK_HIDE_VALUE)) {
|
|
|
|
node_socket_button_label(C, layout, ptr, node_ptr, text);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case SOCK_FLOAT:
|
|
|
|
case SOCK_INT:
|
|
|
|
case SOCK_BOOLEAN:
|
|
|
|
uiItemR(layout, ptr, "default_value", 0, text, 0);
|
|
|
|
break;
|
|
|
|
case SOCK_VECTOR:
|
2019-08-10 17:37:39 +02:00
|
|
|
if (sock->flag & SOCK_COMPACT) {
|
|
|
|
uiTemplateComponentMenu(layout, ptr, "default_value", text);
|
|
|
|
}
|
|
|
|
else {
|
2019-08-16 17:59:12 +02:00
|
|
|
if (sock->typeinfo->subtype == PROP_DIRECTION) {
|
|
|
|
uiItemR(layout, ptr, "default_value", 0, "", ICON_NONE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uiLayout *column = uiLayoutColumn(layout, true);
|
|
|
|
uiItemR(column, ptr, "default_value", 0, text, ICON_NONE);
|
|
|
|
}
|
2019-08-10 17:37:39 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
break;
|
|
|
|
case SOCK_RGBA:
|
|
|
|
case SOCK_STRING: {
|
|
|
|
uiLayout *row = uiLayoutSplit(layout, 0.5f, false);
|
|
|
|
uiItemL(row, text, 0);
|
|
|
|
uiItemR(row, ptr, "default_value", 0, "", 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
node_socket_button_label(C, layout, ptr, node_ptr, text);
|
|
|
|
break;
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2013-03-28 10:32:04 +00:00
|
|
|
static void std_node_socket_interface_draw(bContext *UNUSED(C), uiLayout *layout, PointerRNA *ptr)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
bNodeSocket *sock = ptr->data;
|
|
|
|
int type = sock->typeinfo->type;
|
|
|
|
/*int subtype = sock->typeinfo->subtype;*/
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case SOCK_FLOAT: {
|
|
|
|
uiLayout *row;
|
|
|
|
uiItemR(layout, ptr, "default_value", 0, NULL, 0);
|
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "min_value", 0, IFACE_("Min"), 0);
|
|
|
|
uiItemR(row, ptr, "max_value", 0, IFACE_("Max"), 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SOCK_INT: {
|
|
|
|
uiLayout *row;
|
|
|
|
uiItemR(layout, ptr, "default_value", 0, NULL, 0);
|
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "min_value", 0, IFACE_("Min"), 0);
|
|
|
|
uiItemR(row, ptr, "max_value", 0, IFACE_("Max"), 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SOCK_VECTOR: {
|
|
|
|
uiLayout *row;
|
|
|
|
uiItemR(layout, ptr, "default_value", UI_ITEM_R_EXPAND, NULL, 0);
|
|
|
|
row = uiLayoutRow(layout, true);
|
|
|
|
uiItemR(row, ptr, "min_value", 0, IFACE_("Min"), 0);
|
|
|
|
uiItemR(row, ptr, "max_value", 0, IFACE_("Max"), 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SOCK_BOOLEAN:
|
|
|
|
case SOCK_RGBA:
|
|
|
|
case SOCK_STRING: {
|
|
|
|
uiItemR(layout, ptr, "default_value", 0, NULL, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2013-03-28 10:32:04 +00:00
|
|
|
}
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
void ED_init_standard_node_socket_type(bNodeSocketType *stype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
stype->draw = std_node_socket_draw;
|
|
|
|
stype->draw_color = std_node_socket_draw_color;
|
|
|
|
stype->interface_draw = std_node_socket_interface_draw;
|
|
|
|
stype->interface_draw_color = std_node_socket_interface_draw_color;
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void node_socket_virtual_draw_color(bContext *UNUSED(C),
|
|
|
|
PointerRNA *UNUSED(ptr),
|
|
|
|
PointerRNA *UNUSED(node_ptr),
|
|
|
|
float *r_color)
|
2013-03-18 16:34:57 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
/* alpha = 0, empty circle */
|
|
|
|
zero_v4(r_color);
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ED_init_node_socket_type_virtual(bNodeSocketType *stype)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
stype->draw = node_socket_button_label;
|
|
|
|
stype->draw_color = node_socket_virtual_draw_color;
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
/* ************** Generic drawing ************** */
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
void draw_nodespace_back_pix(const bContext *C,
|
|
|
|
ARegion *ar,
|
|
|
|
SpaceNode *snode,
|
|
|
|
bNodeInstanceKey parent_key)
|
|
|
|
{
|
|
|
|
Main *bmain = CTX_data_main(C);
|
|
|
|
bNodeInstanceKey active_viewer_key = (snode->nodetree ? snode->nodetree->active_viewer_key :
|
|
|
|
NODE_INSTANCE_KEY_NONE);
|
|
|
|
float shuffle[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
|
|
|
Image *ima;
|
|
|
|
void *lock;
|
|
|
|
ImBuf *ibuf;
|
|
|
|
|
2019-04-23 09:15:45 -06:00
|
|
|
GPU_matrix_push_projection();
|
|
|
|
GPU_matrix_push();
|
|
|
|
wmOrtho2_region_pixelspace(ar);
|
|
|
|
GPU_matrix_identity_set();
|
|
|
|
ED_region_draw_cb_draw(C, ar, REGION_DRAW_BACKDROP);
|
|
|
|
GPU_matrix_pop_projection();
|
|
|
|
GPU_matrix_pop();
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (!(snode->flag & SNODE_BACKDRAW) || !ED_node_is_compositor(snode)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parent_key.value != active_viewer_key.value) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ima = BKE_image_verify_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
|
|
|
|
ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
|
|
|
|
if (ibuf) {
|
|
|
|
float x, y;
|
|
|
|
|
|
|
|
GPU_matrix_push_projection();
|
|
|
|
GPU_matrix_push();
|
|
|
|
|
|
|
|
/* somehow the offset has to be calculated inverse */
|
|
|
|
wmOrtho2_region_pixelspace(ar);
|
|
|
|
|
|
|
|
x = (ar->winx - snode->zoom * ibuf->x) / 2 + snode->xof;
|
|
|
|
y = (ar->winy - snode->zoom * ibuf->y) / 2 + snode->yof;
|
|
|
|
|
|
|
|
if (ibuf->rect || ibuf->rect_float) {
|
|
|
|
unsigned char *display_buffer = NULL;
|
|
|
|
void *cache_handle = NULL;
|
|
|
|
|
|
|
|
if (snode->flag & (SNODE_SHOW_R | SNODE_SHOW_G | SNODE_SHOW_B | SNODE_SHOW_ALPHA)) {
|
|
|
|
|
|
|
|
display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle);
|
|
|
|
|
|
|
|
if (snode->flag & SNODE_SHOW_R) {
|
|
|
|
shuffle[0] = 1.0f;
|
|
|
|
}
|
|
|
|
else if (snode->flag & SNODE_SHOW_G) {
|
|
|
|
shuffle[1] = 1.0f;
|
|
|
|
}
|
|
|
|
else if (snode->flag & SNODE_SHOW_B) {
|
|
|
|
shuffle[2] = 1.0f;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
shuffle[3] = 1.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR);
|
|
|
|
GPU_shader_uniform_vector(
|
|
|
|
state.shader, GPU_shader_get_uniform_ensure(state.shader, "shuffle"), 4, 1, shuffle);
|
|
|
|
|
|
|
|
immDrawPixelsTex(&state,
|
|
|
|
x,
|
|
|
|
y,
|
|
|
|
ibuf->x,
|
|
|
|
ibuf->y,
|
|
|
|
GL_RGBA,
|
|
|
|
GL_UNSIGNED_BYTE,
|
|
|
|
GL_NEAREST,
|
|
|
|
display_buffer,
|
|
|
|
snode->zoom,
|
|
|
|
snode->zoom,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
GPU_shader_unbind();
|
|
|
|
}
|
|
|
|
else if (snode->flag & SNODE_USE_ALPHA) {
|
|
|
|
GPU_blend(true);
|
|
|
|
GPU_blend_set_func_separate(
|
|
|
|
GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
|
|
|
|
|
2019-04-20 12:56:29 +02:00
|
|
|
ED_draw_imbuf_ctx(C, ibuf, x, y, GL_NEAREST, snode->zoom, snode->zoom);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
|
|
|
GPU_blend(false);
|
|
|
|
}
|
|
|
|
else {
|
2019-04-20 12:56:29 +02:00
|
|
|
ED_draw_imbuf_ctx(C, ibuf, x, y, GL_NEAREST, snode->zoom, snode->zoom);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cache_handle) {
|
|
|
|
IMB_display_buffer_release(cache_handle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/** \note draw selected info on backdrop */
|
|
|
|
if (snode->edittree) {
|
|
|
|
bNode *node = snode->edittree->nodes.first;
|
|
|
|
rctf *viewer_border = &snode->nodetree->viewer_border;
|
|
|
|
while (node) {
|
|
|
|
if (node->flag & NODE_SELECT) {
|
|
|
|
if (node->typeinfo->draw_backdrop) {
|
|
|
|
node->typeinfo->draw_backdrop(snode, ibuf, node, x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
node = node->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((snode->nodetree->flag & NTREE_VIEWER_BORDER) &&
|
|
|
|
viewer_border->xmin < viewer_border->xmax && viewer_border->ymin < viewer_border->ymax) {
|
|
|
|
rcti pixel_border;
|
|
|
|
BLI_rcti_init(&pixel_border,
|
|
|
|
x + snode->zoom * viewer_border->xmin * ibuf->x,
|
|
|
|
x + snode->zoom * viewer_border->xmax * ibuf->x,
|
|
|
|
y + snode->zoom * viewer_border->ymin * ibuf->y,
|
|
|
|
y + snode->zoom * viewer_border->ymax * ibuf->y);
|
|
|
|
|
|
|
|
uint pos = GPU_vertformat_attr_add(
|
|
|
|
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
|
|
|
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
|
|
|
|
immUniformThemeColor(TH_ACTIVE);
|
|
|
|
|
|
|
|
immDrawBorderCorners(pos, &pixel_border, 1.0f, 1.0f);
|
|
|
|
|
|
|
|
immUnbindProgram();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GPU_matrix_pop_projection();
|
|
|
|
GPU_matrix_pop();
|
|
|
|
}
|
|
|
|
|
|
|
|
BKE_image_release_ibuf(ima, ibuf, lock);
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2018-04-05 15:41:17 +02:00
|
|
|
/* return quadratic beziers points for a given nodelink and clip if v2d is not NULL. */
|
2019-04-17 06:17:24 +02:00
|
|
|
static bool node_link_bezier_handles(View2D *v2d,
|
|
|
|
SpaceNode *snode,
|
|
|
|
bNodeLink *link,
|
|
|
|
float vec[4][2])
|
|
|
|
{
|
|
|
|
float dist;
|
|
|
|
float deltax, deltay;
|
|
|
|
float cursor[2] = {0.0f, 0.0f};
|
|
|
|
int toreroute, fromreroute;
|
|
|
|
|
|
|
|
/* this function can be called with snode null (via cut_links_intersect) */
|
|
|
|
/* XXX map snode->cursor back to view space */
|
|
|
|
if (snode) {
|
|
|
|
cursor[0] = snode->cursor[0] * UI_DPI_FAC;
|
|
|
|
cursor[1] = snode->cursor[1] * UI_DPI_FAC;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* in v0 and v3 we put begin/end points */
|
|
|
|
if (link->fromsock) {
|
|
|
|
vec[0][0] = link->fromsock->locx;
|
|
|
|
vec[0][1] = link->fromsock->locy;
|
|
|
|
fromreroute = (link->fromnode && link->fromnode->type == NODE_REROUTE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (snode == NULL) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
copy_v2_v2(vec[0], cursor);
|
|
|
|
fromreroute = 0;
|
|
|
|
}
|
|
|
|
if (link->tosock) {
|
|
|
|
vec[3][0] = link->tosock->locx;
|
|
|
|
vec[3][1] = link->tosock->locy;
|
|
|
|
toreroute = (link->tonode && link->tonode->type == NODE_REROUTE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (snode == NULL) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
copy_v2_v2(vec[3], cursor);
|
|
|
|
toreroute = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* may be called outside of drawing (so pass spacetype) */
|
|
|
|
int curving = UI_GetThemeValueType(TH_NODE_CURVING, SPACE_NODE);
|
|
|
|
|
|
|
|
if (curving == 0) {
|
|
|
|
/* Straight line: align all points. */
|
|
|
|
mid_v2_v2v2(vec[1], vec[0], vec[3]);
|
|
|
|
mid_v2_v2v2(vec[2], vec[1], vec[3]);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
dist = curving * 0.10f * fabsf(vec[0][0] - vec[3][0]);
|
|
|
|
deltax = vec[3][0] - vec[0][0];
|
|
|
|
deltay = vec[3][1] - vec[0][1];
|
|
|
|
/* check direction later, for top sockets */
|
|
|
|
if (fromreroute) {
|
|
|
|
if (ABS(deltax) > ABS(deltay)) {
|
|
|
|
vec[1][1] = vec[0][1];
|
|
|
|
vec[1][0] = vec[0][0] + (deltax > 0 ? dist : -dist);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
vec[1][0] = vec[0][0];
|
|
|
|
vec[1][1] = vec[0][1] + (deltay > 0 ? dist : -dist);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
vec[1][0] = vec[0][0] + dist;
|
|
|
|
vec[1][1] = vec[0][1];
|
|
|
|
}
|
|
|
|
if (toreroute) {
|
|
|
|
if (ABS(deltax) > ABS(deltay)) {
|
|
|
|
vec[2][1] = vec[3][1];
|
|
|
|
vec[2][0] = vec[3][0] + (deltax > 0 ? -dist : dist);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
vec[2][0] = vec[3][0];
|
|
|
|
vec[2][1] = vec[3][1] + (deltay > 0 ? -dist : dist);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
vec[2][0] = vec[3][0] - dist;
|
|
|
|
vec[2][1] = vec[3][1];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (v2d && min_ffff(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > v2d->cur.xmax) {
|
|
|
|
return 0; /* clipped */
|
|
|
|
}
|
|
|
|
else if (v2d && max_ffff(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) < v2d->cur.xmin) {
|
|
|
|
return 0; /* clipped */
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
2018-04-05 15:41:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* if v2d not NULL, it clips and returns 0 if not visible */
|
2019-04-17 06:17:24 +02:00
|
|
|
bool node_link_bezier_points(
|
|
|
|
View2D *v2d, SpaceNode *snode, bNodeLink *link, float coord_array[][2], int resol)
|
2018-04-05 15:41:17 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
float vec[4][2];
|
2018-04-05 15:41:17 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (node_link_bezier_handles(v2d, snode, link, vec)) {
|
|
|
|
/* always do all three, to prevent data hanging around */
|
|
|
|
BKE_curve_forward_diff_bezier(
|
|
|
|
vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0] + 0, resol, sizeof(float) * 2);
|
|
|
|
BKE_curve_forward_diff_bezier(
|
|
|
|
vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0] + 1, resol, sizeof(float) * 2);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
2009-02-07 14:03:34 +00:00
|
|
|
}
|
|
|
|
|
2018-04-05 15:41:17 +02:00
|
|
|
#define NODELINK_GROUP_SIZE 256
|
2019-04-17 06:17:24 +02:00
|
|
|
#define LINK_RESOL 24
|
|
|
|
#define LINK_WIDTH (2.5f * UI_DPI_FAC)
|
|
|
|
#define ARROW_SIZE (7 * UI_DPI_FAC)
|
2018-04-05 15:41:17 +02:00
|
|
|
|
2018-04-05 16:07:28 +02:00
|
|
|
static float arrow_verts[3][2] = {{-1.0f, 1.0f}, {0.0f, 0.0f}, {-1.0f, -1.0f}};
|
2018-04-05 15:41:17 +02:00
|
|
|
static float arrow_expand_axis[3][2] = {{0.7071f, 0.7071f}, {M_SQRT2, 0.0f}, {0.7071f, -0.7071f}};
|
|
|
|
|
2018-07-31 20:44:49 +10:00
|
|
|
static struct {
|
2019-04-17 06:17:24 +02:00
|
|
|
GPUBatch *batch; /* for batching line together */
|
|
|
|
GPUBatch *batch_single; /* for single line */
|
|
|
|
GPUVertBuf *inst_vbo;
|
|
|
|
unsigned int p0_id, p1_id, p2_id, p3_id;
|
|
|
|
unsigned int colid_id;
|
|
|
|
GPUVertBufRaw p0_step, p1_step, p2_step, p3_step;
|
|
|
|
GPUVertBufRaw colid_step;
|
|
|
|
unsigned int count;
|
|
|
|
bool enabled;
|
2018-04-05 15:41:17 +02:00
|
|
|
} g_batch_link = {0};
|
|
|
|
|
|
|
|
static void nodelink_batch_reset(void)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
GPU_vertbuf_attr_get_raw_data(g_batch_link.inst_vbo, g_batch_link.p0_id, &g_batch_link.p0_step);
|
|
|
|
GPU_vertbuf_attr_get_raw_data(g_batch_link.inst_vbo, g_batch_link.p1_id, &g_batch_link.p1_step);
|
|
|
|
GPU_vertbuf_attr_get_raw_data(g_batch_link.inst_vbo, g_batch_link.p2_id, &g_batch_link.p2_step);
|
|
|
|
GPU_vertbuf_attr_get_raw_data(g_batch_link.inst_vbo, g_batch_link.p3_id, &g_batch_link.p3_step);
|
|
|
|
GPU_vertbuf_attr_get_raw_data(
|
|
|
|
g_batch_link.inst_vbo, g_batch_link.colid_id, &g_batch_link.colid_step);
|
|
|
|
g_batch_link.count = 0;
|
2018-04-05 15:41:17 +02:00
|
|
|
}
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
static void set_nodelink_vertex(GPUVertBuf *vbo,
|
|
|
|
unsigned int uv_id,
|
|
|
|
unsigned int pos_id,
|
|
|
|
unsigned int exp_id,
|
|
|
|
unsigned int v,
|
|
|
|
const unsigned char uv[2],
|
|
|
|
const float pos[2],
|
|
|
|
const float exp[2])
|
2018-04-05 15:41:17 +02:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
GPU_vertbuf_attr_set(vbo, uv_id, v, uv);
|
|
|
|
GPU_vertbuf_attr_set(vbo, pos_id, v, pos);
|
|
|
|
GPU_vertbuf_attr_set(vbo, exp_id, v, exp);
|
2018-04-05 15:41:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void nodelink_batch_init(void)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
GPUVertFormat format = {0};
|
|
|
|
uint uv_id = GPU_vertformat_attr_add(&format, "uv", GPU_COMP_U8, 2, GPU_FETCH_INT_TO_FLOAT_UNIT);
|
|
|
|
uint pos_id = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
|
|
|
uint expand_id = GPU_vertformat_attr_add(&format, "expand", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
|
|
|
GPUVertBuf *vbo = GPU_vertbuf_create_with_format_ex(&format, GPU_USAGE_STATIC);
|
|
|
|
int vcount = LINK_RESOL * 2; /* curve */
|
|
|
|
vcount += 2; /* restart strip */
|
|
|
|
vcount += 3 * 2; /* arrow */
|
|
|
|
vcount *= 2; /* shadow */
|
|
|
|
vcount += 2; /* restart strip */
|
|
|
|
GPU_vertbuf_data_alloc(vbo, vcount);
|
|
|
|
int v = 0;
|
|
|
|
|
|
|
|
for (int k = 0; k < 2; ++k) {
|
|
|
|
unsigned char uv[2] = {0, 0};
|
|
|
|
float pos[2] = {0.0f, 0.0f};
|
|
|
|
float exp[2] = {0.0f, 1.0f};
|
|
|
|
|
|
|
|
/* restart */
|
|
|
|
if (k == 1) {
|
|
|
|
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* curve strip */
|
|
|
|
for (int i = 0; i < LINK_RESOL; ++i) {
|
|
|
|
uv[0] = 255 * (i / (float)(LINK_RESOL - 1));
|
|
|
|
uv[1] = 0;
|
|
|
|
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
|
|
|
|
uv[1] = 255;
|
|
|
|
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
|
|
|
|
}
|
|
|
|
/* restart */
|
|
|
|
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
|
|
|
|
|
|
|
|
uv[0] = 127;
|
|
|
|
uv[1] = 0;
|
|
|
|
copy_v2_v2(pos, arrow_verts[0]);
|
|
|
|
copy_v2_v2(exp, arrow_expand_axis[0]);
|
|
|
|
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
|
|
|
|
/* arrow */
|
|
|
|
for (int i = 0; i < 3; ++i) {
|
|
|
|
uv[1] = 0;
|
|
|
|
copy_v2_v2(pos, arrow_verts[i]);
|
|
|
|
copy_v2_v2(exp, arrow_expand_axis[i]);
|
|
|
|
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
|
|
|
|
|
|
|
|
uv[1] = 255;
|
|
|
|
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* restart */
|
|
|
|
if (k == 0) {
|
|
|
|
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_batch_link.batch = GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO);
|
|
|
|
gpu_batch_presets_register(g_batch_link.batch);
|
|
|
|
|
|
|
|
g_batch_link.batch_single = GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, 0);
|
|
|
|
gpu_batch_presets_register(g_batch_link.batch_single);
|
|
|
|
|
|
|
|
/* Instances data */
|
|
|
|
GPUVertFormat format_inst = {0};
|
|
|
|
g_batch_link.p0_id = GPU_vertformat_attr_add(
|
|
|
|
&format_inst, "P0", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
|
|
|
g_batch_link.p1_id = GPU_vertformat_attr_add(
|
|
|
|
&format_inst, "P1", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
|
|
|
g_batch_link.p2_id = GPU_vertformat_attr_add(
|
|
|
|
&format_inst, "P2", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
|
|
|
g_batch_link.p3_id = GPU_vertformat_attr_add(
|
|
|
|
&format_inst, "P3", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
|
|
|
g_batch_link.colid_id = GPU_vertformat_attr_add(
|
|
|
|
&format_inst, "colid_doarrow", GPU_COMP_U8, 4, GPU_FETCH_INT);
|
|
|
|
g_batch_link.inst_vbo = GPU_vertbuf_create_with_format_ex(&format_inst, GPU_USAGE_STREAM);
|
|
|
|
/* Alloc max count but only draw the range we need. */
|
|
|
|
GPU_vertbuf_data_alloc(g_batch_link.inst_vbo, NODELINK_GROUP_SIZE);
|
|
|
|
|
|
|
|
GPU_batch_instbuf_set(g_batch_link.batch, g_batch_link.inst_vbo, true);
|
|
|
|
|
|
|
|
nodelink_batch_reset();
|
2018-04-05 15:41:17 +02:00
|
|
|
}
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2018-04-05 15:41:17 +02:00
|
|
|
static char nodelink_get_color_id(int th_col)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
switch (th_col) {
|
|
|
|
case TH_WIRE:
|
|
|
|
return 1;
|
|
|
|
case TH_WIRE_INNER:
|
|
|
|
return 2;
|
|
|
|
case TH_ACTIVE:
|
|
|
|
return 3;
|
|
|
|
case TH_EDGE_SELECT:
|
|
|
|
return 4;
|
|
|
|
case TH_REDALERT:
|
|
|
|
return 5;
|
|
|
|
}
|
|
|
|
return 0;
|
2018-04-05 15:41:17 +02:00
|
|
|
}
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2018-04-05 15:41:17 +02:00
|
|
|
static void nodelink_batch_draw(SpaceNode *snode)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
if (g_batch_link.count == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
GPU_blend(true);
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
float colors[6][4] = {{0.0f}};
|
|
|
|
UI_GetThemeColor4fv(TH_WIRE_INNER, colors[nodelink_get_color_id(TH_WIRE_INNER)]);
|
|
|
|
UI_GetThemeColor4fv(TH_WIRE, colors[nodelink_get_color_id(TH_WIRE)]);
|
|
|
|
UI_GetThemeColor4fv(TH_ACTIVE, colors[nodelink_get_color_id(TH_ACTIVE)]);
|
|
|
|
UI_GetThemeColor4fv(TH_EDGE_SELECT, colors[nodelink_get_color_id(TH_EDGE_SELECT)]);
|
|
|
|
UI_GetThemeColor4fv(TH_REDALERT, colors[nodelink_get_color_id(TH_REDALERT)]);
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
GPU_vertbuf_data_len_set(g_batch_link.inst_vbo, g_batch_link.count);
|
|
|
|
GPU_vertbuf_use(g_batch_link.inst_vbo); /* force update. */
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
GPU_batch_program_set_builtin(g_batch_link.batch, GPU_SHADER_2D_NODELINK_INST);
|
|
|
|
GPU_batch_uniform_4fv_array(g_batch_link.batch, "colors", 6, (float *)colors);
|
|
|
|
GPU_batch_uniform_1f(g_batch_link.batch, "expandSize", snode->aspect * LINK_WIDTH);
|
|
|
|
GPU_batch_uniform_1f(g_batch_link.batch, "arrowSize", ARROW_SIZE);
|
|
|
|
GPU_batch_draw(g_batch_link.batch);
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
nodelink_batch_reset();
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
GPU_blend(false);
|
2018-04-05 15:41:17 +02:00
|
|
|
}
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2018-04-05 15:41:17 +02:00
|
|
|
void nodelink_batch_start(SpaceNode *UNUSED(snode))
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
g_batch_link.enabled = true;
|
2018-04-05 15:41:17 +02:00
|
|
|
}
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2018-04-05 15:41:17 +02:00
|
|
|
void nodelink_batch_end(SpaceNode *snode)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
nodelink_batch_draw(snode);
|
|
|
|
g_batch_link.enabled = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void nodelink_batch_add_link(SpaceNode *snode,
|
|
|
|
const float p0[2],
|
|
|
|
const float p1[2],
|
|
|
|
const float p2[2],
|
|
|
|
const float p3[2],
|
|
|
|
int th_col1,
|
|
|
|
int th_col2,
|
|
|
|
int th_col3,
|
|
|
|
bool drawarrow)
|
|
|
|
{
|
|
|
|
/* Only allow these colors. If more is needed, you need to modify the shader accordingly. */
|
|
|
|
BLI_assert(ELEM(th_col1, TH_WIRE_INNER, TH_WIRE, TH_ACTIVE, TH_EDGE_SELECT, TH_REDALERT));
|
|
|
|
BLI_assert(ELEM(th_col2, TH_WIRE_INNER, TH_WIRE, TH_ACTIVE, TH_EDGE_SELECT, TH_REDALERT));
|
|
|
|
BLI_assert(ELEM(th_col3, TH_WIRE, -1));
|
|
|
|
|
|
|
|
g_batch_link.count++;
|
|
|
|
copy_v2_v2(GPU_vertbuf_raw_step(&g_batch_link.p0_step), p0);
|
|
|
|
copy_v2_v2(GPU_vertbuf_raw_step(&g_batch_link.p1_step), p1);
|
|
|
|
copy_v2_v2(GPU_vertbuf_raw_step(&g_batch_link.p2_step), p2);
|
|
|
|
copy_v2_v2(GPU_vertbuf_raw_step(&g_batch_link.p3_step), p3);
|
|
|
|
char *colid = GPU_vertbuf_raw_step(&g_batch_link.colid_step);
|
|
|
|
colid[0] = nodelink_get_color_id(th_col1);
|
|
|
|
colid[1] = nodelink_get_color_id(th_col2);
|
|
|
|
colid[2] = nodelink_get_color_id(th_col3);
|
|
|
|
colid[3] = drawarrow;
|
|
|
|
|
|
|
|
if (g_batch_link.count == NODELINK_GROUP_SIZE) {
|
|
|
|
nodelink_batch_draw(snode);
|
|
|
|
}
|
2018-04-05 15:41:17 +02:00
|
|
|
}
|
2017-02-21 22:17:47 -03:00
|
|
|
|
2018-04-05 15:41:17 +02:00
|
|
|
/* don't do shadows if th_col3 is -1. */
|
2019-04-17 06:17:24 +02:00
|
|
|
void node_draw_link_bezier(
|
|
|
|
View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int th_col2, int th_col3)
|
|
|
|
{
|
|
|
|
float vec[4][2];
|
|
|
|
|
|
|
|
if (node_link_bezier_handles(v2d, snode, link, vec)) {
|
|
|
|
int drawarrow = ((link->tonode && (link->tonode->type == NODE_REROUTE)) &&
|
|
|
|
(link->fromnode && (link->fromnode->type == NODE_REROUTE)));
|
|
|
|
|
|
|
|
if (g_batch_link.batch == NULL) {
|
|
|
|
nodelink_batch_init();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (g_batch_link.enabled) {
|
|
|
|
/* Add link to batch. */
|
|
|
|
nodelink_batch_add_link(
|
|
|
|
snode, vec[0], vec[1], vec[2], vec[3], th_col1, th_col2, th_col3, drawarrow);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Draw single link. */
|
|
|
|
float colors[3][4] = {{0.0f}};
|
|
|
|
if (th_col3 != -1) {
|
|
|
|
UI_GetThemeColor4fv(th_col3, colors[0]);
|
|
|
|
}
|
|
|
|
UI_GetThemeColor4fv(th_col1, colors[1]);
|
|
|
|
UI_GetThemeColor4fv(th_col2, colors[2]);
|
|
|
|
|
|
|
|
GPUBatch *batch = g_batch_link.batch_single;
|
|
|
|
GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_NODELINK);
|
|
|
|
GPU_batch_uniform_2fv_array(batch, "bezierPts", 4, (float *)vec);
|
|
|
|
GPU_batch_uniform_4fv_array(batch, "colors", 3, (float *)colors);
|
|
|
|
GPU_batch_uniform_1f(batch, "expandSize", snode->aspect * LINK_WIDTH);
|
|
|
|
GPU_batch_uniform_1f(batch, "arrowSize", ARROW_SIZE);
|
|
|
|
GPU_batch_uniform_1i(batch, "doArrow", drawarrow);
|
|
|
|
GPU_batch_draw(batch);
|
|
|
|
}
|
|
|
|
}
|
2008-12-24 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* note; this is used for fake links in groups too */
|
|
|
|
void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link)
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
int th_col1 = TH_WIRE_INNER, th_col2 = TH_WIRE_INNER, th_col3 = TH_WIRE;
|
|
|
|
|
|
|
|
if (link->fromsock == NULL && link->tosock == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* new connection */
|
|
|
|
if (!link->fromsock || !link->tosock) {
|
|
|
|
th_col1 = th_col2 = TH_ACTIVE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* going to give issues once... */
|
|
|
|
if (link->tosock->flag & SOCK_UNAVAIL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (link->fromsock->flag & SOCK_UNAVAIL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (link->flag & NODE_LINK_VALID) {
|
|
|
|
/* special indicated link, on drop-node */
|
|
|
|
if (link->flag & NODE_LINKFLAG_HILITE) {
|
|
|
|
th_col1 = th_col2 = TH_ACTIVE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* regular link */
|
|
|
|
if (link->fromnode && link->fromnode->flag & SELECT) {
|
|
|
|
th_col1 = TH_EDGE_SELECT;
|
|
|
|
}
|
|
|
|
if (link->tonode && link->tonode->flag & SELECT) {
|
|
|
|
th_col2 = TH_EDGE_SELECT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
th_col1 = th_col2 = TH_REDALERT;
|
|
|
|
// th_col3 = -1; /* no shadow */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
node_draw_link_bezier(v2d, snode, link, th_col1, th_col2, th_col3);
|
|
|
|
// node_draw_link_straight(v2d, snode, link, th_col1, do_shaded, th_col2, do_triple, th_col3);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ED_node_draw_snap(
|
|
|
|
View2D *v2d, const float cent[2], float size, NodeBorder border, unsigned pos)
|
|
|
|
{
|
|
|
|
immBegin(GPU_PRIM_LINES, 4);
|
|
|
|
|
|
|
|
if (border & (NODE_LEFT | NODE_RIGHT)) {
|
|
|
|
immVertex2f(pos, cent[0], v2d->cur.ymin);
|
|
|
|
immVertex2f(pos, cent[0], v2d->cur.ymax);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
immVertex2f(pos, cent[0], cent[1] - size);
|
|
|
|
immVertex2f(pos, cent[0], cent[1] + size);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (border & (NODE_TOP | NODE_BOTTOM)) {
|
|
|
|
immVertex2f(pos, v2d->cur.xmin, cent[1]);
|
|
|
|
immVertex2f(pos, v2d->cur.xmax, cent[1]);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
immVertex2f(pos, cent[0] - size, cent[1]);
|
|
|
|
immVertex2f(pos, cent[0] + size, cent[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
immEnd();
|
2012-06-29 14:34:46 +00:00
|
|
|
}
|