| 
									
										
										
										
											2011-02-18 13:05:18 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2005-12-18 13:46:01 +00:00
										 |  |  |  * ***** BEGIN GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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 | 
					
						
							| 
									
										
										
										
											2011-11-29 10:54:47 +00:00
										 |  |  |  * of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2005-12-18 13:46:01 +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. | 
					
						
							| 
									
										
										
										
											2005-12-18 13:46:01 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is Copyright (C) 2005 Blender Foundation. | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is: all of this file. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2009-09-10 04:12:22 +00:00
										 |  |  |  * Contributor(s): Bob Holcomb. | 
					
						
							| 
									
										
										
										
											2005-12-18 13:46:01 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-17 18:59:41 +00:00
										 |  |  | #ifndef __BKE_NODE_H__
 | 
					
						
							|  |  |  | #define __BKE_NODE_H__
 | 
					
						
							| 
									
										
										
										
											2005-12-18 13:46:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-18 13:05:18 +00:00
										 |  |  | /** \file BKE_node.h
 | 
					
						
							|  |  |  |  *  \ingroup bke | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | #include "BLI_utildefines.h"
 | 
					
						
							| 
									
										
										
										
											2013-08-25 21:29:33 +00:00
										 |  |  | #include "BLI_ghash.h"
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | #include "DNA_listBase.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | /* for FOREACH_NODETREE */ | 
					
						
							|  |  |  | #include "DNA_lamp_types.h"
 | 
					
						
							|  |  |  | #include "DNA_material_types.h"
 | 
					
						
							|  |  |  | #include "DNA_node_types.h"
 | 
					
						
							|  |  |  | #include "DNA_scene_types.h"
 | 
					
						
							|  |  |  | #include "DNA_texture_types.h"
 | 
					
						
							|  |  |  | #include "DNA_world_types.h"
 | 
					
						
							| 
									
										
										
										
											2014-05-03 18:51:53 +09:00
										 |  |  | #include "DNA_linestyle_types.h"
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "RNA_types.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-01 22:28:18 +00:00
										 |  |  | /* not very important, but the stack solver likes to know a maximum */ | 
					
						
							|  |  |  | #define MAX_SOCKET	64
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-04 04:01:27 +00:00
										 |  |  | struct bContext; | 
					
						
							| 
									
										
										
										
											2005-12-18 13:46:01 +00:00
										 |  |  | struct bNode; | 
					
						
							| 
									
										
										
										
											2005-12-18 23:08:22 +00:00
										 |  |  | struct bNodeLink; | 
					
						
							|  |  |  | struct bNodeSocket; | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | struct bNodeStack; | 
					
						
							| 
									
										
										
										
											2010-08-04 04:01:27 +00:00
										 |  |  | struct bNodeTree; | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNodeTreeType; | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | struct bNodeTreeExec; | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNodeExecContext; | 
					
						
							|  |  |  | struct bNodeExecData; | 
					
						
							| 
									
										
											  
											
												
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
  menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
  gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
  storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
  An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
  needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
  be at the origin.
											
										 
											2008-09-04 20:51:28 +00:00
										 |  |  | struct GPUMaterial; | 
					
						
							|  |  |  | struct GPUNodeStack; | 
					
						
							| 
									
										
										
										
											2010-08-04 04:01:27 +00:00
										 |  |  | struct ID; | 
					
						
							| 
									
										
										
										
											2013-03-05 03:44:47 +00:00
										 |  |  | struct ImBuf; | 
					
						
							| 
									
										
										
										
											2012-02-22 12:59:43 +00:00
										 |  |  | struct ImageFormatData; | 
					
						
							| 
									
										
										
										
											2010-08-04 04:01:27 +00:00
										 |  |  | struct ListBase; | 
					
						
							|  |  |  | struct Main; | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | struct uiLayout; | 
					
						
							| 
									
										
										
										
											2010-08-04 04:01:27 +00:00
										 |  |  | struct MTex; | 
					
						
							| 
									
										
										
										
											2009-09-16 18:59:13 +00:00
										 |  |  | struct PointerRNA; | 
					
						
							| 
									
										
										
										
											2010-08-04 04:01:27 +00:00
										 |  |  | struct RenderData; | 
					
						
							|  |  |  | struct Scene; | 
					
						
							|  |  |  | struct Tex; | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | struct SpaceNode; | 
					
						
							|  |  |  | struct ARegion; | 
					
						
							| 
									
										
											  
											
												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
										 |  |  | struct ColorManagedViewSettings; | 
					
						
							|  |  |  | struct ColorManagedDisplaySettings; | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNodeInstanceHash; | 
					
						
							| 
									
										
										
										
											2005-12-18 13:46:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Node Type Definitions
 | 
					
						
							|  |  |  |  * \{ */ | 
					
						
							| 
									
										
										
										
											2005-12-20 15:43:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | /** Compact definition of a node socket.
 | 
					
						
							|  |  |  |  * Can be used to quickly define a list of static sockets for a node, | 
					
						
							|  |  |  |  * which are added to each new node of that type.  | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  |  * \deprecated This struct is used by C nodes to define templates as simple | 
					
						
							|  |  |  |  * static struct lists. These are converted to the new template collections | 
					
						
							|  |  |  |  * in RNA types automatically. | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | typedef struct bNodeSocketTemplate { | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 	int type, limit; | 
					
						
							| 
									
										
										
										
											2012-01-11 08:51:06 +00:00
										 |  |  | 	char name[64];	/* MAX_NAME */ | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	float val1, val2, val3, val4;   /* default alloc value for inputs */ | 
					
						
							|  |  |  | 	float min, max; | 
					
						
							| 
									
										
										
										
											2012-11-27 16:19:52 +00:00
										 |  |  | 	int subtype;  /* would use PropertySubType but this is a bad level include to use RNA */ | 
					
						
							| 
									
										
										
										
											2011-11-07 17:30:52 +00:00
										 |  |  | 	int flag; | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* after this line is used internal only */ | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	struct bNodeSocket *sock;		/* used to hold verified socket */ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	char identifier[64];			/* generated from name */ | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | } bNodeSocketTemplate; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** Defines a socket type.
 | 
					
						
							|  |  |  |  * Defines the appearance and behavior of a socket in the UI. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | typedef struct bNodeSocketType { | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	char idname[64];				/* identifier name */ | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-05-08 14:58:41 +00:00
										 |  |  | 	void (*draw)(struct bContext *C, struct uiLayout *layout, struct PointerRNA *ptr, struct PointerRNA *node_ptr, const char *text); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	void (*draw_color)(struct bContext *C, struct PointerRNA *ptr, struct PointerRNA *node_ptr, float *r_color); | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	void (*interface_draw)(struct bContext *C, struct uiLayout *layout, struct PointerRNA *ptr); | 
					
						
							|  |  |  | 	void (*interface_draw_color)(struct bContext *C, struct PointerRNA *ptr, float *r_color); | 
					
						
							|  |  |  | 	void (*interface_register_properties)(struct bNodeTree *ntree, struct bNodeSocket *stemp, struct StructRNA *data_srna); | 
					
						
							|  |  |  | 	void (*interface_init_socket)(struct bNodeTree *ntree, struct bNodeSocket *stemp, struct bNode *node, struct bNodeSocket *sock, const char *data_path); | 
					
						
							| 
									
										
										
										
											2013-03-28 10:32:04 +00:00
										 |  |  | 	void (*interface_verify_socket)(struct bNodeTree *ntree, struct bNodeSocket *stemp, struct bNode *node, struct bNodeSocket *sock, const char *data_path); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	void (*interface_from_socket)(struct bNodeTree *ntree, struct bNodeSocket *stemp, struct bNode *node, struct bNodeSocket *sock); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	/* RNA integration */ | 
					
						
							|  |  |  | 	ExtensionRNA ext_socket; | 
					
						
							|  |  |  | 	ExtensionRNA ext_interface; | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	/* for standard socket types in C */ | 
					
						
							|  |  |  | 	int type, subtype; | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | } bNodeSocketType; | 
					
						
							| 
									
										
										
											
												Orange; daily noodler update commit.
- Adding execution code for Node trees. Was a bit a puzzle, since I want
  it to be multithreading by design. This now is solved by defining a
  stack per tree for all data that's being written into. This stack, which
  resides now in the NodeTree itself, then can be allocated per thread.
- For testing pleasure, I've added a 'mix node' and a 'show node', so
  you can already see it do something. :)
- reshuffled structure, to put things nice together, and have easier node
  adding. Current state is still WIP though, structure might change.
  For the record; new file node_shaders.c will contain all shader node
  definitions, apart from the drawing callbacks.
Next: I'm going to check on Andrea's work on icons now, since this is very
much needed for true shader/composit work.
Now back to release work...
											
										 
											2005-12-21 14:24:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | typedef void *(*NodeInitExecFunction)(struct bNodeExecContext *context, struct bNode *node, bNodeInstanceKey key); | 
					
						
							| 
									
										
										
										
											2013-10-29 17:46:01 +00:00
										 |  |  | typedef void (*NodeFreeExecFunction)(void *nodedata); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | typedef void (*NodeExecFunction)(void *data, int thread, struct bNode *, struct bNodeExecData *execdata, struct bNodeStack **in, struct bNodeStack **out); | 
					
						
							|  |  |  | typedef int (*NodeGPUExecFunction)(struct GPUMaterial *mat, struct bNode *node, struct bNodeExecData *execdata, struct GPUNodeStack *in, struct GPUNodeStack *out); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** Defines a node type.
 | 
					
						
							|  |  |  |  * Initial attributes and constants for a node as well as callback functions | 
					
						
							|  |  |  |  * implementing the node behavior. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | typedef struct bNodeType { | 
					
						
							| 
									
										
										
										
											2012-04-29 15:47:02 +00:00
										 |  |  | 	void *next, *prev; | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	short needs_free;		/* set for allocated types that need to be freed */ | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	char idname[64];				/* identifier name */ | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 	int type; | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	char ui_name[64];	/* MAX_NAME */ | 
					
						
							|  |  |  | 	char ui_description[256]; | 
					
						
							|  |  |  | 	int ui_icon; | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 	float width, minwidth, maxwidth; | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	float height, minheight, maxheight; | 
					
						
							| 
									
										
										
										
											2011-11-02 19:24:30 +00:00
										 |  |  | 	short nclass, flag, compatibility; | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	/* templates for static sockets */ | 
					
						
							|  |  |  | 	bNodeSocketTemplate *inputs, *outputs; | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	char storagename[64];			/* struct name for DNA */ | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-10-10 11:33:20 +00:00
										 |  |  | 	/* Main draw function for the node */ | 
					
						
							|  |  |  | 	void (*draw_nodetype)(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	                 struct bNodeTree *ntree, struct bNode *node, bNodeInstanceKey key); | 
					
						
							| 
									
										
										
										
											2013-10-10 11:33:20 +00:00
										 |  |  | 	/* Updates the node geometry attributes according to internal state before actual drawing */ | 
					
						
							|  |  |  | 	void (*draw_nodetype_prepare)(const struct bContext *C, struct bNodeTree *ntree, struct bNode *node); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Draw the option buttons on the node */ | 
					
						
							|  |  |  | 	void (*draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr); | 
					
						
							|  |  |  | 	/* Additional parameters in the side panel */ | 
					
						
							|  |  |  | 	void (*draw_buttons_ex)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Additional drawing on backdrop */ | 
					
						
							|  |  |  | 	void (*draw_backdrop)(struct SpaceNode *snode, struct ImBuf *backdrop, struct bNode *node, int x, int y); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	/// Optional custom label function for the node header.
 | 
					
						
							| 
									
										
										
										
											2013-11-12 18:18:04 +00:00
										 |  |  | 	void (*labelfunc)(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	/// Optional custom resize handle polling.
 | 
					
						
							|  |  |  | 	int (*resize_area_func)(struct bNode *node, int x, int y); | 
					
						
							| 
									
										
										
										
											2012-06-01 12:38:03 +00:00
										 |  |  | 	/// Optional selection area polling.
 | 
					
						
							|  |  |  | 	int (*select_area_func)(struct bNode *node, int x, int y); | 
					
						
							|  |  |  | 	/// Optional tweak area polling (for grabbing).
 | 
					
						
							|  |  |  | 	int (*tweak_area_func)(struct bNode *node, int x, int y); | 
					
						
							| 
									
										
										
										
											2007-04-04 13:58:12 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	/// Called when the node is updated in the editor.
 | 
					
						
							|  |  |  | 	void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							|  |  |  | 	/// Check and update if internal ID data has changed.
 | 
					
						
							|  |  |  | 	void (*verifyfunc)(struct bNodeTree *ntree, struct bNode *node, struct ID *id); | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	/// Initialize a new node instance of this type after creation.
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	void (*initfunc)(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							|  |  |  | 	/// Free the node instance.
 | 
					
						
							|  |  |  | 	void (*freefunc)(struct bNode *node); | 
					
						
							|  |  |  | 	/// Make a copy of the node instance.
 | 
					
						
							|  |  |  | 	void (*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, struct bNode *src_node); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	/* Registerable API callback versions, called in addition to C callbacks */ | 
					
						
							|  |  |  | 	void (*initfunc_api)(const struct bContext *C, struct PointerRNA *ptr); | 
					
						
							|  |  |  | 	void (*freefunc_api)(struct PointerRNA *ptr); | 
					
						
							|  |  |  | 	void (*copyfunc_api)(struct PointerRNA *ptr, struct bNode *src_node); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	/* can this node type be added to a node tree */ | 
					
						
							|  |  |  | 	int (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree); | 
					
						
							|  |  |  | 	/* can this node be added to a node tree */ | 
					
						
							|  |  |  | 	int (*poll_instance)(struct bNode *node, struct bNodeTree *nodetree); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-10-25 16:49:06 +00:00
										 |  |  | 	/* Update the internal links list, for muting and disconnect operators. */ | 
					
						
							|  |  |  | 	void (*update_internal_links)(struct bNodeTree *, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* **** execution callbacks **** */ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	NodeInitExecFunction initexecfunc; | 
					
						
							|  |  |  | 	NodeFreeExecFunction freeexecfunc; | 
					
						
							|  |  |  | 	NodeExecFunction execfunc; | 
					
						
							| 
									
										
											  
											
												
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
  menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
  gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
  storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
  An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
  needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
  be at the origin.
											
										 
											2008-09-04 20:51:28 +00:00
										 |  |  | 	/* gpu */ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	NodeGPUExecFunction gpufunc; | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	/* RNA integration */ | 
					
						
							|  |  |  | 	ExtensionRNA ext; | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | } bNodeType; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-28 13:48:01 +00:00
										 |  |  | /* node->exec, now in use for composites (#define for break is same as ready yes) */ | 
					
						
							|  |  |  | #define NODE_PROCESSING	1
 | 
					
						
							|  |  |  | #define NODE_READY		2
 | 
					
						
							|  |  |  | #define NODE_BREAK		2
 | 
					
						
							|  |  |  | #define NODE_FINISHED	4
 | 
					
						
							|  |  |  | #define NODE_FREEBUFS	8
 | 
					
						
							| 
									
										
										
										
											2009-01-27 17:12:40 +00:00
										 |  |  | #define NODE_SKIPPED	16
 | 
					
						
							| 
									
										
										
										
											2007-03-28 13:48:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | /* sim_exec return value */ | 
					
						
							|  |  |  | #define NODE_EXEC_FINISHED	0
 | 
					
						
							|  |  |  | #define NODE_EXEC_SUSPEND	1
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
  later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
  to re-use these temp files on starting Blender or loading files, showing
  the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
											
										 
											2006-02-18 13:28:44 +00:00
										 |  |  | /* nodetype->nclass, for add-menu and themes */ | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | #define NODE_CLASS_INPUT			0
 | 
					
						
							|  |  |  | #define NODE_CLASS_OUTPUT			1
 | 
					
						
							|  |  |  | #define NODE_CLASS_OP_COLOR			3
 | 
					
						
							|  |  |  | #define NODE_CLASS_OP_VECTOR		4
 | 
					
						
							|  |  |  | #define NODE_CLASS_OP_FILTER		5
 | 
					
						
							|  |  |  | #define NODE_CLASS_GROUP			6
 | 
					
						
							|  |  |  | #define NODE_CLASS_FILE				7
 | 
					
						
							|  |  |  | #define NODE_CLASS_CONVERTOR		8
 | 
					
						
							|  |  |  | #define NODE_CLASS_MATTE			9
 | 
					
						
							|  |  |  | #define NODE_CLASS_DISTORT			10
 | 
					
						
							| 
									
										
										
										
											2012-05-29 09:37:23 +00:00
										 |  |  | #define NODE_CLASS_OP_DYNAMIC		11 /* deprecated */
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | #define NODE_CLASS_PATTERN			12
 | 
					
						
							|  |  |  | #define NODE_CLASS_TEXTURE			13
 | 
					
						
							|  |  |  | #define NODE_CLASS_EXECUTION		14
 | 
					
						
							|  |  |  | #define NODE_CLASS_GETDATA			15
 | 
					
						
							|  |  |  | #define NODE_CLASS_SETDATA			16
 | 
					
						
							|  |  |  | #define NODE_CLASS_MATH				17
 | 
					
						
							|  |  |  | #define NODE_CLASS_MATH_VECTOR		18
 | 
					
						
							|  |  |  | #define NODE_CLASS_MATH_ROTATION	19
 | 
					
						
							|  |  |  | #define NODE_CLASS_PARTICLES		25
 | 
					
						
							|  |  |  | #define NODE_CLASS_TRANSFORM		30
 | 
					
						
							|  |  |  | #define NODE_CLASS_COMBINE			31
 | 
					
						
							| 
									
										
										
										
											2012-11-03 14:32:26 +00:00
										 |  |  | #define NODE_CLASS_SCRIPT			32
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | #define NODE_CLASS_INTERFACE		33
 | 
					
						
							| 
									
										
										
										
											2011-11-02 19:24:30 +00:00
										 |  |  | #define NODE_CLASS_SHADER 			40
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | #define NODE_CLASS_LAYOUT			100
 | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-02 19:24:30 +00:00
										 |  |  | /* nodetype->compatibility */ | 
					
						
							|  |  |  | #define NODE_OLD_SHADING	1
 | 
					
						
							|  |  |  | #define NODE_NEW_SHADING	2
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-22 14:13:33 +00:00
										 |  |  | /* node resize directions */ | 
					
						
							|  |  |  | #define NODE_RESIZE_TOP		1
 | 
					
						
							|  |  |  | #define NODE_RESIZE_BOTTOM	2
 | 
					
						
							|  |  |  | #define NODE_RESIZE_RIGHT	4
 | 
					
						
							|  |  |  | #define NODE_RESIZE_LEFT	8
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-22 10:46:27 +00:00
										 |  |  | typedef enum eNodeSizePreset { | 
					
						
							|  |  |  | 	NODE_SIZE_DEFAULT, | 
					
						
							|  |  |  | 	NODE_SIZE_SMALL, | 
					
						
							| 
									
										
										
										
											2013-05-21 20:21:46 +00:00
										 |  |  | 	NODE_SIZE_MIDDLE, | 
					
						
							| 
									
										
										
										
											2013-02-22 10:46:27 +00:00
										 |  |  | 	NODE_SIZE_LARGE | 
					
						
							|  |  |  | } eNodeSizePreset; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | struct bNodeTreeExec; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-07 22:14:48 +00:00
										 |  |  | typedef void (*bNodeClassCallback)(void *calldata, int nclass, const char *name); | 
					
						
							| 
									
										
										
										
											2012-06-06 22:38:39 +00:00
										 |  |  | typedef struct bNodeTreeType { | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	int type;						/* type identifier */ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	char idname[64];				/* identifier name */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	char ui_name[64]; | 
					
						
							|  |  |  | 	char ui_description[256]; | 
					
						
							|  |  |  | 	int ui_icon; | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* callbacks */ | 
					
						
							|  |  |  | 	void (*free_cache)(struct bNodeTree *ntree); | 
					
						
							|  |  |  | 	void (*free_node_cache)(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2011-11-07 22:14:48 +00:00
										 |  |  | 	void (*foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func);	/* iteration over all node classes */ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	/* Check visibility in the node editor */ | 
					
						
							|  |  |  | 	int (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype); | 
					
						
							|  |  |  | 	/* Select a node tree from the context */ | 
					
						
							|  |  |  | 	void (*get_from_context)(const struct bContext *C, struct bNodeTreeType *ntreetype, | 
					
						
							|  |  |  | 	                         struct bNodeTree **r_ntree, struct ID **r_id, struct ID **r_from); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* calls allowing threaded composite */ | 
					
						
							|  |  |  | 	void (*localize)(struct bNodeTree *localtree, struct bNodeTree *ntree); | 
					
						
							|  |  |  | 	void (*local_sync)(struct bNodeTree *localtree, struct bNodeTree *ntree); | 
					
						
							|  |  |  | 	void (*local_merge)(struct bNodeTree *localtree, struct bNodeTree *ntree); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Tree update. Overrides nodetype->updatetreefunc! */ | 
					
						
							|  |  |  | 	void (*update)(struct bNodeTree *ntree); | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	int (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link); | 
					
						
							| 
									
										
										
										
											2013-12-08 21:53:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void (*node_add_init)(struct bNodeTree *ntree, struct bNode *bnode); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* RNA integration */ | 
					
						
							|  |  |  | 	ExtensionRNA ext; | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | } bNodeTreeType; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Generic API, Trees
 | 
					
						
							|  |  |  |  * \{ */ | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNodeTreeType *ntreeTypeFind(const char *idname); | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | void ntreeTypeAdd(struct bNodeTreeType *nt); | 
					
						
							|  |  |  | void ntreeTypeFreeLink(struct bNodeTreeType *nt); | 
					
						
							| 
									
										
										
										
											2013-03-19 13:40:16 +00:00
										 |  |  | bool ntreeIsRegistered(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct GHashIterator *ntreeTypeGetIterator(void); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* helper macros for iterating over tree types */ | 
					
						
							|  |  |  | #define NODE_TREE_TYPES_BEGIN(ntype) \
 | 
					
						
							|  |  |  | { \ | 
					
						
							|  |  |  | 	GHashIterator *__node_tree_type_iter__ = ntreeTypeGetIterator(); \ | 
					
						
							| 
									
										
										
										
											2013-05-08 12:58:11 +00:00
										 |  |  | 	for (; !BLI_ghashIterator_done(__node_tree_type_iter__); BLI_ghashIterator_step(__node_tree_type_iter__)) { \ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 		bNodeTreeType *ntype = BLI_ghashIterator_getValue(__node_tree_type_iter__); | 
					
						
							| 
									
										
											  
											
												Orange: more noodle updates!
**** NEW: Group Nodes
Node trees usually become messy and confusing quickly, so we need
not only a way to collapse Nodes into single 'groups', but also a
way to re-use that data to create libraries of effects.
This has been done by making a new Library data type, the NodeTree.
Everything that has been grouped is stored here, and available for
re-use, appending or linking. These NodeTrees are fully generic,
i.e. can store shader trees, composit trees, and so on. The 'type'
value as stored in the NodeTree will keep track of internal type
definitions and execute/drawing callbacks. Needless to say, re-using
shader trees in a composit tree is a bit useless, and will be
prevented in the browsing code. :)
So; any NodeTree can become a "Goup Node" inside in a NodeTree. This
Group Node then works just like any Node.
To prevent the current code to become too complex, I've disabled
the possibility to insert Groups inside of Groups. That might be
enabled later, but is a real nasty piece of code to get OK.
Since Group Nodes are a dynamic Node type, a lot of work has been
done to ensure Node definitions can be dynamic too, but still allow
to be stored in files, and allow to be verified for type-definition
changes on reloading. This system needs a little bit maturing still,
so the Python gurus should better wait a little bit! (Also for me to
write the definite API docs for it).
What works now:
- Press CTRL+G to create a new Group. The grouping code checks for
impossible selections (like an unselected node between selected nodes).
Everthing that's selected then gets removed from the current tree, and
inserted in a new NodeTree library data block. A Group Node then is
added which links to this new NodeTree.
- Press ALT+G to ungroup. This will not delete the NodeTree library
data, but just duplicate the Group into the current tree.
- Press TAB, or click on the NodeTree icon to edit Groups. Note that
NodeTrees are instances, so editing one Group will also change the
other users.
This also means that when removing nodes in a Group (or hiding sockets
or changing internal links) this is immediately corrected for all users
of this Group, also in other Materials.
- While editing Groups, only the internal Nodes can be edited. A single
click outside of the Group boundary will close this 'edit mode'.
What needs to be done:
- SHIFT+A menu in toolbox style, also including a list of Groups
- Enable the single-user button in the Group Node
- Displaying all (visible) internal group UI elements in the Node Panel
- Enable Library linking and prevent editing of Groups then.
**** NEW: Socket Visibility control
Node types will be generated with a lot of possible inputs or outputs,
and drawing all sockets all the time isn't very useful then.
A new option in the Node header ('plus' icon) allows to either hide all
unused sockets (first keypress) or to reveil them (when there are hidden
sockets, the icon displays black, otherwise it's blended).
Hidden sockets in Nodes also are not exported to a Group, so this way
you can control what options (in/outputs) exactly are available.
To be done:
- a way to hide individual sockets, like with a RMB click on it.
**** NEW: Nodes now render!
This is still quite primitive, more on a level to replace the (now
obsolete and disabled) Material Layers.
What needs to be done:
- make the "Geometry" node work properly, also for AA textures
- make the Texture Node work (does very little at the moment)
- give Material Nodes all inputs as needed (like Map-to Panel)
- find a way to export more data from a Material Node, like the
  shadow value, or light intensity only, etc
Very important also to separate from the Material Buttons the
"global" options, like "Ztransp" or "Wire" or "Halo". These can not
be set for each Material-Node individually.
Also note that the Preview Render (Buttons window) now renders a bit
differently. This was a horrid piece of antique code, using a totally
incompatible way of rendering. Target is to fully re-use internal
render code for previews.
OK... that's it mostly. Now test!
											
										 
											2006-01-02 13:06:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | #define NODE_TREE_TYPES_END \
 | 
					
						
							|  |  |  | 	} \ | 
					
						
							|  |  |  | 	BLI_ghashIterator_free(__node_tree_type_iter__); \ | 
					
						
							| 
									
										
										
										
											2013-09-13 08:45:20 +00:00
										 |  |  | } (void)0 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | void ntreeSetTypes(const struct bContext *C, struct bNodeTree *ntree); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct bNodeTree *ntreeAddTree(struct Main *bmain, const char *name, const char *idname); | 
					
						
							| 
									
										
										
										
											2007-03-26 15:07:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-22 08:54:18 +00:00
										 |  |  | /* copy/free funcs, need to manage ID users */ | 
					
						
							| 
									
										
										
										
											2014-01-28 03:52:21 +11:00
										 |  |  | void              ntreeFreeTree_ex(struct bNodeTree *ntree, const bool do_id_user); | 
					
						
							| 
									
										
										
										
											2012-08-22 08:54:18 +00:00
										 |  |  | void              ntreeFreeTree(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2014-07-16 00:11:44 +09:00
										 |  |  | struct bNodeTree *ntreeCopyTree_ex(struct bNodeTree *ntree, struct Main *bmain, const bool do_id_user); | 
					
						
							| 
									
										
										
										
											2011-02-11 09:37:58 +00:00
										 |  |  | struct bNodeTree *ntreeCopyTree(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2014-01-28 03:52:21 +11:00
										 |  |  | void              ntreeSwitchID_ex(struct bNodeTree *ntree, struct ID *sce_from, struct ID *sce_to, const bool do_id_user); | 
					
						
							| 
									
										
										
										
											2012-08-22 08:54:18 +00:00
										 |  |  | void              ntreeSwitchID(struct bNodeTree *ntree, struct ID *sce_from, struct ID *sce_to); | 
					
						
							|  |  |  | /* node->id user count */ | 
					
						
							|  |  |  | void              ntreeUserIncrefID(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void              ntreeUserDecrefID(struct bNodeTree *ntree); | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-22 08:54:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-03 16:21:43 +00:00
										 |  |  | struct bNodeTree *ntreeFromID(struct ID *id); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-22 08:54:18 +00:00
										 |  |  | void              ntreeMakeLocal(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2014-01-27 20:17:56 +11:00
										 |  |  | bool              ntreeHasType(const struct bNodeTree *ntree, int type); | 
					
						
							|  |  |  | bool              ntreeHasTree(const struct bNodeTree *ntree, const struct bNodeTree *lookup); | 
					
						
							| 
									
										
										
										
											2013-05-07 15:28:42 +00:00
										 |  |  | void              ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | /* XXX Currently each tree update call does call to ntreeVerifyNodes too.
 | 
					
						
							|  |  |  |  * Some day this should be replaced by a decent depsgraph automatism! | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2012-08-22 08:54:18 +00:00
										 |  |  | void              ntreeVerifyNodes(struct Main *main, struct ID *id); | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-22 08:54:18 +00:00
										 |  |  | void              ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, int *totnodes); | 
					
						
							| 
									
										
											  
											
												Orange: more noodle updates!
**** NEW: Group Nodes
Node trees usually become messy and confusing quickly, so we need
not only a way to collapse Nodes into single 'groups', but also a
way to re-use that data to create libraries of effects.
This has been done by making a new Library data type, the NodeTree.
Everything that has been grouped is stored here, and available for
re-use, appending or linking. These NodeTrees are fully generic,
i.e. can store shader trees, composit trees, and so on. The 'type'
value as stored in the NodeTree will keep track of internal type
definitions and execute/drawing callbacks. Needless to say, re-using
shader trees in a composit tree is a bit useless, and will be
prevented in the browsing code. :)
So; any NodeTree can become a "Goup Node" inside in a NodeTree. This
Group Node then works just like any Node.
To prevent the current code to become too complex, I've disabled
the possibility to insert Groups inside of Groups. That might be
enabled later, but is a real nasty piece of code to get OK.
Since Group Nodes are a dynamic Node type, a lot of work has been
done to ensure Node definitions can be dynamic too, but still allow
to be stored in files, and allow to be verified for type-definition
changes on reloading. This system needs a little bit maturing still,
so the Python gurus should better wait a little bit! (Also for me to
write the definite API docs for it).
What works now:
- Press CTRL+G to create a new Group. The grouping code checks for
impossible selections (like an unselected node between selected nodes).
Everthing that's selected then gets removed from the current tree, and
inserted in a new NodeTree library data block. A Group Node then is
added which links to this new NodeTree.
- Press ALT+G to ungroup. This will not delete the NodeTree library
data, but just duplicate the Group into the current tree.
- Press TAB, or click on the NodeTree icon to edit Groups. Note that
NodeTrees are instances, so editing one Group will also change the
other users.
This also means that when removing nodes in a Group (or hiding sockets
or changing internal links) this is immediately corrected for all users
of this Group, also in other Materials.
- While editing Groups, only the internal Nodes can be edited. A single
click outside of the Group boundary will close this 'edit mode'.
What needs to be done:
- SHIFT+A menu in toolbox style, also including a list of Groups
- Enable the single-user button in the Group Node
- Displaying all (visible) internal group UI elements in the Node Panel
- Enable Library linking and prevent editing of Groups then.
**** NEW: Socket Visibility control
Node types will be generated with a lot of possible inputs or outputs,
and drawing all sockets all the time isn't very useful then.
A new option in the Node header ('plus' icon) allows to either hide all
unused sockets (first keypress) or to reveil them (when there are hidden
sockets, the icon displays black, otherwise it's blended).
Hidden sockets in Nodes also are not exported to a Group, so this way
you can control what options (in/outputs) exactly are available.
To be done:
- a way to hide individual sockets, like with a RMB click on it.
**** NEW: Nodes now render!
This is still quite primitive, more on a level to replace the (now
obsolete and disabled) Material Layers.
What needs to be done:
- make the "Geometry" node work properly, also for AA textures
- make the Texture Node work (does very little at the moment)
- give Material Nodes all inputs as needed (like Map-to Panel)
- find a way to export more data from a Material Node, like the
  shadow value, or light intensity only, etc
Very important also to separate from the Material Buttons the
"global" options, like "Ztransp" or "Wire" or "Halo". These can not
be set for each Material-Node individually.
Also note that the Preview Render (Buttons window) now renders a bit
differently. This was a horrid piece of antique code, using a totally
incompatible way of rendering. Target is to fully re-use internal
render code for previews.
OK... that's it mostly. Now test!
											
										 
											2006-01-02 13:06:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | /* XXX old trees handle output flags automatically based on special output node types and last active selection.
 | 
					
						
							|  |  |  |  * new tree types have a per-output socket flag to indicate the final output to use explicitly. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            ntreeSetOutput(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2006-06-19 17:29:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            ntreeFreeCache(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | int             ntreeNodeExists(struct bNodeTree *ntree, struct bNode *testnode); | 
					
						
							|  |  |  | int             ntreeOutputExists(struct bNode *node, struct bNodeSocket *testsock); | 
					
						
							| 
									
										
										
										
											2009-01-27 17:12:40 +00:00
										 |  |  | struct bNodeTree *ntreeLocalize(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            ntreeLocalSync(struct bNodeTree *localtree, struct bNodeTree *ntree); | 
					
						
							|  |  |  | void            ntreeLocalMerge(struct bNodeTree *localtree, struct bNodeTree *ntree); | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Node Tree Interface
 | 
					
						
							|  |  |  |  * \{ */ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNodeSocket *ntreeFindSocketInterface(struct bNodeTree *ntree, int in_out, const char *identifier); | 
					
						
							|  |  |  | struct bNodeSocket *ntreeAddSocketInterface(struct bNodeTree *ntree, int in_out, const char *idname, const char *name); | 
					
						
							|  |  |  | struct bNodeSocket *ntreeInsertSocketInterface(struct bNodeTree *ntree, int in_out, const char *idname, | 
					
						
							|  |  |  |                                                struct bNodeSocket *next_sock, const char *name); | 
					
						
							|  |  |  | struct bNodeSocket *ntreeAddSocketInterfaceFromSocket(struct bNodeTree *ntree, struct bNode *from_node, struct bNodeSocket *from_sock); | 
					
						
							|  |  |  | struct bNodeSocket *ntreeInsertSocketInterfaceFromSocket(struct bNodeTree *ntree, struct bNodeSocket *next_sock, | 
					
						
							|  |  |  |                                                          struct bNode *from_node, struct bNodeSocket *from_sock); | 
					
						
							|  |  |  | void            ntreeRemoveSocketInterface(struct bNodeTree *ntree, struct bNodeSocket *sock); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct StructRNA *ntreeInterfaceTypeGet(struct bNodeTree *ntree, int create); | 
					
						
							|  |  |  | void ntreeInterfaceTypeFree(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void ntreeInterfaceTypeUpdate(struct bNodeTree *ntree); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Generic API, Nodes
 | 
					
						
							|  |  |  |  * \{ */ | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNodeType *nodeTypeFind(const char *idname); | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | void			nodeRegisterType(struct bNodeType *ntype); | 
					
						
							|  |  |  | void			nodeUnregisterType(struct bNodeType *ntype); | 
					
						
							| 
									
										
										
										
											2013-03-19 13:40:16 +00:00
										 |  |  | bool			nodeIsRegistered(struct bNode *node); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct GHashIterator *nodeTypeGetIterator(void); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* helper macros for iterating over node types */ | 
					
						
							|  |  |  | #define NODE_TYPES_BEGIN(ntype) \
 | 
					
						
							|  |  |  | { \ | 
					
						
							|  |  |  | 	GHashIterator *__node_type_iter__ = nodeTypeGetIterator(); \ | 
					
						
							| 
									
										
										
										
											2013-05-08 12:58:11 +00:00
										 |  |  | 	for (; !BLI_ghashIterator_done(__node_type_iter__); BLI_ghashIterator_step(__node_type_iter__)) { \ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 		bNodeType *ntype = BLI_ghashIterator_getValue(__node_type_iter__); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define NODE_TYPES_END \
 | 
					
						
							|  |  |  | 	} \ | 
					
						
							|  |  |  | 	BLI_ghashIterator_free(__node_type_iter__); \ | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct bNodeSocketType *nodeSocketTypeFind(const char *idname); | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | void			nodeRegisterSocketType(struct bNodeSocketType *stype); | 
					
						
							|  |  |  | void			nodeUnregisterSocketType(struct bNodeSocketType *stype); | 
					
						
							| 
									
										
										
										
											2013-03-19 13:40:16 +00:00
										 |  |  | bool			nodeSocketIsRegistered(struct bNodeSocket *sock); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct GHashIterator *nodeSocketTypeGetIterator(void); | 
					
						
							| 
									
										
										
										
											2013-11-24 15:23:38 +11:00
										 |  |  | const char *nodeStaticSocketType(int type, int subtype); | 
					
						
							|  |  |  | const char *nodeStaticSocketInterfaceType(int type, int subtype); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* helper macros for iterating over node types */ | 
					
						
							|  |  |  | #define NODE_SOCKET_TYPES_BEGIN(stype) \
 | 
					
						
							|  |  |  | { \ | 
					
						
							|  |  |  | 	GHashIterator *__node_socket_type_iter__ = nodeSocketTypeGetIterator(); \ | 
					
						
							| 
									
										
										
										
											2013-05-08 12:58:11 +00:00
										 |  |  | 	for (; !BLI_ghashIterator_done(__node_socket_type_iter__); BLI_ghashIterator_step(__node_socket_type_iter__)) { \ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 		bNodeSocketType *stype = BLI_ghashIterator_getValue(__node_socket_type_iter__); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define NODE_SOCKET_TYPES_END \
 | 
					
						
							|  |  |  | 	} \ | 
					
						
							|  |  |  | 	BLI_ghashIterator_free(__node_socket_type_iter__); \ | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct bNodeSocket *nodeFindSocket(struct bNode *node, int in_out, const char *identifier); | 
					
						
							|  |  |  | struct bNodeSocket *nodeAddSocket(struct bNodeTree *ntree, struct bNode *node, int in_out, const char *idname, | 
					
						
							|  |  |  |                                   const char *identifier, const char *name); | 
					
						
							|  |  |  | struct bNodeSocket *nodeInsertSocket(struct bNodeTree *ntree, struct bNode *node, int in_out, const char *idname, | 
					
						
							|  |  |  |                                      struct bNodeSocket *next_sock, const char *identifier, const char *name); | 
					
						
							|  |  |  | struct bNodeSocket *nodeAddStaticSocket(struct bNodeTree *ntree, struct bNode *node, int in_out, int type, int subtype, | 
					
						
							|  |  |  |                                         const char *identifier, const char *name); | 
					
						
							|  |  |  | struct bNodeSocket *nodeInsertStaticSocket(struct bNodeTree *ntree, struct bNode *node, int in_out, int type, int subtype, | 
					
						
							|  |  |  |                                            struct bNodeSocket *next_sock, const char *identifier, const char *name); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock); | 
					
						
							|  |  |  | void nodeRemoveAllSockets(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
											  
											
												Orange: more noodle updates!
**** NEW: Group Nodes
Node trees usually become messy and confusing quickly, so we need
not only a way to collapse Nodes into single 'groups', but also a
way to re-use that data to create libraries of effects.
This has been done by making a new Library data type, the NodeTree.
Everything that has been grouped is stored here, and available for
re-use, appending or linking. These NodeTrees are fully generic,
i.e. can store shader trees, composit trees, and so on. The 'type'
value as stored in the NodeTree will keep track of internal type
definitions and execute/drawing callbacks. Needless to say, re-using
shader trees in a composit tree is a bit useless, and will be
prevented in the browsing code. :)
So; any NodeTree can become a "Goup Node" inside in a NodeTree. This
Group Node then works just like any Node.
To prevent the current code to become too complex, I've disabled
the possibility to insert Groups inside of Groups. That might be
enabled later, but is a real nasty piece of code to get OK.
Since Group Nodes are a dynamic Node type, a lot of work has been
done to ensure Node definitions can be dynamic too, but still allow
to be stored in files, and allow to be verified for type-definition
changes on reloading. This system needs a little bit maturing still,
so the Python gurus should better wait a little bit! (Also for me to
write the definite API docs for it).
What works now:
- Press CTRL+G to create a new Group. The grouping code checks for
impossible selections (like an unselected node between selected nodes).
Everthing that's selected then gets removed from the current tree, and
inserted in a new NodeTree library data block. A Group Node then is
added which links to this new NodeTree.
- Press ALT+G to ungroup. This will not delete the NodeTree library
data, but just duplicate the Group into the current tree.
- Press TAB, or click on the NodeTree icon to edit Groups. Note that
NodeTrees are instances, so editing one Group will also change the
other users.
This also means that when removing nodes in a Group (or hiding sockets
or changing internal links) this is immediately corrected for all users
of this Group, also in other Materials.
- While editing Groups, only the internal Nodes can be edited. A single
click outside of the Group boundary will close this 'edit mode'.
What needs to be done:
- SHIFT+A menu in toolbox style, also including a list of Groups
- Enable the single-user button in the Group Node
- Displaying all (visible) internal group UI elements in the Node Panel
- Enable Library linking and prevent editing of Groups then.
**** NEW: Socket Visibility control
Node types will be generated with a lot of possible inputs or outputs,
and drawing all sockets all the time isn't very useful then.
A new option in the Node header ('plus' icon) allows to either hide all
unused sockets (first keypress) or to reveil them (when there are hidden
sockets, the icon displays black, otherwise it's blended).
Hidden sockets in Nodes also are not exported to a Group, so this way
you can control what options (in/outputs) exactly are available.
To be done:
- a way to hide individual sockets, like with a RMB click on it.
**** NEW: Nodes now render!
This is still quite primitive, more on a level to replace the (now
obsolete and disabled) Material Layers.
What needs to be done:
- make the "Geometry" node work properly, also for AA textures
- make the Texture Node work (does very little at the moment)
- give Material Nodes all inputs as needed (like Map-to Panel)
- find a way to export more data from a Material Node, like the
  shadow value, or light intensity only, etc
Very important also to separate from the Material Buttons the
"global" options, like "Ztransp" or "Wire" or "Halo". These can not
be set for each Material-Node individually.
Also note that the Preview Render (Buttons window) now renders a bit
differently. This was a horrid piece of antique code, using a totally
incompatible way of rendering. Target is to fully re-use internal
render code for previews.
OK... that's it mostly. Now test!
											
										 
											2006-01-02 13:06:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNode	*nodeAddNode(const struct bContext *C, struct bNodeTree *ntree, const char *idname); | 
					
						
							|  |  |  | struct bNode	*nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							|  |  |  | void            nodeUniqueName(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeFreeNode(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2011-02-21 13:47:49 +00:00
										 |  |  | struct bNode	*nodeCopyNode(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2005-12-18 23:08:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | struct bNodeLink *nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link); | 
					
						
							|  |  |  | void            nodeRemSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock); | 
					
						
							| 
									
										
										
										
											2015-02-20 19:54:28 +11:00
										 |  |  | bool            nodeLinkIsHidden(struct bNodeLink *link); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2005-12-20 15:43:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeToView(struct bNode *node, float x, float y, float *rx, float *ry); | 
					
						
							|  |  |  | void            nodeFromView(struct bNode *node, float x, float y, float *rx, float *ry); | 
					
						
							| 
									
										
										
										
											2014-04-01 11:34:00 +11:00
										 |  |  | bool            nodeAttachNodeCheck(struct bNode *node, struct bNode *parent); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeAttachNode(struct bNode *node, struct bNode *parent); | 
					
						
							|  |  |  | void            nodeDetachNode(struct bNode *node); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | struct bNode   *nodeFindNodebyName(struct bNodeTree *ntree, const char *name); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | int             nodeFindNode(struct bNodeTree *ntree, struct bNodeSocket *sock, struct bNode **nodep, int *sockindex); | 
					
						
							| 
									
										
										
										
											2007-12-27 10:17:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-18 23:08:22 +00:00
										 |  |  | struct bNodeLink *nodeFindLink(struct bNodeTree *ntree, struct bNodeSocket *from, struct bNodeSocket *to); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | int             nodeCountSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock); | 
					
						
							| 
									
										
										
										
											2005-12-30 11:25:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-03-31 23:39:08 +11:00
										 |  |  | void            nodeSetSelected(struct bNode *node, bool select); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeSetActive(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							|  |  |  | struct bNode   *nodeGetActive(struct bNodeTree *ntree); | 
					
						
							|  |  |  | struct bNode   *nodeGetActiveID(struct bNodeTree *ntree, short idtype); | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | bool            nodeSetActiveID(struct bNodeTree *ntree, short idtype, struct ID *id); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeClearActive(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void            nodeClearActiveID(struct bNodeTree *ntree, short idtype); | 
					
						
							|  |  |  | struct bNode   *nodeGetActiveTexture(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
											
												Orange; daily noodler update commit.
- Adding execution code for Node trees. Was a bit a puzzle, since I want
  it to be multithreading by design. This now is solved by defining a
  stack per tree for all data that's being written into. This stack, which
  resides now in the NodeTree itself, then can be allocated per thread.
- For testing pleasure, I've added a 'mix node' and a 'show node', so
  you can already see it do something. :)
- reshuffled structure, to put things nice together, and have easier node
  adding. Current state is still WIP though, structure might change.
  For the record; new file node_shaders.c will contain all shader node
  definitions, apart from the drawing callbacks.
Next: I'm going to check on Andrea's work on icons now, since this is very
much needed for true shader/composit work.
Now back to release work...
											
										 
											2005-12-21 14:24:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            nodeUpdate(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2013-11-26 06:39:14 +11:00
										 |  |  | bool            nodeUpdateID(struct bNodeTree *ntree, struct ID *id); | 
					
						
							| 
									
										
										
										
											2012-10-25 16:49:06 +00:00
										 |  |  | void            nodeUpdateInternalLinks(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | void            nodeSynchronizeID(struct bNode *node, bool copy_to_id); | 
					
						
							| 
									
										
										
										
											2008-02-24 22:27:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | int             nodeSocketIsHidden(struct bNodeSocket *sock); | 
					
						
							| 
									
										
										
										
											2015-01-14 11:14:21 +01:00
										 |  |  | void            ntreeTagUsedSockets(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2012-01-08 10:23:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-02 09:52:37 +00:00
										 |  |  | /* Node Clipboard */ | 
					
						
							| 
									
										
										
										
											2012-08-06 08:41:45 +00:00
										 |  |  | void                   BKE_node_clipboard_init(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void                   BKE_node_clipboard_clear(void); | 
					
						
							| 
									
										
										
										
											2014-01-28 03:52:21 +11:00
										 |  |  | bool                   BKE_node_clipboard_validate(void); | 
					
						
							| 
									
										
										
										
											2012-08-06 08:41:45 +00:00
										 |  |  | void                   BKE_node_clipboard_add_node(struct bNode *node); | 
					
						
							|  |  |  | void                   BKE_node_clipboard_add_link(struct bNodeLink *link); | 
					
						
							| 
									
										
										
										
											2012-08-06 08:25:24 +00:00
										 |  |  | const struct ListBase *BKE_node_clipboard_get_nodes(void); | 
					
						
							|  |  |  | const struct ListBase *BKE_node_clipboard_get_links(void); | 
					
						
							| 
									
										
										
										
											2012-08-06 08:41:45 +00:00
										 |  |  | int                    BKE_node_clipboard_get_type(void); | 
					
						
							| 
									
										
										
										
											2012-08-02 09:52:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | /* Node Instance Hash */ | 
					
						
							| 
									
										
										
										
											2015-04-07 11:25:42 +10:00
										 |  |  | typedef struct bNodeInstanceHash { | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	 GHash *ghash;	/* XXX should be made a direct member, GHash allocation needs to support it */ | 
					
						
							|  |  |  | } bNodeInstanceHash; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef void (*bNodeInstanceValueFP)(void *value); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern const bNodeInstanceKey NODE_INSTANCE_KEY_BASE; | 
					
						
							| 
									
										
										
										
											2013-04-24 16:36:50 +00:00
										 |  |  | extern const bNodeInstanceKey NODE_INSTANCE_KEY_NONE; | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | bNodeInstanceKey       BKE_node_instance_key(bNodeInstanceKey parent_key, struct bNodeTree *ntree, struct bNode *node); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | bNodeInstanceHash     *BKE_node_instance_hash_new(const char *info); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | void                   BKE_node_instance_hash_free(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp); | 
					
						
							|  |  |  | void                   BKE_node_instance_hash_insert(bNodeInstanceHash *hash, bNodeInstanceKey key, void *value); | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | void                  *BKE_node_instance_hash_lookup(bNodeInstanceHash *hash, bNodeInstanceKey key); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | int                    BKE_node_instance_hash_remove(bNodeInstanceHash *hash, bNodeInstanceKey key, bNodeInstanceValueFP valfreefp); | 
					
						
							|  |  |  | void                   BKE_node_instance_hash_clear(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp); | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | void                  *BKE_node_instance_hash_pop(bNodeInstanceHash *hash, bNodeInstanceKey key); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | int                    BKE_node_instance_hash_haskey(bNodeInstanceHash *hash, bNodeInstanceKey key); | 
					
						
							|  |  |  | int                    BKE_node_instance_hash_size(bNodeInstanceHash *hash); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void                   BKE_node_instance_hash_clear_tags(bNodeInstanceHash *hash); | 
					
						
							|  |  |  | void                   BKE_node_instance_hash_tag(bNodeInstanceHash *hash, void *value); | 
					
						
							| 
									
										
										
										
											2014-03-31 23:39:08 +11:00
										 |  |  | bool                   BKE_node_instance_hash_tag_key(bNodeInstanceHash *hash, bNodeInstanceKey key); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | void                   BKE_node_instance_hash_remove_untagged(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef GHashIterator bNodeInstanceHashIterator; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BLI_INLINE bNodeInstanceHashIterator *BKE_node_instance_hash_iterator_new(bNodeInstanceHash *hash) { return BLI_ghashIterator_new(hash->ghash); } | 
					
						
							|  |  |  | BLI_INLINE void                       BKE_node_instance_hash_iterator_init(bNodeInstanceHashIterator *iter, bNodeInstanceHash *hash) { BLI_ghashIterator_init(iter, hash->ghash); } | 
					
						
							|  |  |  | BLI_INLINE void                       BKE_node_instance_hash_iterator_free(bNodeInstanceHashIterator *iter) { BLI_ghashIterator_free(iter); } | 
					
						
							|  |  |  | BLI_INLINE bNodeInstanceKey           BKE_node_instance_hash_iterator_get_key(bNodeInstanceHashIterator *iter) { return *(bNodeInstanceKey *)BLI_ghashIterator_getKey(iter); } | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | BLI_INLINE void                      *BKE_node_instance_hash_iterator_get_value(bNodeInstanceHashIterator *iter) { return BLI_ghashIterator_getValue(iter); } | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | BLI_INLINE void                       BKE_node_instance_hash_iterator_step(bNodeInstanceHashIterator *iter) { BLI_ghashIterator_step(iter); } | 
					
						
							| 
									
										
										
										
											2013-05-08 12:58:11 +00:00
										 |  |  | BLI_INLINE bool                       BKE_node_instance_hash_iterator_done(bNodeInstanceHashIterator *iter) { return BLI_ghashIterator_done(iter); } | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define NODE_INSTANCE_HASH_ITER(iter_, hash_) \
 | 
					
						
							|  |  |  | 	for (BKE_node_instance_hash_iterator_init(&iter_, hash_); \ | 
					
						
							| 
									
										
										
										
											2013-05-08 12:58:11 +00:00
										 |  |  | 	     BKE_node_instance_hash_iterator_done(&iter_) == false; \ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	     BKE_node_instance_hash_iterator_step(&iter_)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Node Previews */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int             BKE_node_preview_used(struct bNode *node); | 
					
						
							| 
									
										
										
										
											2014-04-01 11:34:00 +11:00
										 |  |  | bNodePreview   *BKE_node_preview_verify(struct bNodeInstanceHash *previews, bNodeInstanceKey key, int xsize, int ysize, bool create); | 
					
						
							| 
									
										
										
										
											2013-03-18 18:25:05 +00:00
										 |  |  | bNodePreview   *BKE_node_preview_copy(struct bNodePreview *preview); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | void            BKE_node_preview_free(struct bNodePreview *preview); | 
					
						
							|  |  |  | void            BKE_node_preview_init_tree(struct bNodeTree *ntree, int xsize, int ysize, int create_previews); | 
					
						
							|  |  |  | void            BKE_node_preview_free_tree(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void            BKE_node_preview_remove_unused(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void            BKE_node_preview_clear(struct bNodePreview *preview); | 
					
						
							|  |  |  | void            BKE_node_preview_clear_tree(struct bNodeTree *ntree); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void            BKE_node_preview_sync_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree); | 
					
						
							| 
									
										
										
										
											2013-03-22 10:34:52 +00:00
										 |  |  | void            BKE_node_preview_merge_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree, bool remove_old); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-03 18:55:59 +11:00
										 |  |  | void            BKE_node_preview_set_pixel(struct bNodePreview *preview, const float col[4], int x, int y, bool do_manage); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Node Type Access
 | 
					
						
							|  |  |  |  * \{ */ | 
					
						
							| 
									
										
										
										
											2011-02-21 13:47:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-12 18:18:04 +00:00
										 |  |  | void            nodeLabel(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen); | 
					
						
							| 
									
										
											  
											
												Orange: more noodle updates!
**** NEW: Group Nodes
Node trees usually become messy and confusing quickly, so we need
not only a way to collapse Nodes into single 'groups', but also a
way to re-use that data to create libraries of effects.
This has been done by making a new Library data type, the NodeTree.
Everything that has been grouped is stored here, and available for
re-use, appending or linking. These NodeTrees are fully generic,
i.e. can store shader trees, composit trees, and so on. The 'type'
value as stored in the NodeTree will keep track of internal type
definitions and execute/drawing callbacks. Needless to say, re-using
shader trees in a composit tree is a bit useless, and will be
prevented in the browsing code. :)
So; any NodeTree can become a "Goup Node" inside in a NodeTree. This
Group Node then works just like any Node.
To prevent the current code to become too complex, I've disabled
the possibility to insert Groups inside of Groups. That might be
enabled later, but is a real nasty piece of code to get OK.
Since Group Nodes are a dynamic Node type, a lot of work has been
done to ensure Node definitions can be dynamic too, but still allow
to be stored in files, and allow to be verified for type-definition
changes on reloading. This system needs a little bit maturing still,
so the Python gurus should better wait a little bit! (Also for me to
write the definite API docs for it).
What works now:
- Press CTRL+G to create a new Group. The grouping code checks for
impossible selections (like an unselected node between selected nodes).
Everthing that's selected then gets removed from the current tree, and
inserted in a new NodeTree library data block. A Group Node then is
added which links to this new NodeTree.
- Press ALT+G to ungroup. This will not delete the NodeTree library
data, but just duplicate the Group into the current tree.
- Press TAB, or click on the NodeTree icon to edit Groups. Note that
NodeTrees are instances, so editing one Group will also change the
other users.
This also means that when removing nodes in a Group (or hiding sockets
or changing internal links) this is immediately corrected for all users
of this Group, also in other Materials.
- While editing Groups, only the internal Nodes can be edited. A single
click outside of the Group boundary will close this 'edit mode'.
What needs to be done:
- SHIFT+A menu in toolbox style, also including a list of Groups
- Enable the single-user button in the Group Node
- Displaying all (visible) internal group UI elements in the Node Panel
- Enable Library linking and prevent editing of Groups then.
**** NEW: Socket Visibility control
Node types will be generated with a lot of possible inputs or outputs,
and drawing all sockets all the time isn't very useful then.
A new option in the Node header ('plus' icon) allows to either hide all
unused sockets (first keypress) or to reveil them (when there are hidden
sockets, the icon displays black, otherwise it's blended).
Hidden sockets in Nodes also are not exported to a Group, so this way
you can control what options (in/outputs) exactly are available.
To be done:
- a way to hide individual sockets, like with a RMB click on it.
**** NEW: Nodes now render!
This is still quite primitive, more on a level to replace the (now
obsolete and disabled) Material Layers.
What needs to be done:
- make the "Geometry" node work properly, also for AA textures
- make the Texture Node work (does very little at the moment)
- give Material Nodes all inputs as needed (like Map-to Panel)
- find a way to export more data from a Material Node, like the
  shadow value, or light intensity only, etc
Very important also to separate from the Material Buttons the
"global" options, like "Ztransp" or "Wire" or "Halo". These can not
be set for each Material-Node individually.
Also note that the Preview Render (Buttons window) now renders a bit
differently. This was a horrid piece of antique code, using a totally
incompatible way of rendering. Target is to fully re-use internal
render code for previews.
OK... that's it mostly. Now test!
											
										 
											2006-01-02 13:06:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | int				nodeGroupPoll(struct bNodeTree *nodetree, struct bNodeTree *grouptree); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-07 09:33:36 +00:00
										 |  |  | /* Init a new node type struct with default values and callbacks */ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | void            node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag); | 
					
						
							|  |  |  | void            node_type_base_custom(struct bNodeType *ntype, const char *idname, const char *name, short nclass, short flag); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs); | 
					
						
							|  |  |  | void            node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth); | 
					
						
							| 
									
										
										
										
											2013-02-22 10:46:27 +00:00
										 |  |  | void            node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | void            node_type_init(struct bNodeType *ntype, void (*initfunc)(struct bNodeTree *ntree, struct bNode *node)); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            node_type_storage(struct bNodeType *ntype, | 
					
						
							|  |  |  |                                   const char *storagename, | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  |                                   void (*freefunc)(struct bNode *node), | 
					
						
							|  |  |  |                                   void (*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, struct bNode *src_node)); | 
					
						
							| 
									
										
										
										
											2013-11-12 18:18:04 +00:00
										 |  |  | void            node_type_label(struct bNodeType *ntype, void (*labelfunc)(struct bNodeTree *ntree, struct bNode *, char *label, int maxlen)); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            node_type_update(struct bNodeType *ntype, | 
					
						
							|  |  |  |                                  void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node), | 
					
						
							|  |  |  |                                  void (*verifyfunc)(struct bNodeTree *ntree, struct bNode *node, struct ID *id)); | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | void            node_type_exec(struct bNodeType *ntype, NodeInitExecFunction initexecfunc, NodeFreeExecFunction freeexecfunc, NodeExecFunction execfunc); | 
					
						
							|  |  |  | void            node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpufunc); | 
					
						
							| 
									
										
										
										
											2012-10-25 16:49:06 +00:00
										 |  |  | void            node_type_internal_links(struct bNodeType *ntype, void (*update_internal_links)(struct bNodeTree *, struct bNode *)); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            node_type_compatibility(struct bNodeType *ntype, short compatibility); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Node Generic Functions
 | 
					
						
							|  |  |  |  * \{ */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-23 11:33:29 -03:00
										 |  |  | bool BKE_node_is_connected_to_output(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | /* ************** COMMON NODES *************** */ | 
					
						
							| 
									
										
										
										
											2011-02-07 09:33:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | #define NODE_UNDEFINED	-2		/* node type is not registered */
 | 
					
						
							|  |  |  | #define NODE_CUSTOM		-1		/* for dynamically registered custom types */
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | #define NODE_GROUP		2
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | #define __NODE_FORLOOP	3		/* deprecated */
 | 
					
						
							| 
									
										
										
										
											2012-10-24 10:00:28 +00:00
										 |  |  | #define __NODE_WHILELOOP	4	/* deprecated */
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | #define NODE_FRAME		5
 | 
					
						
							| 
									
										
										
										
											2012-06-01 12:38:03 +00:00
										 |  |  | #define NODE_REROUTE	6
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | #define NODE_GROUP_INPUT	7
 | 
					
						
							|  |  |  | #define NODE_GROUP_OUTPUT	8
 | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | void BKE_node_tree_unlink_id(ID *id, struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2011-09-05 21:01:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Node Tree Iterator
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Utility macro for visiting every node tree in the library data, including local bNodeTree blocks in other IDs. | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  |  * This avoids the need for callback functions and allows executing code in a single inner code block. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Variables: | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *   nodetree:  The actual bNodeTree data block. | 
					
						
							|  |  |  |  *              Check nodetree->idname or nodetree->typeinfo to use only specific types. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *   id:        The owner of the bNodeTree data block. | 
					
						
							|  |  |  |  *              Same as nodetree if it's a linkable node tree from the library. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Examples: | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  |  * \code{.c} | 
					
						
							| 
									
										
										
										
											2013-03-26 22:45:06 +00:00
										 |  |  |  * FOREACH_NODETREE(bmain, nodetree) { | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  |  *     if (id == nodetree) | 
					
						
							|  |  |  |  *         printf("This is a linkable node tree"); | 
					
						
							| 
									
										
										
										
											2013-03-26 22:45:06 +00:00
										 |  |  |  * } FOREACH_NODETREE_END | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2013-03-26 22:45:06 +00:00
										 |  |  |  * FOREACH_NODETREE(bmain, nodetree) { | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  |  *     if (nodetree->idname == "ShaderNodeTree") | 
					
						
							|  |  |  |  *         printf("This is a shader node tree); | 
					
						
							|  |  |  |  *     if (GS(id) == ID_MA) | 
					
						
							|  |  |  |  *         printf(" and it's owned by a material"); | 
					
						
							| 
									
										
										
										
											2013-03-26 22:45:06 +00:00
										 |  |  |  * } FOREACH_NODETREE_END | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  |  * \endcode | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * \{ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  |  */ | 
					
						
							| 
									
										
											  
											
												Orange: more noodle updates!
**** NEW: Group Nodes
Node trees usually become messy and confusing quickly, so we need
not only a way to collapse Nodes into single 'groups', but also a
way to re-use that data to create libraries of effects.
This has been done by making a new Library data type, the NodeTree.
Everything that has been grouped is stored here, and available for
re-use, appending or linking. These NodeTrees are fully generic,
i.e. can store shader trees, composit trees, and so on. The 'type'
value as stored in the NodeTree will keep track of internal type
definitions and execute/drawing callbacks. Needless to say, re-using
shader trees in a composit tree is a bit useless, and will be
prevented in the browsing code. :)
So; any NodeTree can become a "Goup Node" inside in a NodeTree. This
Group Node then works just like any Node.
To prevent the current code to become too complex, I've disabled
the possibility to insert Groups inside of Groups. That might be
enabled later, but is a real nasty piece of code to get OK.
Since Group Nodes are a dynamic Node type, a lot of work has been
done to ensure Node definitions can be dynamic too, but still allow
to be stored in files, and allow to be verified for type-definition
changes on reloading. This system needs a little bit maturing still,
so the Python gurus should better wait a little bit! (Also for me to
write the definite API docs for it).
What works now:
- Press CTRL+G to create a new Group. The grouping code checks for
impossible selections (like an unselected node between selected nodes).
Everthing that's selected then gets removed from the current tree, and
inserted in a new NodeTree library data block. A Group Node then is
added which links to this new NodeTree.
- Press ALT+G to ungroup. This will not delete the NodeTree library
data, but just duplicate the Group into the current tree.
- Press TAB, or click on the NodeTree icon to edit Groups. Note that
NodeTrees are instances, so editing one Group will also change the
other users.
This also means that when removing nodes in a Group (or hiding sockets
or changing internal links) this is immediately corrected for all users
of this Group, also in other Materials.
- While editing Groups, only the internal Nodes can be edited. A single
click outside of the Group boundary will close this 'edit mode'.
What needs to be done:
- SHIFT+A menu in toolbox style, also including a list of Groups
- Enable the single-user button in the Group Node
- Displaying all (visible) internal group UI elements in the Node Panel
- Enable Library linking and prevent editing of Groups then.
**** NEW: Socket Visibility control
Node types will be generated with a lot of possible inputs or outputs,
and drawing all sockets all the time isn't very useful then.
A new option in the Node header ('plus' icon) allows to either hide all
unused sockets (first keypress) or to reveil them (when there are hidden
sockets, the icon displays black, otherwise it's blended).
Hidden sockets in Nodes also are not exported to a Group, so this way
you can control what options (in/outputs) exactly are available.
To be done:
- a way to hide individual sockets, like with a RMB click on it.
**** NEW: Nodes now render!
This is still quite primitive, more on a level to replace the (now
obsolete and disabled) Material Layers.
What needs to be done:
- make the "Geometry" node work properly, also for AA textures
- make the Texture Node work (does very little at the moment)
- give Material Nodes all inputs as needed (like Map-to Panel)
- find a way to export more data from a Material Node, like the
  shadow value, or light intensity only, etc
Very important also to separate from the Material Buttons the
"global" options, like "Ztransp" or "Wire" or "Halo". These can not
be set for each Material-Node individually.
Also note that the Preview Render (Buttons window) now renders a bit
differently. This was a horrid piece of antique code, using a totally
incompatible way of rendering. Target is to fully re-use internal
render code for previews.
OK... that's it mostly. Now test!
											
										 
											2006-01-02 13:06:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-26 22:37:41 +00:00
										 |  |  | /* should be an opaque type, only for internal use by BKE_node_tree_iter_*** */ | 
					
						
							|  |  |  | struct NodeTreeIterStore { | 
					
						
							|  |  |  | 	bNodeTree *ngroup; | 
					
						
							|  |  |  | 	Scene *scene; | 
					
						
							|  |  |  | 	Material *mat; | 
					
						
							|  |  |  | 	Tex *tex; | 
					
						
							|  |  |  | 	Lamp *lamp; | 
					
						
							|  |  |  | 	World *world; | 
					
						
							| 
									
										
										
										
											2014-05-03 18:51:53 +09:00
										 |  |  | 	FreestyleLineStyle *linestyle; | 
					
						
							| 
									
										
										
										
											2013-03-26 22:37:41 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *bmain); | 
					
						
							|  |  |  | bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter, | 
					
						
							|  |  |  |                              struct bNodeTree **r_nodetree, struct ID **r_id); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | #define FOREACH_NODETREE(bmain, _nodetree, _id) \
 | 
					
						
							|  |  |  | { \ | 
					
						
							| 
									
										
										
										
											2013-03-26 22:37:41 +00:00
										 |  |  | 	struct NodeTreeIterStore _nstore; \ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 	bNodeTree *_nodetree; \ | 
					
						
							|  |  |  | 	ID *_id; \ | 
					
						
							|  |  |  | 	/* avoid compiler warning about unused variables */ \ | 
					
						
							| 
									
										
										
										
											2013-03-26 22:37:41 +00:00
										 |  |  | 	BKE_node_tree_iter_init(&_nstore, bmain); \ | 
					
						
							|  |  |  | 	while (BKE_node_tree_iter_step(&_nstore, &_nodetree, &_id) == true) { \ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | 		if (_nodetree) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define FOREACH_NODETREE_END \
 | 
					
						
							|  |  |  | 		} \ | 
					
						
							| 
									
										
										
										
											2013-03-26 22:37:41 +00:00
										 |  |  | 	} \ | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							| 
									
										
										
										
											2012-10-01 07:54:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Shader Nodes
 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | struct ShadeInput; | 
					
						
							|  |  |  | struct ShadeResult; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* note: types are needed to restore callbacks, don't change values */ | 
					
						
							| 
									
										
											  
											
												Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
  later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
  to re-use these temp files on starting Blender or loading files, showing
  the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
											
										 
											2006-02-18 13:28:44 +00:00
										 |  |  | /* range 1 - 100 is reserved for common nodes */ | 
					
						
							|  |  |  | /* using toolbox, we add node groups by assuming the values below don't exceed NODE_GROUP_MENU for now */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | #define SH_NODE_OUTPUT		1
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define SH_NODE_MATERIAL	100
 | 
					
						
							| 
									
										
										
										
											2008-02-09 23:17:15 +00:00
										 |  |  | #define SH_NODE_RGB			101
 | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | #define SH_NODE_VALUE		102
 | 
					
						
							|  |  |  | #define SH_NODE_MIX_RGB		103
 | 
					
						
							|  |  |  | #define SH_NODE_VALTORGB	104
 | 
					
						
							|  |  |  | #define SH_NODE_RGBTOBW		105
 | 
					
						
							|  |  |  | #define SH_NODE_TEXTURE		106
 | 
					
						
							| 
									
										
										
										
											2005-12-30 11:25:15 +00:00
										 |  |  | #define SH_NODE_NORMAL		107
 | 
					
						
							|  |  |  | #define SH_NODE_GEOMETRY	108
 | 
					
						
							| 
									
										
										
										
											2006-01-04 12:13:13 +00:00
										 |  |  | #define SH_NODE_MAPPING		109
 | 
					
						
							| 
									
										
											  
											
												Orange:
- New UI element: the "Curve Button".
For mapping ranges (like 0 - 1) to another range, the curve button can be
used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.
To be able to use it, you have to allocate a CurveMapping struct and pass
this on to the button. The CurveMapping API is in the new C file
blenkernel/intern/colortools.c
It's as simple as calling:
   curvemap= curvemapping_add(3, 0, 0, 1, 1)
Which will create 3 curves, and sets a default 0-1 range. The current code
only supports up to 4 curves maximum per mapping struct.
The CurveMap button in Blender than handles allmost all  editing.
Evaluating a single channel:
   float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);
Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:
   curvemapping_evaluate3F(curvemap, newvec, oldvec);
Optimized versions for byte or short mapping is possible too, not done yet.
In butspace.c I've added a template wrapper for buttons around the curve, to
reveil settings or show tools; check this screenie:
http://www.blender.org/bf/curves.jpg
- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection
In the curve button itself, only LMB clicks are handled (like all UI elements
in Blender).
- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to grid
  (Yes I know... either one of these can be Blender compliant, not both!)
- if you drag a point exactly on top of another, it merges them
Other fixes:
- Icons now draw using "Safe RasterPos", so they align with pixel boundary.
  the old code made ints from the raster pos coordinate, which doesn't work
  well for zoom in/out situations
- bug in Node editing: buttons could not get freed, causing in memory error
  prints at end of a Blender session. That one was a very simple, but nasty
  error causing me all evening last night to find!
  (Hint; check diff of editnode.c, where uiDoButtons is called)
Last note: this adds 3 new files in our tree, I did scons, but not MSVC!
											
										 
											2006-01-08 11:41:06 +00:00
										 |  |  | #define SH_NODE_CURVE_VEC	110
 | 
					
						
							|  |  |  | #define SH_NODE_CURVE_RGB	111
 | 
					
						
							| 
									
										
										
										
											2006-12-22 08:10:29 +00:00
										 |  |  | #define SH_NODE_CAMERA		114
 | 
					
						
							| 
									
										
										
										
											2006-08-01 01:12:01 +00:00
										 |  |  | #define SH_NODE_MATH		115
 | 
					
						
							|  |  |  | #define SH_NODE_VECT_MATH	116
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | #define SH_NODE_SQUEEZE		117
 | 
					
						
							| 
									
										
											  
											
												== Shader nodes ==
* Geometry node: Front/back output
This is used as a mask for determining whether you're looking at the front side or back side of a mesh, useful for blending materials, my practical need was giving different materials to the pages of a magazine: http://mke3.net/blender/etc/frontback-h264.mov
Give 1.0 if it's the front side, and 0.0 if it's the back side.
* Extended material node
This is the same as the material node, but gives more available inputs and outputs, (basically just connecting up more of ShadeInput and ShadeResult to the node). I didn't want to add it to the normal simple Material node since you don't always need all that stuff, and it would make the node huge, but when you do need it, it's nice to have it.
== Comp nodes ==
* Invert node
Inverting is something that happens all the time in a node setup, and this makes it easier. It's been possible to invert previously by adding a mix node and subtracting the input from 1.0, but it's not the best way of doing it. This node:
 - makes it a lot faster to set up, rather than all the clicking required with the mix node
 - is a lot more usable amidst a complex comp setup, when you're looking at a node tree, it's very helpful to be able to see at a glance what's going on. Using subtract for inverting is easily mixed up with other nodes in which you are actually subtracting, not inverting, and looks very similar to all the other mix nodes that usually litter a comp tree.
 - has options to invert the RGB channels, the Alpha channel, or both. This saves adding lots of extra nodes (separate RGBA, subtract, set alpha) when you want to do something simple like invert an alpha channel. I'd like to add this option to other nodes too.
There's also a shader node version too.
* Also a few fixes that I committed ages ago, but seems to have been overwritten in Bob's node refactor:
 - adding new compbufs to the set alpha and alphaover nodes when you have only one noodle connected to the lower input
 - making the fac value on RGB curves still work when there's nothing connected to it
											
										 
											2007-05-31 06:55:02 +00:00
										 |  |  | #define SH_NODE_MATERIAL_EXT	118
 | 
					
						
							|  |  |  | #define SH_NODE_INVERT		119
 | 
					
						
							| 
									
										
										
										
											2007-08-20 11:05:14 +00:00
										 |  |  | #define SH_NODE_SEPRGB		120
 | 
					
						
							|  |  |  | #define SH_NODE_COMBRGB		121
 | 
					
						
							| 
									
										
										
										
											2007-08-31 07:42:06 +00:00
										 |  |  | #define SH_NODE_HUE_SAT		122
 | 
					
						
							| 
									
										
										
										
											2008-02-09 23:17:15 +00:00
										 |  |  | #define NODE_DYNAMIC		123
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-08 11:38:16 +00:00
										 |  |  | #define SH_NODE_OUTPUT_MATERIAL			124
 | 
					
						
							|  |  |  | #define SH_NODE_OUTPUT_WORLD			125
 | 
					
						
							|  |  |  | #define SH_NODE_OUTPUT_LAMP				126
 | 
					
						
							|  |  |  | #define SH_NODE_FRESNEL					127
 | 
					
						
							|  |  |  | #define SH_NODE_MIX_SHADER				128
 | 
					
						
							|  |  |  | #define SH_NODE_ATTRIBUTE				129
 | 
					
						
							|  |  |  | #define SH_NODE_BACKGROUND				130
 | 
					
						
							|  |  |  | #define SH_NODE_BSDF_ANISOTROPIC		131
 | 
					
						
							|  |  |  | #define SH_NODE_BSDF_DIFFUSE			132
 | 
					
						
							|  |  |  | #define SH_NODE_BSDF_GLOSSY				133
 | 
					
						
							|  |  |  | #define SH_NODE_BSDF_GLASS				134
 | 
					
						
							|  |  |  | #define SH_NODE_BSDF_TRANSLUCENT		137
 | 
					
						
							|  |  |  | #define SH_NODE_BSDF_TRANSPARENT		138
 | 
					
						
							|  |  |  | #define SH_NODE_BSDF_VELVET				139
 | 
					
						
							|  |  |  | #define SH_NODE_EMISSION				140
 | 
					
						
							|  |  |  | #define SH_NODE_NEW_GEOMETRY			141
 | 
					
						
							|  |  |  | #define SH_NODE_LIGHT_PATH				142
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_IMAGE				143
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_SKY					145
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_GRADIENT			146
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_VORONOI				147
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_MAGIC				148
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_WAVE				149
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_NOISE				150
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_MUSGRAVE			152
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_COORD				155
 | 
					
						
							|  |  |  | #define SH_NODE_ADD_SHADER				156
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_ENVIRONMENT			157
 | 
					
						
							|  |  |  | #define SH_NODE_OUTPUT_TEXTURE			158
 | 
					
						
							|  |  |  | #define SH_NODE_HOLDOUT					159
 | 
					
						
							|  |  |  | #define SH_NODE_LAYER_WEIGHT			160
 | 
					
						
							| 
									
										
										
										
											2013-12-28 01:54:44 +01:00
										 |  |  | #define SH_NODE_VOLUME_ABSORPTION		161
 | 
					
						
							|  |  |  | #define SH_NODE_VOLUME_SCATTER			162
 | 
					
						
							| 
									
										
										
										
											2012-05-07 20:24:38 +00:00
										 |  |  | #define SH_NODE_GAMMA					163
 | 
					
						
							|  |  |  | #define SH_NODE_TEX_CHECKER				164
 | 
					
						
							| 
									
										
										
										
											2012-01-24 16:32:31 +00:00
										 |  |  | #define SH_NODE_BRIGHTCONTRAST			165
 | 
					
						
							| 
									
										
										
										
											2012-05-07 20:24:38 +00:00
										 |  |  | #define SH_NODE_LIGHT_FALLOFF			166
 | 
					
						
							| 
									
										
										
										
											2012-05-21 12:52:28 +00:00
										 |  |  | #define SH_NODE_OBJECT_INFO				167
 | 
					
						
							| 
									
										
										
										
											2014-06-13 21:44:48 +02:00
										 |  |  | #define SH_NODE_PARTICLE_INFO			168
 | 
					
						
							| 
									
										
										
										
											2012-09-04 13:29:07 +00:00
										 |  |  | #define SH_NODE_TEX_BRICK				169
 | 
					
						
							| 
									
										
										
										
											2012-10-10 15:56:43 +00:00
										 |  |  | #define SH_NODE_BUMP					170
 | 
					
						
							| 
									
										
										
										
											2012-11-03 14:32:26 +00:00
										 |  |  | #define SH_NODE_SCRIPT					171
 | 
					
						
							| 
									
										
										
										
											2012-11-06 19:59:02 +00:00
										 |  |  | #define SH_NODE_AMBIENT_OCCLUSION		172
 | 
					
						
							|  |  |  | #define SH_NODE_BSDF_REFRACTION			173
 | 
					
						
							|  |  |  | #define SH_NODE_TANGENT					174
 | 
					
						
							|  |  |  | #define SH_NODE_NORMAL_MAP				175
 | 
					
						
							| 
									
										
										
										
											2012-12-28 14:21:30 +00:00
										 |  |  | #define SH_NODE_HAIR_INFO				176
 | 
					
						
							| 
									
										
										
										
											2013-04-01 20:26:52 +00:00
										 |  |  | #define SH_NODE_SUBSURFACE_SCATTERING	177
 | 
					
						
							| 
									
										
										
										
											2013-05-20 15:58:37 +00:00
										 |  |  | #define SH_NODE_WIREFRAME				178
 | 
					
						
							| 
									
										
										
										
											2013-05-23 17:45:20 +00:00
										 |  |  | #define SH_NODE_BSDF_TOON				179
 | 
					
						
							| 
									
										
										
										
											2013-06-09 20:46:22 +00:00
										 |  |  | #define SH_NODE_WAVELENGTH				180
 | 
					
						
							| 
									
										
										
										
											2013-06-13 08:55:51 +00:00
										 |  |  | #define SH_NODE_BLACKBODY				181
 | 
					
						
							| 
									
										
										
										
											2013-06-20 08:20:30 +00:00
										 |  |  | #define SH_NODE_VECT_TRANSFORM			182
 | 
					
						
							| 
									
										
										
										
											2013-07-03 23:46:56 +00:00
										 |  |  | #define SH_NODE_SEPHSV					183
 | 
					
						
							|  |  |  | #define SH_NODE_COMBHSV					184
 | 
					
						
							| 
									
										
										
										
											2013-09-15 23:58:00 +00:00
										 |  |  | #define SH_NODE_BSDF_HAIR				185
 | 
					
						
							| 
									
										
										
										
											2013-11-25 20:58:23 +09:00
										 |  |  | #define SH_NODE_LAMP					186
 | 
					
						
							| 
									
										
										
										
											2014-06-13 21:44:48 +02:00
										 |  |  | #define SH_NODE_UVMAP					187
 | 
					
						
							|  |  |  | #define SH_NODE_SEPXYZ					188
 | 
					
						
							|  |  |  | #define SH_NODE_COMBXYZ					189
 | 
					
						
							| 
									
										
										
										
											2014-07-14 16:20:40 +09:00
										 |  |  | #define SH_NODE_OUTPUT_LINESTYLE		190
 | 
					
						
							| 
									
										
										
										
											2014-07-20 12:14:31 +09:00
										 |  |  | #define SH_NODE_UVALONGSTROKE			191
 | 
					
						
							| 
									
										
										
										
											2011-11-08 11:38:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-25 23:54:39 +00:00
										 |  |  | /* custom defines options for Material node */ | 
					
						
							|  |  |  | #define SH_NODE_MAT_DIFF   1
 | 
					
						
							|  |  |  | #define SH_NODE_MAT_SPEC   2
 | 
					
						
							|  |  |  | #define SH_NODE_MAT_NEG    4
 | 
					
						
							| 
									
										
										
										
											2008-02-09 23:17:15 +00:00
										 |  |  | /* custom defines: states for Script node. These are bit indices */ | 
					
						
							|  |  |  | #define NODE_DYNAMIC_READY	0 /* 1 */
 | 
					
						
							|  |  |  | #define NODE_DYNAMIC_LOADED	1 /* 2 */
 | 
					
						
							|  |  |  | #define NODE_DYNAMIC_NEW	2 /* 4 */
 | 
					
						
							|  |  |  | #define NODE_DYNAMIC_UPDATED	3 /* 8 */
 | 
					
						
							|  |  |  | #define NODE_DYNAMIC_ADDEXIST	4 /* 16 */
 | 
					
						
							|  |  |  | #define NODE_DYNAMIC_ERROR	5 /* 32 */
 | 
					
						
							|  |  |  | #define NODE_DYNAMIC_REPARSE	6 /* 64 */
 | 
					
						
							|  |  |  | #define NODE_DYNAMIC_SET	15 /* sign */
 | 
					
						
							| 
									
										
											  
											
												Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.
- A click on any node will show its options in the Node Panel in the
  Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
											
										 
											2005-12-28 15:42:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* API */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNodeTreeExec *ntreeShaderBeginExecTree(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void            ntreeShaderEndExecTree(struct bNodeTreeExec *exec); | 
					
						
							| 
									
										
										
										
											2013-01-24 21:57:13 +00:00
										 |  |  | bool            ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            ntreeShaderGetTexcoMode(struct bNodeTree *ntree, int osa, short *texco, int *mode); | 
					
						
							| 
									
										
										
										
											2005-12-18 23:08:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | /* switch material render loop */ | 
					
						
							| 
									
										
										
										
											2007-03-28 13:07:59 +00:00
										 |  |  | extern void (*node_shader_lamp_loop)(struct ShadeInput *, struct ShadeResult *); | 
					
						
							| 
									
										
										
										
											2012-07-31 23:06:12 +00:00
										 |  |  | void            set_node_shader_lamp_loop(void (*lamp_loop_func)(struct ShadeInput *, struct ShadeResult *)); | 
					
						
							| 
									
										
										
										
											2005-12-18 13:46:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-14 15:11:19 +01:00
										 |  |  | void            ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat, short compatibility); | 
					
						
							| 
									
										
											  
											
												
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
  menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
  gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
  storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
  An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
  needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
  be at the origin.
											
										 
											2008-09-04 20:51:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Composite Nodes
 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
											  
											
												Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
  all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
  default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
  tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
  easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
  code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
  (pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
  rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
  with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
  done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
  window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
  system should be built from scratch. I can't really understand this code...
  I expect it is not much needed, especially with advanced layer/passes
  control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
  recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
  effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
  to check first the option to render to a Image window, so Blender can become
  a true single-window application. :)
  For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
											
										 
											2006-01-23 22:05:47 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | /* output socket defines */ | 
					
						
							| 
									
										
										
										
											2013-08-03 13:12:09 +00:00
										 |  |  | #define RRES_OUT_IMAGE					0
 | 
					
						
							|  |  |  | #define RRES_OUT_ALPHA					1
 | 
					
						
							|  |  |  | #define RRES_OUT_Z						2
 | 
					
						
							|  |  |  | #define RRES_OUT_NORMAL					3
 | 
					
						
							|  |  |  | #define RRES_OUT_UV						4
 | 
					
						
							|  |  |  | #define RRES_OUT_VEC					5
 | 
					
						
							|  |  |  | #define RRES_OUT_RGBA					6
 | 
					
						
							|  |  |  | #define RRES_OUT_DIFF					7
 | 
					
						
							|  |  |  | #define RRES_OUT_SPEC					8
 | 
					
						
							|  |  |  | #define RRES_OUT_SHADOW					9
 | 
					
						
							|  |  |  | #define RRES_OUT_AO						10
 | 
					
						
							|  |  |  | #define RRES_OUT_REFLECT				11
 | 
					
						
							|  |  |  | #define RRES_OUT_REFRACT				12
 | 
					
						
							|  |  |  | #define RRES_OUT_INDIRECT				13
 | 
					
						
							|  |  |  | #define RRES_OUT_INDEXOB				14
 | 
					
						
							|  |  |  | #define RRES_OUT_INDEXMA				15
 | 
					
						
							|  |  |  | #define RRES_OUT_MIST					16
 | 
					
						
							|  |  |  | #define RRES_OUT_EMIT					17
 | 
					
						
							|  |  |  | #define RRES_OUT_ENV					18
 | 
					
						
							|  |  |  | #define RRES_OUT_DIFF_DIRECT			19
 | 
					
						
							|  |  |  | #define RRES_OUT_DIFF_INDIRECT			20
 | 
					
						
							|  |  |  | #define RRES_OUT_DIFF_COLOR				21
 | 
					
						
							|  |  |  | #define RRES_OUT_GLOSSY_DIRECT			22
 | 
					
						
							|  |  |  | #define RRES_OUT_GLOSSY_INDIRECT		23
 | 
					
						
							|  |  |  | #define RRES_OUT_GLOSSY_COLOR			24
 | 
					
						
							|  |  |  | #define RRES_OUT_TRANSM_DIRECT			25
 | 
					
						
							|  |  |  | #define RRES_OUT_TRANSM_INDIRECT		26
 | 
					
						
							|  |  |  | #define RRES_OUT_TRANSM_COLOR			27
 | 
					
						
							|  |  |  | #define RRES_OUT_SUBSURFACE_DIRECT		28
 | 
					
						
							|  |  |  | #define RRES_OUT_SUBSURFACE_INDIRECT	29
 | 
					
						
							|  |  |  | #define RRES_OUT_SUBSURFACE_COLOR		30
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
  all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
  default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
  tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
  easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
  code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
  (pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
  rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
  with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
  done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
  window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
  system should be built from scratch. I can't really understand this code...
  I expect it is not much needed, especially with advanced layer/passes
  control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
  recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
  effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
  to check first the option to render to a Image window, so Blender can become
  a true single-window application. :)
  For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
											
										 
											2006-01-23 22:05:47 +00:00
										 |  |  | /* note: types are needed to restore callbacks, don't change values */ | 
					
						
							| 
									
										
										
										
											2006-01-24 21:50:23 +00:00
										 |  |  | #define CMP_NODE_VIEWER		201
 | 
					
						
							| 
									
										
											  
											
												Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
  all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
  default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
  tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
  easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
  code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
  (pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
  rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
  with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
  done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
  window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
  system should be built from scratch. I can't really understand this code...
  I expect it is not much needed, especially with advanced layer/passes
  control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
  recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
  effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
  to check first the option to render to a Image window, so Blender can become
  a true single-window application. :)
  For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
											
										 
											2006-01-23 22:05:47 +00:00
										 |  |  | #define CMP_NODE_RGB		202
 | 
					
						
							|  |  |  | #define CMP_NODE_VALUE		203
 | 
					
						
							|  |  |  | #define CMP_NODE_MIX_RGB	204
 | 
					
						
							|  |  |  | #define CMP_NODE_VALTORGB	205
 | 
					
						
							|  |  |  | #define CMP_NODE_RGBTOBW	206
 | 
					
						
							|  |  |  | #define CMP_NODE_NORMAL		207
 | 
					
						
							|  |  |  | #define CMP_NODE_CURVE_VEC	208
 | 
					
						
							|  |  |  | #define CMP_NODE_CURVE_RGB	209
 | 
					
						
							|  |  |  | #define CMP_NODE_ALPHAOVER	210
 | 
					
						
							|  |  |  | #define CMP_NODE_BLUR		211
 | 
					
						
							|  |  |  | #define CMP_NODE_FILTER		212
 | 
					
						
							| 
									
										
											  
											
												Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
  front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
											
										 
											2006-01-26 22:18:46 +00:00
										 |  |  | #define CMP_NODE_MAP_VALUE	213
 | 
					
						
							|  |  |  | #define CMP_NODE_TIME		214
 | 
					
						
							| 
									
										
										
										
											2006-01-31 21:49:05 +00:00
										 |  |  | #define CMP_NODE_VECBLUR	215
 | 
					
						
							| 
									
										
										
										
											2006-02-17 13:51:55 +00:00
										 |  |  | #define CMP_NODE_SEPRGBA	216
 | 
					
						
							|  |  |  | #define CMP_NODE_SEPHSVA	217
 | 
					
						
							|  |  |  | #define CMP_NODE_SETALPHA	218
 | 
					
						
							| 
									
										
											  
											
												Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
  later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
  to re-use these temp files on starting Blender or loading files, showing
  the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
											
										 
											2006-02-18 13:28:44 +00:00
										 |  |  | #define CMP_NODE_HUE_SAT	219
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | #define CMP_NODE_IMAGE		220
 | 
					
						
							|  |  |  | #define CMP_NODE_R_LAYERS	221
 | 
					
						
							|  |  |  | #define CMP_NODE_COMPOSITE	222
 | 
					
						
							| 
									
										
										
										
											2006-01-24 21:50:23 +00:00
										 |  |  | #define CMP_NODE_OUTPUT_FILE	223
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | #define CMP_NODE_TEXTURE	224
 | 
					
						
							|  |  |  | #define CMP_NODE_TRANSLATE	225
 | 
					
						
							|  |  |  | #define CMP_NODE_ZCOMBINE	226
 | 
					
						
							|  |  |  | #define CMP_NODE_COMBRGBA	227
 | 
					
						
							| 
									
										
										
										
											2006-07-31 02:24:35 +00:00
										 |  |  | #define CMP_NODE_DILATEERODE	228
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | #define CMP_NODE_ROTATE		229
 | 
					
						
							|  |  |  | #define CMP_NODE_SCALE		230
 | 
					
						
							|  |  |  | #define CMP_NODE_SEPYCCA	231
 | 
					
						
							|  |  |  | #define CMP_NODE_COMBYCCA	232
 | 
					
						
							|  |  |  | #define CMP_NODE_SEPYUVA	233
 | 
					
						
							|  |  |  | #define CMP_NODE_COMBYUVA	234
 | 
					
						
							|  |  |  | #define CMP_NODE_DIFF_MATTE	235
 | 
					
						
							| 
									
										
										
										
											2006-11-15 14:41:04 +00:00
										 |  |  | #define CMP_NODE_COLOR_SPILL	236
 | 
					
						
							| 
									
										
										
										
											2009-09-10 04:12:22 +00:00
										 |  |  | #define CMP_NODE_CHROMA_MATTE	237
 | 
					
						
							| 
									
										
										
										
											2007-01-09 04:32:39 +00:00
										 |  |  | #define CMP_NODE_CHANNEL_MATTE	238
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | #define CMP_NODE_FLIP		239
 | 
					
						
							| 
									
										
										
										
											2006-11-16 21:50:35 +00:00
										 |  |  | #define CMP_NODE_SPLITVIEWER	240
 | 
					
						
							| 
									
										
										
										
											2007-03-24 18:41:54 +00:00
										 |  |  | #define CMP_NODE_INDEX_MASK	241
 | 
					
						
							|  |  |  | #define CMP_NODE_MAP_UV		242
 | 
					
						
							|  |  |  | #define CMP_NODE_ID_MASK	243
 | 
					
						
							|  |  |  | #define CMP_NODE_DEFOCUS	244
 | 
					
						
							|  |  |  | #define CMP_NODE_DISPLACE	245
 | 
					
						
							|  |  |  | #define CMP_NODE_COMBHSVA	246
 | 
					
						
							|  |  |  | #define CMP_NODE_MATH		247
 | 
					
						
							|  |  |  | #define CMP_NODE_LUMA_MATTE	248
 | 
					
						
							| 
									
										
										
										
											2007-04-13 03:23:39 +00:00
										 |  |  | #define CMP_NODE_BRIGHTCONTRAST 249
 | 
					
						
							| 
									
										
										
										
											2007-04-13 04:22:32 +00:00
										 |  |  | #define CMP_NODE_GAMMA		250
 | 
					
						
							| 
									
										
											  
											
												== Shader nodes ==
* Geometry node: Front/back output
This is used as a mask for determining whether you're looking at the front side or back side of a mesh, useful for blending materials, my practical need was giving different materials to the pages of a magazine: http://mke3.net/blender/etc/frontback-h264.mov
Give 1.0 if it's the front side, and 0.0 if it's the back side.
* Extended material node
This is the same as the material node, but gives more available inputs and outputs, (basically just connecting up more of ShadeInput and ShadeResult to the node). I didn't want to add it to the normal simple Material node since you don't always need all that stuff, and it would make the node huge, but when you do need it, it's nice to have it.
== Comp nodes ==
* Invert node
Inverting is something that happens all the time in a node setup, and this makes it easier. It's been possible to invert previously by adding a mix node and subtracting the input from 1.0, but it's not the best way of doing it. This node:
 - makes it a lot faster to set up, rather than all the clicking required with the mix node
 - is a lot more usable amidst a complex comp setup, when you're looking at a node tree, it's very helpful to be able to see at a glance what's going on. Using subtract for inverting is easily mixed up with other nodes in which you are actually subtracting, not inverting, and looks very similar to all the other mix nodes that usually litter a comp tree.
 - has options to invert the RGB channels, the Alpha channel, or both. This saves adding lots of extra nodes (separate RGBA, subtract, set alpha) when you want to do something simple like invert an alpha channel. I'd like to add this option to other nodes too.
There's also a shader node version too.
* Also a few fixes that I committed ages ago, but seems to have been overwritten in Bob's node refactor:
 - adding new compbufs to the set alpha and alphaover nodes when you have only one noodle connected to the lower input
 - making the fac value on RGB curves still work when there's nothing connected to it
											
										 
											2007-05-31 06:55:02 +00:00
										 |  |  | #define CMP_NODE_INVERT		251
 | 
					
						
							| 
									
										
										
										
											2007-07-10 02:27:37 +00:00
										 |  |  | #define CMP_NODE_NORMALIZE      252
 | 
					
						
							| 
									
										
										
										
											2007-10-29 14:37:19 +00:00
										 |  |  | #define CMP_NODE_CROP		253
 | 
					
						
							| 
									
										
										
										
											2007-12-27 14:19:11 +00:00
										 |  |  | #define CMP_NODE_DBLUR		254
 | 
					
						
							| 
									
										
										
										
											2007-12-27 20:36:17 +00:00
										 |  |  | #define CMP_NODE_BILATERALBLUR  255
 | 
					
						
							| 
									
										
										
										
											2008-03-11 14:40:27 +00:00
										 |  |  | #define CMP_NODE_PREMULKEY  256
 | 
					
						
							| 
									
										
										
										
											2009-09-10 04:12:22 +00:00
										 |  |  | #define CMP_NODE_DIST_MATTE	257
 | 
					
						
							|  |  |  | #define CMP_NODE_VIEW_LEVELS    258
 | 
					
						
							|  |  |  | #define CMP_NODE_COLOR_MATTE 259
 | 
					
						
							| 
									
										
										
										
											2010-01-20 04:19:55 +00:00
										 |  |  | #define CMP_NODE_COLORBALANCE 260
 | 
					
						
							| 
									
										
										
										
											2010-01-21 00:00:45 +00:00
										 |  |  | #define CMP_NODE_HUECORRECT 261
 | 
					
						
							| 
									
										
										
										
											2011-11-07 12:56:05 +00:00
										 |  |  | #define CMP_NODE_MOVIECLIP	262
 | 
					
						
							|  |  |  | #define CMP_NODE_STABILIZE2D	263
 | 
					
						
							|  |  |  | #define CMP_NODE_TRANSFORM	264
 | 
					
						
							|  |  |  | #define CMP_NODE_MOVIEDISTORTION	265
 | 
					
						
							| 
									
										
										
										
											2012-01-10 19:08:08 +00:00
										 |  |  | #define CMP_NODE_DOUBLEEDGEMASK    266
 | 
					
						
							| 
									
										
										
										
											2012-03-01 07:56:15 +00:00
										 |  |  | #define CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED	267	/* DEPRECATED multi file node has been merged into regular CMP_NODE_OUTPUT_FILE */
 | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | #define CMP_NODE_MASK		268
 | 
					
						
							| 
									
										
										
										
											2012-06-14 12:18:42 +00:00
										 |  |  | #define CMP_NODE_KEYINGSCREEN		269
 | 
					
						
							| 
									
										
										
										
											2012-06-14 12:19:13 +00:00
										 |  |  | #define CMP_NODE_KEYING			270
 | 
					
						
							| 
									
										
										
										
											2012-06-19 17:29:58 +00:00
										 |  |  | #define CMP_NODE_TRACKPOS		271
 | 
					
						
							| 
									
										
										
										
											2012-08-23 06:48:01 +00:00
										 |  |  | #define CMP_NODE_INPAINT    272
 | 
					
						
							|  |  |  | #define CMP_NODE_DESPECKLE  273
 | 
					
						
							| 
									
										
											  
											
												== Shader nodes ==
* Geometry node: Front/back output
This is used as a mask for determining whether you're looking at the front side or back side of a mesh, useful for blending materials, my practical need was giving different materials to the pages of a magazine: http://mke3.net/blender/etc/frontback-h264.mov
Give 1.0 if it's the front side, and 0.0 if it's the back side.
* Extended material node
This is the same as the material node, but gives more available inputs and outputs, (basically just connecting up more of ShadeInput and ShadeResult to the node). I didn't want to add it to the normal simple Material node since you don't always need all that stuff, and it would make the node huge, but when you do need it, it's nice to have it.
== Comp nodes ==
* Invert node
Inverting is something that happens all the time in a node setup, and this makes it easier. It's been possible to invert previously by adding a mix node and subtracting the input from 1.0, but it's not the best way of doing it. This node:
 - makes it a lot faster to set up, rather than all the clicking required with the mix node
 - is a lot more usable amidst a complex comp setup, when you're looking at a node tree, it's very helpful to be able to see at a glance what's going on. Using subtract for inverting is easily mixed up with other nodes in which you are actually subtracting, not inverting, and looks very similar to all the other mix nodes that usually litter a comp tree.
 - has options to invert the RGB channels, the Alpha channel, or both. This saves adding lots of extra nodes (separate RGBA, subtract, set alpha) when you want to do something simple like invert an alpha channel. I'd like to add this option to other nodes too.
There's also a shader node version too.
* Also a few fixes that I committed ages ago, but seems to have been overwritten in Bob's node refactor:
 - adding new compbufs to the set alpha and alphaover nodes when you have only one noodle connected to the lower input
 - making the fac value on RGB curves still work when there's nothing connected to it
											
										 
											2007-05-31 06:55:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-26 15:32:36 +00:00
										 |  |  | #define CMP_NODE_GLARE		301
 | 
					
						
							|  |  |  | #define CMP_NODE_TONEMAP	302
 | 
					
						
							|  |  |  | #define CMP_NODE_LENSDIST	303
 | 
					
						
							| 
									
										
										
										
											2014-07-26 12:59:29 +02:00
										 |  |  | #define CMP_NODE_SUNBEAMS	304
 | 
					
						
							| 
									
										
										
										
											2007-10-26 15:32:36 +00: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
										 |  |  | #define CMP_NODE_COLORCORRECTION 312
 | 
					
						
							|  |  |  | #define CMP_NODE_MASK_BOX       313
 | 
					
						
							|  |  |  | #define CMP_NODE_MASK_ELLIPSE   314
 | 
					
						
							|  |  |  | #define CMP_NODE_BOKEHIMAGE     315
 | 
					
						
							|  |  |  | #define CMP_NODE_BOKEHBLUR      316
 | 
					
						
							|  |  |  | #define CMP_NODE_SWITCH         317
 | 
					
						
							| 
									
										
										
										
											2012-10-24 08:36:10 +00:00
										 |  |  | #define CMP_NODE_PIXELATE       318
 | 
					
						
							| 
									
										
											  
											
												                        ____                           
`````|````` | |        |                        ..'''' 
     |      | |        |______               .''       
     |      | |        |                  ..'          
     |      | |_______ |___________ ....''             
               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-11-14 19:53:46 +00:00
										 |  |  | #define CMP_NODE_MAP_RANGE	319
 | 
					
						
							| 
									
										
											  
											
												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
										 |  |  | #define CMP_NODE_PLANETRACKDEFORM	320
 | 
					
						
							| 
									
										
										
										
											2014-03-11 14:07:49 +01:00
										 |  |  | #define CMP_NODE_CORNERPIN          321
 | 
					
						
							| 
									
										
										
										
											2015-04-06 10:40:12 -03:00
										 |  |  | #define CMP_NODE_SWITCH_VIEW    322
 | 
					
						
							| 
									
										
										
										
											2012-11-14 19:53:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												== Shader nodes ==
* Geometry node: Front/back output
This is used as a mask for determining whether you're looking at the front side or back side of a mesh, useful for blending materials, my practical need was giving different materials to the pages of a magazine: http://mke3.net/blender/etc/frontback-h264.mov
Give 1.0 if it's the front side, and 0.0 if it's the back side.
* Extended material node
This is the same as the material node, but gives more available inputs and outputs, (basically just connecting up more of ShadeInput and ShadeResult to the node). I didn't want to add it to the normal simple Material node since you don't always need all that stuff, and it would make the node huge, but when you do need it, it's nice to have it.
== Comp nodes ==
* Invert node
Inverting is something that happens all the time in a node setup, and this makes it easier. It's been possible to invert previously by adding a mix node and subtracting the input from 1.0, but it's not the best way of doing it. This node:
 - makes it a lot faster to set up, rather than all the clicking required with the mix node
 - is a lot more usable amidst a complex comp setup, when you're looking at a node tree, it's very helpful to be able to see at a glance what's going on. Using subtract for inverting is easily mixed up with other nodes in which you are actually subtracting, not inverting, and looks very similar to all the other mix nodes that usually litter a comp tree.
 - has options to invert the RGB channels, the Alpha channel, or both. This saves adding lots of extra nodes (separate RGBA, subtract, set alpha) when you want to do something simple like invert an alpha channel. I'd like to add this option to other nodes too.
There's also a shader node version too.
* Also a few fixes that I committed ages ago, but seems to have been overwritten in Bob's node refactor:
 - adding new compbufs to the set alpha and alphaover nodes when you have only one noodle connected to the lower input
 - making the fac value on RGB curves still work when there's nothing connected to it
											
										 
											2007-05-31 06:55:02 +00:00
										 |  |  | /* channel toggles */ | 
					
						
							|  |  |  | #define CMP_CHAN_RGB		1
 | 
					
						
							|  |  |  | #define CMP_CHAN_A			2
 | 
					
						
							|  |  |  | #define CMP_CHAN_R			4
 | 
					
						
							|  |  |  | #define CMP_CHAN_G			8
 | 
					
						
							|  |  |  | #define CMP_CHAN_B			16
 | 
					
						
							| 
									
										
										
										
											2007-04-13 03:23:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-25 23:54:39 +00:00
										 |  |  | /* filter types */ | 
					
						
							|  |  |  | #define CMP_FILT_SOFT		0
 | 
					
						
							|  |  |  | #define CMP_FILT_SHARP		1
 | 
					
						
							|  |  |  | #define CMP_FILT_LAPLACE	2
 | 
					
						
							|  |  |  | #define CMP_FILT_SOBEL		3
 | 
					
						
							|  |  |  | #define CMP_FILT_PREWITT	4
 | 
					
						
							|  |  |  | #define CMP_FILT_KIRSCH		5
 | 
					
						
							|  |  |  | #define CMP_FILT_SHADOW		6
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* scale node type, in custom1 */ | 
					
						
							| 
									
										
										
										
											2007-11-13 23:53:58 +00:00
										 |  |  | #define CMP_SCALE_RELATIVE		0
 | 
					
						
							|  |  |  | #define CMP_SCALE_ABSOLUTE		1
 | 
					
						
							|  |  |  | #define CMP_SCALE_SCENEPERCENT	2
 | 
					
						
							| 
									
										
										
										
											2010-07-08 20:58:34 +00:00
										 |  |  | #define CMP_SCALE_RENDERPERCENT 3
 | 
					
						
							| 
									
										
										
										
											2012-06-14 16:55:55 +00:00
										 |  |  | /* custom2 */ | 
					
						
							|  |  |  | #define CMP_SCALE_RENDERSIZE_FRAME_ASPECT  (1 << 0)
 | 
					
						
							|  |  |  | #define CMP_SCALE_RENDERSIZE_FRAME_CROP    (1 << 1)
 | 
					
						
							| 
									
										
										
										
											2007-03-25 23:54:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-12 12:55:44 +00:00
										 |  |  | /* track position node, in custom1 */ | 
					
						
							|  |  |  | #define CMP_TRACKPOS_ABSOLUTE			0
 | 
					
						
							|  |  |  | #define CMP_TRACKPOS_RELATIVE_START	1
 | 
					
						
							|  |  |  | #define CMP_TRACKPOS_RELATIVE_FRAME	2
 | 
					
						
							| 
									
										
										
										
											2013-06-12 14:28:36 +00:00
										 |  |  | #define CMP_TRACKPOS_ABSOLUTE_FRAME	3
 | 
					
						
							| 
									
										
											  
											
												Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
  all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
  default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
  tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
  easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
  code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
  (pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
  rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
  with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
  done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
  window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
  system should be built from scratch. I can't really understand this code...
  I expect it is not much needed, especially with advanced layer/passes
  control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
  recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
  effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
  to check first the option to render to a Image window, so Blender can become
  a true single-window application. :)
  For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
											
										 
											2006-01-23 22:05:47 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* API */ | 
					
						
							| 
									
										
										
										
											2014-02-05 13:51:51 +01:00
										 |  |  | void ntreeCompositExecTree(struct Scene *scene, struct bNodeTree *ntree, struct RenderData *rd, int rendering, int do_previews, | 
					
						
							| 
									
										
										
										
											2015-04-06 10:40:12 -03:00
										 |  |  |                            const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, | 
					
						
							|  |  |  |                            const char *view_name); | 
					
						
							| 
									
										
										
										
											2007-01-19 12:43:02 +00:00
										 |  |  | void ntreeCompositTagRender(struct Scene *sce); | 
					
						
							| 
									
										
										
										
											2007-03-13 12:20:55 +00:00
										 |  |  | int ntreeCompositTagAnimated(struct bNodeTree *ntree); | 
					
						
							| 
									
										
											  
											
												Compositing workflow upgrade;
You now can set a Preview panel in the Image window, to define a sub-rect
of an image to be processed. Works like the preview in 3D Window. Just
press SHIFT+P to get it activated. Very nice speedup!
This is how it works:
- The compositor still uses the scene image size (including % setting) for
  Viewer or Composite output size
- If a preview exists, it calculates the cropped rect from its position
  in the Image window, and stores that in the Scene render data
- On composite execute, it copies only this part from the 'generator nodes',
  right now Images or Render Results. That makes the entire composite tree
  only using small rects, so it will execute fast.
- Also the render window will only display the cropped rect, and on F12
  only the cropped part is being executed
- On rendering in background mode, the cropping is ignored though.
Usability notes:
- translating or zooming view will automatically invoke a recalculation
- if you zoom in on details, the calculated rect will even become smaller
- only one Imagewindow can have this Preview Panel, to prevent conflicts of
  what the cropped area should be. Compositing is on Scene level, not local
  per image window. (Note; 3D Previews are local per window!)
- Closing the preview panel will invoke a full-size recalculation
- All passes/layers from rendering are nicely cropped, including Z and
  vectors.
The work to make the compositor do cropping was simple, but getting the
Image window displaying correctly and get all events OK was a lot of work...
indeed, we need to refactor Image Window usage once. Sorry for making the
mess even bigger now. :) I've tried not to interfere with UV edit or Paint
though... only when you're in compositing mode the panel will work.
BUG fix:
3D Preview render didn't work when multiple layers were set in the current
scene.
											
										 
											2006-02-09 11:07:04 +00:00
										 |  |  | void ntreeCompositTagGenerators(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2013-06-12 11:26:44 +00:00
										 |  |  | void ntreeCompositForceHidden(struct bNodeTree *ntree); | 
					
						
							| 
									
										
										
										
											2011-10-19 17:08:35 +00:00
										 |  |  | void ntreeCompositClearTags(struct bNodeTree *ntree); | 
					
						
							| 
									
										
											  
											
												Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
  all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
  default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
  tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
  easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
  code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
  (pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
  rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
  with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
  done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
  window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
  system should be built from scratch. I can't really understand this code...
  I expect it is not much needed, especially with advanced layer/passes
  control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
  recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
  effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
  to check first the option to render to a Image window, so Blender can become
  a true single-window application. :)
  For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
											
										 
											2006-01-23 22:05:47 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-01 07:56:15 +00:00
										 |  |  | struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree, struct bNode *node, | 
					
						
							|  |  |  |                                                      const char *name, struct ImageFormatData *im_format); | 
					
						
							|  |  |  | int ntreeCompositOutputFileRemoveActiveSocket(struct bNodeTree *ntree, struct bNode *node); | 
					
						
							| 
									
										
										
										
											2012-05-11 08:06:01 +00:00
										 |  |  | void ntreeCompositOutputFileSetPath(struct bNode *node, struct bNodeSocket *sock, const char *name); | 
					
						
							|  |  |  | void ntreeCompositOutputFileSetLayer(struct bNode *node, struct bNodeSocket *sock, const char *name); | 
					
						
							|  |  |  | /* needed in do_versions */ | 
					
						
							|  |  |  | void ntreeCompositOutputFileUniquePath(struct ListBase *list, struct bNodeSocket *sock, const char defname[], char delim); | 
					
						
							|  |  |  | void ntreeCompositOutputFileUniqueLayer(struct ListBase *list, struct bNodeSocket *sock, const char defname[], char delim); | 
					
						
							| 
									
										
										
										
											2008-11-12 22:03:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-06 12:44:54 +00:00
										 |  |  | void ntreeCompositColorBalanceSyncFromLGG(bNodeTree *ntree, bNode *node); | 
					
						
							|  |  |  | void ntreeCompositColorBalanceSyncFromCDL(bNodeTree *ntree, bNode *node); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* -------------------------------------------------------------------- */ | 
					
						
							|  |  |  | /** \name Texture Nodes
 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2008-11-12 22:03:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | struct TexResult; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-24 17:40:58 +00:00
										 |  |  | #define TEX_NODE_OUTPUT     401
 | 
					
						
							|  |  |  | #define TEX_NODE_CHECKER    402
 | 
					
						
							|  |  |  | #define TEX_NODE_TEXTURE    403
 | 
					
						
							|  |  |  | #define TEX_NODE_BRICKS     404
 | 
					
						
							|  |  |  | #define TEX_NODE_MATH       405
 | 
					
						
							|  |  |  | #define TEX_NODE_MIX_RGB    406
 | 
					
						
							|  |  |  | #define TEX_NODE_RGBTOBW    407
 | 
					
						
							|  |  |  | #define TEX_NODE_VALTORGB   408
 | 
					
						
							|  |  |  | #define TEX_NODE_IMAGE      409
 | 
					
						
							|  |  |  | #define TEX_NODE_CURVE_RGB  410
 | 
					
						
							|  |  |  | #define TEX_NODE_INVERT     411
 | 
					
						
							|  |  |  | #define TEX_NODE_HUE_SAT    412
 | 
					
						
							|  |  |  | #define TEX_NODE_CURVE_TIME 413
 | 
					
						
							|  |  |  | #define TEX_NODE_ROTATE     414
 | 
					
						
							|  |  |  | #define TEX_NODE_VIEWER     415
 | 
					
						
							|  |  |  | #define TEX_NODE_TRANSLATE  416
 | 
					
						
							|  |  |  | #define TEX_NODE_COORD      417
 | 
					
						
							|  |  |  | #define TEX_NODE_DISTANCE   418
 | 
					
						
							|  |  |  | #define TEX_NODE_COMPOSE    419
 | 
					
						
							|  |  |  | #define TEX_NODE_DECOMPOSE  420
 | 
					
						
							|  |  |  | #define TEX_NODE_VALTONOR   421
 | 
					
						
							|  |  |  | #define TEX_NODE_SCALE      422
 | 
					
						
							| 
									
										
										
										
											2009-06-13 14:22:40 +00:00
										 |  |  | #define TEX_NODE_AT         423
 | 
					
						
							| 
									
										
										
										
											2008-11-12 22:03:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-13 14:22:40 +00:00
										 |  |  | /* 501-599 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */ | 
					
						
							| 
									
										
										
										
											2009-03-24 17:40:58 +00:00
										 |  |  | #define TEX_NODE_PROC      500
 | 
					
						
							|  |  |  | #define TEX_NODE_PROC_MAX  600
 | 
					
						
							| 
									
										
										
										
											2008-11-12 22:03:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* API */ | 
					
						
							|  |  |  | int  ntreeTexTagAnimated(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void ntreeTexCheckCyclics(struct bNodeTree *ntree); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-18 16:34:57 +00:00
										 |  |  | struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree); | 
					
						
							|  |  |  | void ntreeTexEndExecTree(struct bNodeTreeExec *exec); | 
					
						
							| 
									
										
										
										
											2012-10-15 23:11:59 +00:00
										 |  |  | int ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, | 
					
						
							|  |  |  |                      float coord[3], float dxt[3], float dyt[3], int osatex, const short thread, | 
					
						
							|  |  |  |                      struct Tex *tex, short which_output, int cfra, int preview, struct ShadeInput *shi, struct MTex *mtex); | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | /** \} */ | 
					
						
							| 
									
										
										
										
											2008-11-12 22:03:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-26 15:07:38 +00:00
										 |  |  | void init_nodesystem(void); | 
					
						
							|  |  |  | void free_nodesystem(void); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-14 07:27:09 +11:00
										 |  |  | #endif  /* __BKE_NODE_H__ */
 |