2005-12-18 13:46:01 +00:00
/**
*
* $ Id :
*
* * * * * * 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
* of the License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*
* The Original Code is Copyright ( C ) 2005 Blender Foundation .
* All rights reserved .
*
* The Original Code is : all of this file .
*
2008-01-07 19:38:01 +00:00
* Contributor ( s ) : David Millan Escriva , Juho Vepsäläinen
2005-12-18 13:46:01 +00:00
*
* * * * * * END GPL LICENSE BLOCK * * * * *
*/
# include <stdlib.h>
# include <string.h>
# include <stdio.h>
# include "DNA_ID.h"
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
# include "DNA_material_types.h"
# include "DNA_node_types.h"
# include "DNA_object_types.h"
2005-12-18 13:46:01 +00:00
# include "DNA_screen_types.h"
# include "DNA_scene_types.h"
# include "DNA_space_types.h"
# include "DNA_view2d_types.h"
# include "DNA_userdef_types.h"
# include "BIF_gl.h"
# include "BIF_interface.h"
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
# include "BIF_previewrender.h"
2005-12-18 13:46:01 +00:00
# include "BIF_resources.h"
# include "BIF_screen.h"
# include "BIF_space.h"
# include "BIF_toolbox.h"
# include "BIF_butspace.h"
# include "BKE_global.h"
# include "BKE_main.h"
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
# include "BKE_material.h"
2006-06-16 04:32:39 +00:00
# include "BKE_node.h"
2005-12-18 13:46:01 +00:00
2006-06-16 04:32:39 +00:00
# include "BSE_drawipo.h"
2005-12-18 13:46:01 +00:00
# include "BSE_headerbuttons.h"
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
# include "BSE_node.h"
2005-12-18 13:46:01 +00:00
# include "blendef.h"
# include "butspace.h"
# include "mydevice.h"
void do_node_buttons ( ScrArea * sa , unsigned short event )
{
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
SpaceNode * snode = sa - > spacedata . first ;
Material * ma ;
2005-12-18 13:46:01 +00:00
switch ( event ) {
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
case B_NODE_USEMAT :
ma = ( Material * ) snode - > id ;
if ( ma ) {
if ( ma - > use_nodes & & ma - > nodetree = = NULL ) {
node_shader_default ( ma ) ;
snode_set_context ( snode ) ;
}
BIF_preview_changed ( ID_MA ) ;
allqueue ( REDRAWNODE , 0 ) ;
allqueue ( REDRAWBUTSSHADING , 0 ) ;
2006-06-26 11:01:09 +00:00
allqueue ( REDRAWIPO , 0 ) ;
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
}
break ;
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
case B_NODE_USESCENE :
2006-01-28 15:21:04 +00:00
if ( G . scene - > use_nodes ) {
if ( G . scene - > nodetree = = NULL )
node_composit_default ( G . scene ) ;
addqueue ( curarea - > win , UI_BUT_EVENT , B_NODE_TREE_EXEC ) ;
}
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
snode_set_context ( snode ) ;
allqueue ( REDRAWNODE , 0 ) ;
break ;
2005-12-18 13:46:01 +00:00
}
}
2006-06-16 04:32:39 +00:00
static void do_node_viewmenu ( void * arg , int event )
{
SpaceNode * snode = curarea - > spacedata . first ;
switch ( event ) {
case 1 : /* Zoom in */
snode_zoom_in ( curarea ) ;
break ;
case 2 : /* View all */
snode_zoom_out ( curarea ) ;
break ;
case 3 : /* View all */
snode_home ( curarea , snode ) ;
break ;
2008-07-22 09:53:25 +00:00
case 4 : /* Grease Pencil */
add_blockhandler ( curarea , NODES_HANDLER_GREASEPENCIL , UI_PNL_UNSTOW ) ;
break ;
2006-06-16 04:32:39 +00:00
}
allqueue ( REDRAWNODE , 0 ) ;
}
static uiBlock * node_viewmenu ( void * arg_unused )
{
2008-07-22 09:53:25 +00:00
SpaceNode * snode = curarea - > spacedata . first ;
2006-06-16 04:32:39 +00:00
uiBlock * block ;
short yco = 0 , menuwidth = 120 ;
block = uiNewBlock ( & curarea - > uiblocks , " node_viewmenu " ,
UI_EMBOSSP , UI_HELV , curarea - > headwin ) ;
uiBlockSetButmFunc ( block , do_node_viewmenu , NULL ) ;
2008-07-22 09:53:25 +00:00
if ( snode - > nodetree ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_MENU_PANEL , " Grease Pencil... " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
}
2006-06-16 04:32:39 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Zoom In|NumPad + " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Zoom Out|NumPad - " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " View All|Home " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
if ( ! curarea - > full )
uiDefIconTextBut ( block , BUTM , B_FULL , ICON_BLANK1 , " Maximize Window|Ctrl UpArrow " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 0 , 4 , " " ) ;
else
uiDefIconTextBut ( block , BUTM , B_FULL , ICON_BLANK1 , " Tile Window|Ctrl DownArrow " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 0 , 4 , " " ) ;
if ( curarea - > headertype = = HEADERTOP ) {
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
uiTextBoundsBlock ( block , 50 ) ;
return block ;
}
static void do_node_selectmenu ( void * arg , int event )
{
SpaceNode * snode = curarea - > spacedata . first ;
2006-07-21 11:52:41 +00:00
/* functions in editnode.c assume there's a tree */
if ( snode - > nodetree = = NULL )
return ;
2006-06-16 04:32:39 +00:00
switch ( event ) {
case 1 : /* border select */
node_border_select ( snode ) ;
break ;
case 2 : /* select/deselect all */
node_deselectall ( snode , 1 ) ;
break ;
2006-12-08 21:20:36 +00:00
case 3 : /* select linked in */
node_select_linked ( snode , 0 ) ;
break ;
case 4 : /* select linked out */
node_select_linked ( snode , 1 ) ;
break ;
2006-06-16 04:32:39 +00:00
}
allqueue ( REDRAWNODE , 0 ) ;
}
static uiBlock * node_selectmenu ( void * arg_unused )
{
uiBlock * block ;
short yco = 0 , menuwidth = 120 ;
block = uiNewBlock ( & curarea - > uiblocks , " node_selectmenu " ,
UI_EMBOSSP , UI_HELV , curarea - > headwin ) ;
uiBlockSetButmFunc ( block , do_node_selectmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Border Select|B " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Select/Deselect All|A " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
2006-12-08 21:20:36 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Select Linked From|L " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Select Linked To|Shift L " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
2006-06-16 04:32:39 +00:00
if ( curarea - > headertype = = HEADERTOP ) {
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
uiTextBoundsBlock ( block , 50 ) ;
return block ;
}
void do_node_addmenu ( void * arg , int event )
{
SpaceNode * snode = curarea - > spacedata . first ;
2006-12-05 21:33:56 +00:00
bNode * node ;
2006-06-16 04:32:39 +00:00
float locx , locy ;
short mval [ 2 ] ;
2006-12-05 21:33:56 +00:00
/* store selection in temp test flag */
for ( node = snode - > edittree - > nodes . first ; node ; node = node - > next ) {
if ( node - > flag & NODE_SELECT ) node - > flag | = NODE_TEST ;
else node - > flag & = ~ NODE_TEST ;
}
2008-02-23 10:33:36 +00:00
toolbox_mousepos ( mval , 0 ) ; /* get initial mouse position */
2006-06-16 04:32:39 +00:00
areamouseco_to_ipoco ( G . v2d , mval , & locx , & locy ) ;
2006-12-05 21:33:56 +00:00
node = node_add_node ( snode , event , locx , locy ) ;
2006-06-16 04:32:39 +00:00
2006-12-05 21:33:56 +00:00
/* uses test flag */
snode_autoconnect ( snode , node , NODE_TEST ) ;
2006-06-23 19:43:48 +00:00
addqueue ( curarea - > win , UI_BUT_EVENT , B_NODE_TREE_EXEC ) ;
2006-06-16 04:32:39 +00:00
BIF_undo_push ( " Add Node " ) ;
}
static void node_make_addmenu ( SpaceNode * snode , int nodeclass , uiBlock * block )
{
bNodeTree * ntree ;
int tot = 0 , a ;
short yco = 0 , menuwidth = 120 ;
ntree = snode - > nodetree ;
if ( ntree ) {
/* mostly taken from toolbox.c, node_add_sublevel() */
if ( ntree ) {
if ( nodeclass = = NODE_CLASS_GROUP ) {
bNodeTree * ngroup = G . main - > nodetree . first ;
for ( ; ngroup ; ngroup = ngroup - > id . next )
if ( ngroup - > type = = ntree - > type )
tot + + ;
}
else {
2007-03-26 15:07:38 +00:00
bNodeType * type = ntree - > alltypes . first ;
while ( type ) {
if ( type - > nclass = = nodeclass )
2006-06-16 04:32:39 +00:00
tot + + ;
2007-03-26 15:07:38 +00:00
type = type - > next ;
}
2006-06-16 04:32:39 +00:00
}
}
if ( tot = = 0 ) {
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
return ;
}
if ( nodeclass = = NODE_CLASS_GROUP ) {
bNodeTree * ngroup = G . main - > nodetree . first ;
for ( tot = 0 , a = 0 ; ngroup ; ngroup = ngroup - > id . next , tot + + ) {
if ( ngroup - > type = = ntree - > type ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , ( ngroup - > id . name + 2 ) , 0 ,
yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , NODE_GROUP_MENU + tot , " " ) ;
a + + ;
}
}
}
else {
2007-03-26 15:07:38 +00:00
bNodeType * type ;
2008-02-10 03:40:24 +00:00
int script = 0 ;
2007-03-26 15:07:38 +00:00
for ( a = 0 , type = ntree - > alltypes . first ; type ; type = type - > next ) {
if ( type - > nclass = = nodeclass ) {
2008-02-10 03:40:24 +00:00
if ( type - > type = = NODE_DYNAMIC ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , type - > name , 0 ,
yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , NODE_DYNAMIC_MENU + script , " " ) ;
script + + ;
} else {
2007-03-26 15:07:38 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , type - > name , 0 ,
yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , type - > type , " " ) ;
2008-02-10 03:40:24 +00:00
}
2006-06-16 04:32:39 +00:00
a + + ;
}
}
}
} else {
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
return ;
}
}
static uiBlock * node_add_inputmenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
block = uiNewBlock ( & curarea - > uiblocks , " node_add_inputmenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
node_make_addmenu ( snode , NODE_CLASS_INPUT , block ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static uiBlock * node_add_outputmenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
block = uiNewBlock ( & curarea - > uiblocks , " node_add_outputmenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
node_make_addmenu ( snode , NODE_CLASS_OUTPUT , block ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static uiBlock * node_add_colormenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
block = uiNewBlock ( & curarea - > uiblocks , " node_add_colormenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
node_make_addmenu ( snode , NODE_CLASS_OP_COLOR , block ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static uiBlock * node_add_vectormenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
block = uiNewBlock ( & curarea - > uiblocks , " node_add_vectormenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
node_make_addmenu ( snode , NODE_CLASS_OP_VECTOR , block ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static uiBlock * node_add_filtermenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
block = uiNewBlock ( & curarea - > uiblocks , " node_add_filtermenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
node_make_addmenu ( snode , NODE_CLASS_OP_FILTER , block ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static uiBlock * node_add_convertermenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
block = uiNewBlock ( & curarea - > uiblocks , " node_add_convertermenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
node_make_addmenu ( snode , NODE_CLASS_CONVERTOR , block ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
2006-12-31 00:28:46 +00:00
static uiBlock * node_add_mattemenu ( void * arg_unused )
2006-06-16 04:32:39 +00:00
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
2006-12-31 00:28:46 +00:00
block = uiNewBlock ( & curarea - > uiblocks , " node_add_mattemenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
2006-06-16 04:32:39 +00:00
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
2006-12-31 00:28:46 +00:00
node_make_addmenu ( snode , NODE_CLASS_MATTE , block ) ;
2006-06-16 04:32:39 +00:00
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
2006-12-31 00:28:46 +00:00
static uiBlock * node_add_distortmenu ( void * arg_unused )
2006-11-16 11:55:05 +00:00
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
2006-12-31 00:28:46 +00:00
block = uiNewBlock ( & curarea - > uiblocks , " node_add_distortmenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
2006-11-16 11:55:05 +00:00
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
2006-12-31 00:28:46 +00:00
node_make_addmenu ( snode , NODE_CLASS_DISTORT , block ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static uiBlock * node_add_groupmenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
block = uiNewBlock ( & curarea - > uiblocks , " node_add_groupmenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
node_make_addmenu ( snode , NODE_CLASS_GROUP , block ) ;
2006-11-16 11:55:05 +00:00
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
2008-02-10 03:40:24 +00:00
static uiBlock * node_add_dynamicmenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
block = uiNewBlock ( & curarea - > uiblocks , " node_add_dynamicmenu " , UI_EMBOSSP , UI_HELV , G . curscreen - > mainwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
node_make_addmenu ( snode , NODE_CLASS_OP_DYNAMIC , block ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
2006-06-16 04:32:39 +00:00
static uiBlock * node_addmenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
short yco = 0 , menuwidth = 120 ;
block = uiNewBlock ( & curarea - > uiblocks , " node_addmenu " ,
UI_EMBOSSP , UI_HELV , curarea - > headwin ) ;
uiBlockSetButmFunc ( block , do_node_addmenu , NULL ) ;
if ( snode - > treetype = = NTREE_SHADER ) {
uiDefIconTextBlockBut ( block , node_add_inputmenu , NULL , ICON_RIGHTARROW_THIN , " Input " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_outputmenu , NULL , ICON_RIGHTARROW_THIN , " Output " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_colormenu , NULL , ICON_RIGHTARROW_THIN , " Color " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_vectormenu , NULL , ICON_RIGHTARROW_THIN , " Vector " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_convertermenu , NULL , ICON_RIGHTARROW_THIN , " Convertor " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_groupmenu , NULL , ICON_RIGHTARROW_THIN , " Group " , 0 , yco - = 20 , 120 , 19 , " " ) ;
2008-02-10 03:40:24 +00:00
uiDefIconTextBlockBut ( block , node_add_dynamicmenu , NULL , ICON_RIGHTARROW_THIN , " Dynamic " , 0 , yco - = 20 , 120 , 19 , " " ) ;
2006-06-16 04:32:39 +00:00
}
else if ( snode - > treetype = = NTREE_COMPOSIT ) {
uiDefIconTextBlockBut ( block , node_add_inputmenu , NULL , ICON_RIGHTARROW_THIN , " Input " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_outputmenu , NULL , ICON_RIGHTARROW_THIN , " Output " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_colormenu , NULL , ICON_RIGHTARROW_THIN , " Color " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_vectormenu , NULL , ICON_RIGHTARROW_THIN , " Vector " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_filtermenu , NULL , ICON_RIGHTARROW_THIN , " Filter " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_convertermenu , NULL , ICON_RIGHTARROW_THIN , " Convertor " , 0 , yco - = 20 , 120 , 19 , " " ) ;
2006-12-31 00:28:46 +00:00
uiDefIconTextBlockBut ( block , node_add_mattemenu , NULL , ICON_RIGHTARROW_THIN , " Matte " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBlockBut ( block , node_add_distortmenu , NULL , ICON_RIGHTARROW_THIN , " Distort " , 0 , yco - = 20 , 120 , 19 , " " ) ;
2006-06-16 04:32:39 +00:00
uiDefIconTextBlockBut ( block , node_add_groupmenu , NULL , ICON_RIGHTARROW_THIN , " Group " , 0 , yco - = 20 , 120 , 19 , " " ) ;
2006-12-31 00:28:46 +00:00
2006-06-16 04:32:39 +00:00
} else
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
if ( curarea - > headertype = = HEADERTOP ) {
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
uiTextBoundsBlock ( block , 50 ) ;
return block ;
}
static void do_node_nodemenu ( void * arg , int event )
{
SpaceNode * snode = curarea - > spacedata . first ;
int fromlib = 0 ;
2006-07-21 11:52:41 +00:00
/* functions in editnode.c assume there's a tree */
if ( snode - > nodetree = = NULL )
return ;
2006-06-16 04:32:39 +00:00
fromlib = ( snode - > id & & snode - > id - > lib ) ;
switch ( event ) {
case 1 : /* grab/move */
node_transform_ext ( 0 , 0 ) ;
break ;
case 2 : /* duplicate */
if ( fromlib ) fromlib = - 1 ;
else node_adduplicate ( snode ) ;
break ;
case 3 : /* delete */
if ( fromlib ) fromlib = - 1 ;
else node_delete ( snode ) ;
break ;
case 4 : /* make group */
node_make_group ( snode ) ;
break ;
case 5 : /* ungroup */
node_ungroup ( snode ) ;
break ;
case 6 : /* edit group */
if ( fromlib ) fromlib = - 1 ;
else snode_make_group_editable ( snode , NULL ) ;
break ;
case 7 : /* hide/unhide */
node_hide ( snode ) ;
break ;
2006-06-19 08:45:11 +00:00
case 8 : /* read saved render layers */
node_read_renderlayers ( snode ) ;
2006-06-16 04:32:39 +00:00
break ;
case 9 : /* show cyclic */
ntreeSolveOrder ( snode - > edittree ) ;
break ;
2006-12-20 17:57:56 +00:00
case 10 : /* execute */
addqueue ( curarea - > win , UI_BUT_EVENT , B_NODE_TREE_EXEC ) ;
break ;
2008-01-07 12:55:37 +00:00
case 11 : /* make link */
node_make_link ( snode ) ;
2007-12-27 10:17:33 +00:00
break ;
2008-01-07 19:38:01 +00:00
case 12 : /* rename */
node_rename ( snode ) ;
break ;
2008-01-31 15:35:24 +00:00
case 13 : /* read saved full sample layers */
node_read_fullsamplelayers ( snode ) ;
break ;
2008-02-15 15:20:50 +00:00
case 14 : /* connect viewer */
node_active_link_viewer ( snode ) ;
break ;
2008-01-31 15:35:24 +00:00
2006-06-16 04:32:39 +00:00
}
2007-04-22 22:08:19 +00:00
if ( fromlib = = - 1 ) error_libdata ( ) ;
2006-06-16 04:32:39 +00:00
allqueue ( REDRAWNODE , 0 ) ;
}
static uiBlock * node_nodemenu ( void * arg_unused )
{
SpaceNode * snode = curarea - > spacedata . first ;
uiBlock * block ;
short yco = 0 , menuwidth = 120 ;
block = uiNewBlock ( & curarea - > uiblocks , " node_nodemenu " ,
UI_EMBOSSP , UI_HELV , curarea - > headwin ) ;
uiBlockSetButmFunc ( block , do_node_nodemenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Grab/Move|G " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Duplicate|Shift D " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Delete|X " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
2007-12-27 10:17:33 +00:00
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
2008-01-07 12:55:37 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Make Link|F " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 11 , " " ) ;
2007-12-27 10:17:33 +00:00
2006-06-16 04:32:39 +00:00
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Make Group|Ctrl G " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Ungroup|Alt G " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Edit Group|Tab " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Hide/Unhide|H " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 7 , " " ) ;
2008-01-07 19:38:01 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Rename|Ctrl R " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 12 , " " ) ;
2006-06-16 04:32:39 +00:00
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
2006-12-20 17:57:56 +00:00
if ( snode - > treetype = = NTREE_COMPOSIT ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Execute Composite|E " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 10 , " " ) ;
2006-06-16 04:32:39 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Read Saved Render Results|R " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 8 , " " ) ;
2008-01-31 15:35:24 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Read Saved Full Sample Results|R " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 13 , " " ) ;
2008-02-15 15:20:50 +00:00
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Connect Node to Viewer|Ctrl LMB " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 14 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
2006-12-20 17:57:56 +00:00
}
2006-06-16 04:32:39 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Show Cyclic Dependencies|C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 9 , " " ) ;
if ( curarea - > headertype = = HEADERTOP ) {
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
uiTextBoundsBlock ( block , 50 ) ;
return block ;
}
2005-12-18 13:46:01 +00:00
void node_buttons ( ScrArea * sa )
{
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
SpaceNode * snode = sa - > spacedata . first ;
2005-12-18 13:46:01 +00:00
uiBlock * block ;
2006-06-16 04:32:39 +00:00
short xco , xmax ;
2005-12-18 13:46:01 +00:00
char name [ 256 ] ;
sprintf ( name , " header %d " , sa - > headwin ) ;
block = uiNewBlock ( & sa - > uiblocks , name , UI_EMBOSS , UI_HELV , sa - > headwin ) ;
if ( area_is_active_area ( sa ) ) uiBlockSetCol ( block , TH_HEADER ) ;
else uiBlockSetCol ( block , TH_HEADERDESEL ) ;
sa - > butspacetype = SPACE_NODE ;
xco = 8 ;
uiDefIconTextButC ( block , ICONTEXTROW , B_NEWSPACE , ICON_VIEW3D ,
windowtype_pup ( ) , xco , 0 , XIC + 10 , YIC ,
& ( sa - > butspacetype ) , 1.0 , SPACEICONMAX , 0 , 0 ,
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
" Displays Current Window Type " ) ;
2005-12-18 13:46:01 +00:00
xco + = XIC + 14 ;
uiBlockSetEmboss ( block , UI_EMBOSSN ) ;
if ( sa - > flag & HEADER_NO_PULLDOWN ) {
uiDefIconButBitS ( block , TOG , HEADER_NO_PULLDOWN , B_FLIPINFOMENU ,
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
ICON_DISCLOSURE_TRI_RIGHT , xco , 2 , XIC , YIC - 2 ,
& ( sa - > flag ) , 0 , 0 , 0 , 0 , " Show pulldown menus " ) ;
2005-12-18 13:46:01 +00:00
}
else {
uiDefIconButBitS ( block , TOG , HEADER_NO_PULLDOWN , B_FLIPINFOMENU ,
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
ICON_DISCLOSURE_TRI_DOWN , xco , 2 , XIC , YIC - 2 ,
& ( sa - > flag ) , 0 , 0 , 0 , 0 , " Hide pulldown menus " ) ;
2005-12-18 13:46:01 +00:00
}
xco + = XIC ;
if ( ( sa - > flag & HEADER_NO_PULLDOWN ) = = 0 ) {
/* pull down menus */
uiBlockSetEmboss ( block , UI_EMBOSSP ) ;
2006-06-16 04:32:39 +00:00
xmax = GetButStringLength ( " View " ) ;
uiDefPulldownBut ( block , node_viewmenu , NULL ,
" View " , xco , - 2 , xmax - 3 , 24 , " " ) ;
xco + = xmax ;
xmax = GetButStringLength ( " Select " ) ;
uiDefPulldownBut ( block , node_selectmenu , NULL ,
" Select " , xco , - 2 , xmax - 3 , 24 , " " ) ;
xco + = xmax ;
xmax = GetButStringLength ( " Add " ) ;
uiDefPulldownBut ( block , node_addmenu , NULL ,
" Add " , xco , - 2 , xmax - 3 , 24 , " " ) ;
xco + = xmax ;
xmax = GetButStringLength ( " Node " ) ;
uiDefPulldownBut ( block , node_nodemenu , NULL ,
" Node " , xco , - 2 , xmax - 3 , 24 , " " ) ;
xco + = xmax ;
2005-12-18 13:46:01 +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
uiBlockSetEmboss ( block , UI_EMBOSS ) ;
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
/* main type choosing */
uiBlockBeginAlign ( block ) ;
uiDefIconButI ( block , ROW , B_REDR , ICON_MATERIAL_DEHLT , xco , 2 , XIC , YIC - 2 ,
& ( snode - > treetype ) , 2 , 0 , 0 , 0 , " Material Nodes " ) ;
xco + = XIC ;
uiDefIconButI ( block , ROW , B_REDR , ICON_IMAGE_DEHLT , xco , 2 , XIC , YIC - 2 ,
2006-02-08 22:04:54 +00:00
& ( snode - > treetype ) , 2 , 1 , 0 , 0 , " 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
xco + = 2 * XIC ;
uiBlockEndAlign ( block ) ;
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
/* find and set the context */
snode_set_context ( snode ) ;
if ( snode - > treetype = = NTREE_SHADER ) {
if ( snode - > from ) {
/* 0, NULL -> pin */
More node goodies!
First note; this is a WIP project, some commits might change things that
make formerly saved situations not to work identically... like now!
------ New Material integration ------
Until now, the Node system worked on top of the 'current' Material, just
like how the Material Layers worked. That's quite confusing in practice,
especially to see what Material is a Node, or what is the "base material"
Best solution is to completely separate the two. This has been implemented
as follows now;
- The confusing "Input" node has been removed.
- When choosing a Material in Blender, you can define this Material to be
either 'normal' (default) or be the root of a Node tree.
- If a Material is a Node tree, you have to add Nodes in the tree to see
something happen. An empty Node tree doesn't do anything (black).
- If a Material is a Node Tree, the 'data browse' menus show it with an
'N' mark before the name. The 'data block' buttons display it with the
suffix 'NT' (instead of 'MA').
- In a Node Tree, any Material can be inserted, including itself. Only in
that case the Material is being used itself for shading.
UI changes:
Added a new Panel "Links", which shows:
- where the Material is linked to (Object, Mesh, etc)
- if the Material is a NodeTree or not
- the actual active Material in the Tree
The "Node" Panel itself now only shows buttons from the other nodes, when
they are active.
Further the Material Nodes themselves allow browsing and renaming or adding
new Materials now too.
Second half of today's work was cleaning up selection when the Nodes
overlap... it was possible to drag links from invisible sockets, or click
headers for invisible nodes, etc. This because the mouse input code was
not checking for visibility yet.
Works now even for buttons. :)
2005-12-29 18:08:01 +00:00
xco = std_libbuttons ( block , xco , 0 , 0 , NULL , B_MATBROWSE , ID_MA , 1 , snode - > id , snode - > from , & ( snode - > menunr ) ,
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
B_MATALONE , B_MATLOCAL , B_MATDELETE , B_AUTOMATNAME , B_KEEPDATA ) ;
if ( snode - > id ) {
Material * ma = ( Material * ) snode - > id ;
uiDefButC ( block , TOG , B_NODE_USEMAT , " Use Nodes " , xco + 5 , 0 , 70 , 19 , & ma - > use_nodes , 0.0f , 0.0f , 0 , 0 , " " ) ;
xco + = 80 ;
}
}
}
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
else if ( snode - > treetype = = NTREE_COMPOSIT ) {
2006-05-12 11:27:01 +00:00
uiDefButS ( block , TOG , B_NODE_USESCENE , " Use Nodes " , xco + 5 , 0 , 70 , 19 , & G . scene - > use_nodes , 0.0f , 0.0f , 0 , 0 , " Indicate this Scene will use Nodes and execute them while editing " ) ;
xco + = 80 ;
2008-03-21 23:10:23 +00:00
uiDefButBitI ( block , TOG , R_COMP_FREE , B_NOP , " Free Unused " , xco + 5 , 0 , 80 , 19 , & G . scene - > r . scemode , 0.0f , 0.0f , 0 , 0 , " Free Nodes that are not used while composite " ) ;
2006-05-12 11:27:01 +00:00
xco + = 80 ;
2007-12-09 22:12:01 +00:00
uiDefButBitS ( block , TOG , SNODE_BACKDRAW , REDRAWNODE , " Backdrop " , xco + 5 , 0 , 80 , 19 , & snode - > flag , 0.0f , 0.0f , 0 , 0 , " Use active Viewer Node output as backdrop " ) ;
2006-07-31 19:23:42 +00:00
xco + = 80 ;
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
}
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
2005-12-18 13:46:01 +00:00
/* always as last */
sa - > headbutlen = xco + 2 * XIC ;
uiDrawBlock ( block ) ;
}