2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-12-13 18:09:49 +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-13 18:09:49 +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-13 18:09:49 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
2011-02-27 20:29:51 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup spnode
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __NODE_INTERN_H__
|
|
|
|
#define __NODE_INTERN_H__
|
2008-12-13 18:09:49 +00:00
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
#include "BKE_node.h"
|
2011-09-05 21:01:50 +00:00
|
|
|
#include "UI_interface.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include <stddef.h> /* for size_t */
|
2011-09-05 21:01:50 +00:00
|
|
|
|
2008-12-13 18:09:49 +00:00
|
|
|
/* internal exports only */
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
struct ARegion;
|
2009-08-19 00:55:30 +00:00
|
|
|
struct ARegionType;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Main;
|
2008-12-24 10:33:10 +00:00
|
|
|
struct View2D;
|
|
|
|
struct bContext;
|
2011-03-13 22:07:55 +00:00
|
|
|
struct bNode;
|
|
|
|
struct bNodeLink;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bNodeSocket;
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
struct wmKeyConfig;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct wmWindow;
|
2011-03-13 22:07:55 +00:00
|
|
|
|
|
|
|
/* temp data to pass on to modal */
|
2012-06-06 22:38:39 +00:00
|
|
|
typedef struct bNodeLinkDrag {
|
2019-04-17 06:17:24 +02:00
|
|
|
struct bNodeLinkDrag *next, *prev;
|
|
|
|
|
|
|
|
/* List of links dragged by the operator.
|
|
|
|
* Note: This is a list of LinkData structs on top of the actual bNodeLinks.
|
|
|
|
* This way the links can be added to the node tree while being stored in this list.
|
|
|
|
*/
|
|
|
|
ListBase links;
|
|
|
|
int in_out;
|
2011-03-13 22:07:55 +00:00
|
|
|
} bNodeLinkDrag;
|
2008-12-28 00:08:34 +00:00
|
|
|
|
2009-11-11 08:12:54 +00:00
|
|
|
/* space_node.c */
|
|
|
|
|
2019-01-15 23:24:20 +11:00
|
|
|
/* transform between View2Ds in the tree path */
|
|
|
|
void snode_group_offset(struct SpaceNode *snode, float *x, float *y);
|
2013-03-18 16:34:57 +00:00
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
/* node_draw.c */
|
2012-05-22 14:13:33 +00:00
|
|
|
int node_get_colorid(struct bNode *node);
|
|
|
|
int node_get_resize_cursor(int directions);
|
2012-06-01 14:42:21 +00:00
|
|
|
void node_draw_shadow(struct SpaceNode *snode, struct bNode *node, float radius, float alpha);
|
2019-04-17 06:17:24 +02:00
|
|
|
void node_draw_default(const struct bContext *C,
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region,
|
2019-04-17 06:17:24 +02:00
|
|
|
struct SpaceNode *snode,
|
|
|
|
struct bNodeTree *ntree,
|
|
|
|
struct bNode *node,
|
|
|
|
bNodeInstanceKey key);
|
|
|
|
void node_draw_sockets(struct View2D *v2d,
|
|
|
|
const struct bContext *C,
|
|
|
|
struct bNodeTree *ntree,
|
|
|
|
struct bNode *node,
|
|
|
|
bool draw_outputs,
|
|
|
|
bool select_all);
|
2011-09-05 21:01:50 +00:00
|
|
|
void node_update_default(const struct bContext *C, struct bNodeTree *ntree, struct bNode *node);
|
2012-06-01 12:38:03 +00:00
|
|
|
int node_select_area_default(struct bNode *node, int x, int y);
|
|
|
|
int node_tweak_area_default(struct bNode *node, int x, int y);
|
2013-03-18 16:34:57 +00:00
|
|
|
void node_update_nodetree(const struct bContext *C, struct bNodeTree *ntree);
|
2019-04-17 06:17:24 +02:00
|
|
|
void node_draw_nodetree(const struct bContext *C,
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region,
|
2019-04-17 06:17:24 +02:00
|
|
|
struct SpaceNode *snode,
|
|
|
|
struct bNodeTree *ntree,
|
|
|
|
bNodeInstanceKey parent_key);
|
2020-03-06 16:56:42 +01:00
|
|
|
void drawnodespace(const bContext *C, ARegion *region);
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2013-09-05 13:03:03 +00:00
|
|
|
void node_set_cursor(struct wmWindow *win, struct SpaceNode *snode, float cursor[2]);
|
2019-04-17 06:17:24 +02:00
|
|
|
/* DPI scaled coords */
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
void node_to_view(struct bNode *node, float x, float y, float *rx, float *ry);
|
2015-08-01 16:16:16 +02:00
|
|
|
void node_to_updated_rect(struct bNode *node, rctf *r_rect);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
void node_from_view(struct bNode *node, float x, float y, float *rx, float *ry);
|
2012-05-22 14:13:33 +00:00
|
|
|
|
2009-11-11 08:12:54 +00:00
|
|
|
/* node_buttons.c */
|
|
|
|
void node_buttons_register(struct ARegionType *art);
|
|
|
|
|
2012-12-12 12:50:39 +00:00
|
|
|
/* node_toolbar.c */
|
|
|
|
void node_toolbar_register(struct ARegionType *art);
|
|
|
|
|
2008-12-28 00:08:34 +00:00
|
|
|
/* node_ops.c */
|
|
|
|
void node_operatortypes(void);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
void node_keymap(struct wmKeyConfig *keyconf);
|
2008-12-28 00:08:34 +00:00
|
|
|
|
|
|
|
/* node_select.c */
|
2011-12-18 12:51:50 +00:00
|
|
|
void node_deselect_all(struct SpaceNode *snode);
|
2012-03-14 18:10:57 +00:00
|
|
|
void node_socket_select(struct bNode *node, struct bNodeSocket *sock);
|
2014-02-03 18:55:59 +11:00
|
|
|
void node_socket_deselect(struct bNode *node, struct bNodeSocket *sock, const bool deselect_node);
|
|
|
|
void node_deselect_all_input_sockets(struct SpaceNode *snode, const bool deselect_nodes);
|
|
|
|
void node_deselect_all_output_sockets(struct SpaceNode *snode, const bool deselect_nodes);
|
2011-12-18 12:51:50 +00:00
|
|
|
void node_select_single(struct bContext *C, struct bNode *node);
|
|
|
|
|
2008-12-28 00:08:34 +00:00
|
|
|
void NODE_OT_select(struct wmOperatorType *ot);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
void NODE_OT_select_all(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_select_linked_to(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_select_linked_from(struct wmOperatorType *ot);
|
2018-10-05 10:27:04 +10:00
|
|
|
void NODE_OT_select_box(struct wmOperatorType *ot);
|
2013-11-06 19:21:42 +00:00
|
|
|
void NODE_OT_select_circle(struct wmOperatorType *ot);
|
2012-08-22 13:34:06 +00:00
|
|
|
void NODE_OT_select_lasso(struct wmOperatorType *ot);
|
2014-07-04 14:17:54 +02:00
|
|
|
void NODE_OT_select_grouped(struct wmOperatorType *ot);
|
2013-03-27 18:28:25 +00:00
|
|
|
void NODE_OT_select_same_type_step(struct wmOperatorType *ot);
|
2013-04-01 15:07:22 +00:00
|
|
|
void NODE_OT_find_node(struct wmOperatorType *ot);
|
2008-12-28 00:08:34 +00:00
|
|
|
|
2012-08-02 21:52:09 +00:00
|
|
|
/* node_view.c */
|
2019-04-17 06:17:24 +02:00
|
|
|
int space_node_view_flag(struct bContext *C,
|
|
|
|
SpaceNode *snode,
|
2020-03-06 16:56:42 +01:00
|
|
|
ARegion *region,
|
2019-04-17 06:17:24 +02:00
|
|
|
const int node_flag,
|
|
|
|
const int smooth_viewtx);
|
2013-03-27 17:22:12 +00:00
|
|
|
|
2011-12-18 12:51:50 +00:00
|
|
|
void NODE_OT_view_all(struct wmOperatorType *ot);
|
2012-08-07 16:30:34 +00:00
|
|
|
void NODE_OT_view_selected(struct wmOperatorType *ot);
|
2011-12-18 12:51:50 +00:00
|
|
|
|
2012-08-02 21:52:09 +00:00
|
|
|
void NODE_OT_backimage_move(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_backimage_zoom(struct wmOperatorType *ot);
|
2013-09-01 09:50:56 +00:00
|
|
|
void NODE_OT_backimage_fit(struct wmOperatorType *ot);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
void NODE_OT_backimage_sample(struct wmOperatorType *ot);
|
2012-08-02 21:52:09 +00:00
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
/* drawnode.c */
|
2018-04-05 15:41:17 +02:00
|
|
|
void nodelink_batch_start(struct SpaceNode *snode);
|
|
|
|
void nodelink_batch_end(struct SpaceNode *snode);
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
void node_draw_link(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link);
|
2019-04-17 06:17:24 +02:00
|
|
|
void node_draw_link_bezier(struct View2D *v2d,
|
|
|
|
struct SpaceNode *snode,
|
|
|
|
struct bNodeLink *link,
|
|
|
|
int th_col1,
|
|
|
|
int th_col2,
|
|
|
|
int th_col3);
|
|
|
|
bool node_link_bezier_points(struct View2D *v2d,
|
|
|
|
struct SpaceNode *snode,
|
|
|
|
struct bNodeLink *link,
|
|
|
|
float coord_array[][2],
|
|
|
|
int resol);
|
2019-04-22 00:18:34 +10:00
|
|
|
#if 0
|
|
|
|
void node_draw_link_straight(View2D *v2d,
|
|
|
|
SpaceNode *snode,
|
|
|
|
bNodeLink *link,
|
|
|
|
int th_col1,
|
|
|
|
int do_shaded,
|
|
|
|
int th_col2,
|
|
|
|
int do_triple,
|
|
|
|
int th_col3);
|
|
|
|
#endif
|
2019-04-17 06:17:24 +02:00
|
|
|
void draw_nodespace_back_pix(const struct bContext *C,
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region,
|
2019-04-17 06:17:24 +02:00
|
|
|
struct SpaceNode *snode,
|
|
|
|
bNodeInstanceKey parent_key);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
|
|
|
/* node_add.c */
|
2019-04-17 06:17:24 +02:00
|
|
|
bNode *node_add_node(
|
|
|
|
const struct bContext *C, const char *idname, int type, float locx, float locy);
|
2012-08-01 19:11:17 +00:00
|
|
|
void NODE_OT_add_reroute(struct wmOperatorType *ot);
|
2013-03-18 16:34:57 +00:00
|
|
|
void NODE_OT_add_file(struct wmOperatorType *ot);
|
2013-07-22 19:24:39 +00:00
|
|
|
void NODE_OT_add_mask(struct wmOperatorType *ot);
|
2013-03-18 16:34:57 +00:00
|
|
|
void NODE_OT_new_node_tree(struct wmOperatorType *ot);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
|
|
|
/* node_group.c */
|
|
|
|
void NODE_OT_group_make(struct wmOperatorType *ot);
|
2013-03-18 16:34:57 +00:00
|
|
|
void NODE_OT_group_insert(struct wmOperatorType *ot);
|
2012-08-01 19:11:17 +00:00
|
|
|
void NODE_OT_group_ungroup(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_group_separate(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_group_edit(struct wmOperatorType *ot);
|
|
|
|
|
|
|
|
/* node_relationships.c */
|
2018-06-09 15:16:44 +02:00
|
|
|
bool node_connected_to_output(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node);
|
2016-02-05 01:39:42 +05:00
|
|
|
|
2012-08-01 19:11:17 +00:00
|
|
|
void NODE_OT_link(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_link_make(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_links_cut(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_links_detach(struct wmOperatorType *ot);
|
|
|
|
|
|
|
|
void NODE_OT_parent_set(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_join(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_attach(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_detach(struct wmOperatorType *ot);
|
|
|
|
|
|
|
|
void NODE_OT_link_viewer(struct wmOperatorType *ot);
|
|
|
|
|
2015-08-01 17:39:48 +02:00
|
|
|
void NODE_OT_insert_offset(wmOperatorType *ot);
|
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
/* node_edit.c */
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
void snode_notify(struct bContext *C, struct SpaceNode *snode);
|
|
|
|
void snode_dag_update(struct bContext *C, struct SpaceNode *snode);
|
2013-03-18 16:34:57 +00:00
|
|
|
void snode_set_context(const struct bContext *C);
|
2012-08-03 20:56:04 +00:00
|
|
|
|
2012-08-01 19:11:17 +00:00
|
|
|
void snode_update(struct SpaceNode *snode, struct bNode *node);
|
2018-07-02 11:47:00 +02:00
|
|
|
bool composite_node_active(struct bContext *C);
|
|
|
|
bool composite_node_editable(struct bContext *C);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
2012-04-16 10:50:57 +00:00
|
|
|
int node_has_hidden_sockets(bNode *node);
|
|
|
|
void node_set_hidden_sockets(SpaceNode *snode, bNode *node, int set);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
int node_render_changed_exec(bContext *, struct wmOperator *);
|
2019-04-17 06:17:24 +02:00
|
|
|
int node_find_indicated_socket(struct SpaceNode *snode,
|
|
|
|
struct bNode **nodep,
|
|
|
|
struct bNodeSocket **sockp,
|
|
|
|
float cursor[2],
|
|
|
|
int in_out);
|
2008-12-13 18:09:49 +00:00
|
|
|
|
2009-07-08 21:41:35 +00:00
|
|
|
void NODE_OT_duplicate(struct wmOperatorType *ot);
|
2009-03-29 02:15:13 +00:00
|
|
|
void NODE_OT_delete(struct wmOperatorType *ot);
|
2011-07-12 18:59:54 +00:00
|
|
|
void NODE_OT_delete_reconnect(struct wmOperatorType *ot);
|
2009-04-15 15:40:31 +00:00
|
|
|
void NODE_OT_resize(struct wmOperatorType *ot);
|
2009-11-20 06:31:49 +00:00
|
|
|
|
2010-06-07 20:03:40 +00:00
|
|
|
void NODE_OT_mute_toggle(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_hide_toggle(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_hide_socket_toggle(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_preview_toggle(struct wmOperatorType *ot);
|
2011-12-18 12:51:50 +00:00
|
|
|
void NODE_OT_options_toggle(struct wmOperatorType *ot);
|
2012-05-22 14:13:33 +00:00
|
|
|
void NODE_OT_node_copy_color(struct wmOperatorType *ot);
|
2009-11-20 06:31:49 +00:00
|
|
|
|
2017-11-22 10:52:39 -02:00
|
|
|
void NODE_OT_read_viewlayers(struct wmOperatorType *ot);
|
2011-02-07 16:41:57 +00:00
|
|
|
void NODE_OT_render_changed(struct wmOperatorType *ot);
|
2011-01-31 14:42:55 +00:00
|
|
|
|
2012-03-01 07:56:15 +00:00
|
|
|
void NODE_OT_output_file_add_socket(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_output_file_remove_active_socket(struct wmOperatorType *ot);
|
2012-05-02 07:18:51 +00:00
|
|
|
void NODE_OT_output_file_move_active_socket(struct wmOperatorType *ot);
|
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
|
|
|
void NODE_OT_switch_view_update(struct wmOperatorType *ot);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2012-08-02 09:52:37 +00:00
|
|
|
/* Note: clipboard_cut is a simple macro of copy + delete */
|
|
|
|
void NODE_OT_clipboard_copy(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_clipboard_paste(struct wmOperatorType *ot);
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
void NODE_OT_tree_socket_add(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_tree_socket_remove(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_tree_socket_move(struct wmOperatorType *ot);
|
|
|
|
|
2012-11-03 14:32:26 +00:00
|
|
|
void NODE_OT_shader_script_update(struct wmOperatorType *ot);
|
|
|
|
|
2013-03-07 17:47:30 +00:00
|
|
|
void NODE_OT_viewer_border(struct wmOperatorType *ot);
|
2014-06-05 20:05:41 +06:00
|
|
|
void NODE_OT_clear_viewer_border(struct wmOperatorType *ot);
|
2013-03-07 17:47:30 +00:00
|
|
|
|
2017-05-29 22:06:59 +10:00
|
|
|
/* node_widgets.c */
|
2018-07-15 14:24:10 +02:00
|
|
|
void NODE_GGT_backdrop_transform(struct wmGizmoGroupType *gzgt);
|
|
|
|
void NODE_GGT_backdrop_crop(struct wmGizmoGroupType *gzgt);
|
|
|
|
void NODE_GGT_backdrop_sun_beams(struct wmGizmoGroupType *gzgt);
|
|
|
|
void NODE_GGT_backdrop_corner_pin(struct wmGizmoGroupType *gzgt);
|
2017-05-29 22:06:59 +10:00
|
|
|
|
2018-07-18 13:03:09 +02:00
|
|
|
void NODE_OT_cryptomatte_layer_add(struct wmOperatorType *ot);
|
|
|
|
void NODE_OT_cryptomatte_layer_remove(struct wmOperatorType *ot);
|
2017-05-29 22:06:59 +10:00
|
|
|
|
2011-02-15 14:38:43 +00:00
|
|
|
extern const char *node_context_dir[];
|
|
|
|
|
2008-12-29 00:55:23 +00:00
|
|
|
// XXXXXX
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
// nodes draw without dpi - the view zoom is flexible
|
2019-04-17 06:17:24 +02:00
|
|
|
#define HIDDEN_RAD (0.75f * U.widget_unit)
|
|
|
|
#define BASIS_RAD (0.2f * U.widget_unit)
|
|
|
|
#define NODE_DYS (U.widget_unit / 2)
|
|
|
|
#define NODE_DY U.widget_unit
|
|
|
|
#define NODE_SOCKDY (0.08f * U.widget_unit)
|
|
|
|
#define NODE_WIDTH(node) (node->width * UI_DPI_FAC)
|
2015-08-01 16:16:16 +02:00
|
|
|
#define NODE_HEIGHT(node) (node->height * UI_DPI_FAC)
|
2020-03-29 22:47:41 +11:00
|
|
|
#define NODE_MARGIN_X (0.95f * U.widget_unit)
|
2019-04-17 06:17:24 +02:00
|
|
|
#define NODE_SOCKSIZE (0.25f * U.widget_unit)
|
2019-01-04 15:08:24 +01:00
|
|
|
#define NODE_RESIZE_MARGIN (0.20f * U.widget_unit)
|
2012-08-01 19:11:17 +00:00
|
|
|
#define NODE_LINK_RESOL 12
|
2008-12-13 18:09:49 +00:00
|
|
|
|
2008-12-29 00:55:23 +00:00
|
|
|
// XXX button events (butspace)
|
2013-03-22 05:46:39 +00:00
|
|
|
enum eNodeSpace_ButEvents {
|
2019-04-17 06:17:24 +02:00
|
|
|
B_NOP = 0,
|
|
|
|
B_REDR = 1,
|
|
|
|
B_NODE_USEMAT,
|
|
|
|
B_NODE_USESCENE,
|
|
|
|
B_NODE_USETEX,
|
|
|
|
B_TEXBROWSE,
|
|
|
|
B_TEXALONE,
|
|
|
|
B_TEXLOCAL,
|
|
|
|
B_TEXDELETE,
|
|
|
|
B_TEXPRV,
|
|
|
|
B_AUTOTEXNAME,
|
|
|
|
B_KEEPDATA,
|
|
|
|
B_NODE_EXEC,
|
|
|
|
B_MATPRV,
|
|
|
|
B_NODE_LOADIMAGE,
|
|
|
|
B_NODE_SETIMAGE,
|
2013-03-22 05:46:39 +00:00
|
|
|
};
|
2008-12-29 00:55:23 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __NODE_INTERN_H__ */
|