Commit Graph

73 Commits

Author SHA1 Message Date
29054847a7 missing null check in node editor. 2007-12-12 14:07:24 +00:00
6dc52c893f for button popups, dont close unless you click or press escape, this would often close when dragging a button value (or when using a tablet I am told) 2007-12-11 23:05:10 +00:00
427e063777 == imagebrowser ==
* activate imagebrowser for image node with CTRL+LMB on load button in image node.
2007-09-14 18:41:00 +00:00
5c1335a4a5 Fix for bug #7406 'Compositor Crash'
Previously when deleting a scene, no checks were made to see if 
any render layer nodes in other scenes were referencing them,
leaving them pointing to bad memory. Now, this checks all other
scenes' nodetrees and sets pointers to the to-be-deleted scene to
NULL, which gets taken care of elsewhere.
2007-08-14 04:38:31 +00:00
b21e895d03 * Added a bit more 'padding' around the node sockets, so there's a
larger area to drop the noodle connection on. This helps a lot when 
working with lots of nodes and the view zoomed out to maximum.
2007-07-03 07:39:17 +00:00
94ad8c810c Changed TESTBASE and TESTBASE_LIB to check the hidden flag
Checked every instance of testbase to see this dosnt break anything, also changed TESTBASE and TESTBASELIB, both were used incorrectly in places.

added error_libdata() for library error messages that are everywhere.
added object_data_is_libdata to test if the object and its data's are from a library.
fixed 2 crashs in adding Curve points to a library object (remember to check, verify_ipocurve returns NULL!)
made duplicating and making dupli's real for lib objects possible, disabled joining into lib armatures and meshes.
2007-04-22 22:08:19 +00:00
d2fd630e0a Bugfix #5748
Composite: when using multiple scene render-nodes, and one of these
scenes got re-rendered (by making scene active temporary), the composite
cache should free the used buffers.

Now, on each render, all scenes in a Blender project are being checked.
2007-01-19 12:43:02 +00:00
253432bfc7 The Big Image refactor!
Please read:
http://www.blender3d.org/cms/Imaging.834.0.html

Or in short:

- adding MultiLayer Image support
- recoded entire Image API
- better integration of movie/sequence Images

Was a whole load of work... went down for a week to do this. So, will need
a lot of testing! Will be in irc all evening.
2006-12-20 17:57:56 +00:00
7f1e3874f9 Node editing usablity!
- Removed stupid idea to insert convertor nodes in Node Shaders, when a
  link is created by non-matching sockets. Now it works like Compositor,
  doing a default conversion. Works like this:

1 from 3 or 4 values: take average
3 from 1: copy to all
3 from 4: copy 3
4 from 1: copy to 3, set alpha to 1
4 from 3: copy 3, set alpha to 1

- Added select-linked in Nodes. Lkey or Shift+L. Also in pulldown menus
2006-12-08 21:20:36 +00:00
09d3d15f45 Node editor: when adding a new node, automatic links are created:
- from all selected nodes
- only connections between highest order socket types; so if there's RGBA
  and Value sockets, only RGBA sockets are connected. This because in
  these cases the Value sockets usually are for user input.
  Example: Mix node.

Thanks Trip for the hint!
2006-12-05 21:33:56 +00:00
869eeadeff Damn! Commit for render passes in wrong dir.... 2006-12-05 16:44:57 +00:00
20ac94e8f0 Two hours of fixing details based on Klocwork source review. Useful report,
although it has a lot of noise. Not to mention our bad string code gives
a load of warnings.

I've reviewed specifically:
- file reading/write
- dna and library code
- node system
- entire render module

Done a couple of files in src/ too, seemed to be nice errors.
2006-12-01 19:52:04 +00:00
c3adb61dcc Composite Time node usablity improvement:
- now draws green 'current frame' line
- when Time Node is active, hotkey I will allow inserting a value on
  current frame.
2006-11-24 16:56:02 +00:00
a667b79b35 Small usability tweaks in Compositor:
- After making a Group, internal socket values are now copied to the
  group node, so an execute will give identical results
- After ungrouping, the cyclic dependency tagging didn't work well in
  all cases, showing a red noodle line and giving composite errors.
  For time being solved by calling the NodeSort twice.
- Viewer nodes now get previews updated always (used to be only the active)
  Note: this is not for previews inside of groups!
2006-11-20 09:37:01 +00:00
f89b052262 New Compo node: the Split-Viewer, showing two images halves to compare.
Works internally already with masks, so we can have several builtin
types.
2006-11-16 21:50:35 +00:00
b771cd9ca8 Two tiny compositor annoyances;
- Image Node: after loading new file it didn't update the header name
- File-out Node: header color suggested there was only 1 'active', which
  it isn't.
2006-11-13 16:43:45 +00:00
af4422bdb2 Patch #5184, Juho V (bebraw)
One liner basically; makes toolbox pop up like in 3d window, if you've
set it to reveil on holding RMB.
2006-11-12 13:28:39 +00:00
72c8d7c313 Bugfix #4806
Reports came in that Elephants Dream files crash on quit or loading other
files. Was caused by freeing Material Nodes, which was accessing memory
that potentially was just freed before (node->id). Apparently only Windows
really gives issues then, which is actually a good thing :)
2006-08-15 08:56:48 +00:00
28f23d9b81 * Added Shift MMB in the node editor to pan the backdrop image display 2006-08-13 12:01:07 +00:00
a6b0c136bb Bugfix #4770
When adding a new node in a group, the call to refresh input/output
sockets was called after a compositing update was executed.
Just moved this call 2 lines up.

This also uncommits the fix from Joilnen, the stack pointers in the node
system are *per definition* set. If NULL, it's an indication something
else is wrong.
2006-07-23 09:10:05 +00:00
e9c1e40681 Bugfix #4505
Node Editor.
Fix for a fix: cleanup of abuse of uiBlock accidentally disabled the
feature that only makes Node buttons accessible when visible. This to
allow Nodes to overlap and properly used.
2006-06-27 16:54:24 +00:00
3ffdc5a83b Bugfix #4480
Material Node trees needed support in IpoWindow still, it was only showing
the Ipo for the (defunct) base material. Now it follows the active Node.
2006-06-26 11:01:09 +00:00
7e081266a9 Bugfix #4460
Compositor:
The option to re-render a single node, didn't free memory if nodes were in
use showing exactly same RenderLayer.
2006-06-25 12:00:34 +00:00
a1e77e2394 Bugfix 4424
When using the button in a RenderLayer node to render a single node, the
new 'render to fullscreen' crashed in end. Reason; the node editor was
still handling events after a render, as if the node editor was still open.
2006-06-23 19:43:48 +00:00
5124edfcc5 Bugfix #4365
Node Editor: using menu "View -> View All" crashed when no nodes exist.
2006-06-20 09:41:35 +00:00
cbe9fc4e44 Compositor: the default now doesn't include a Viewer node anymore, was too
confusing.
2006-06-19 12:47:37 +00:00
5f5ee11fcb Seems a large commit, but I also changed function names to match the new
naming convention for Compositing:

- Render Result node -> Render Layers node (name only appears in Add menu)
- Compositor image -> Viewer Node image

I've also added a version patch (2.41 saved files only) to rename existing
"Compositor" Images.
2006-06-19 08:45:11 +00:00
19832a0639 Solved bad design decision in Node Editor:
The buttons uiBlock was stored in a Node, for retrieval of node buttons,
however that won't work when multiple windows show same Nodes.
Now implemented more correct unique Block names (as all over in UI), and
use that name to retrieve buttons with API call uiGetBlock().
2006-06-17 13:04:09 +00:00
5a4dc67281 Cleanup of UI for new renderpipeline
- removed "Unified" button, replaced with "HD" preset for 1920x1080 output
- removed the unused "Pass" options
- removed the unused "Strands" render-layer option

Because the internal render pipe supports this already; added two more
render-layer options:

- "Sky", to enable/disable sky render in a layer (this was part of "Solid"
  before, not so correct... to ensure previously saved files work, the
  "Sky" option is set by default when "Solid" was set. The version patching
  will do this temporally always, until we've bumped up version to 2.42
- "Edge", to enable/disable edge render in a layer. Nice for compositing.

Also in this commit: fixed warnings for exported functions for the new
Node Editor pull-down menus.
2006-06-17 10:25:07 +00:00
cf9e420ad3 * Added header pulldown menus for the Node Editor. Also tweaked colours and some
of the menu organisation, consolidating the redundant 'Generators' with 'Input'.
2006-06-16 04:32:39 +00:00
e7ee6c3ec4 Stupid me... commit for support of viewer Node in Groups broke adding
new viewer nodes. Wrong use of variable.
2006-06-05 16:46:13 +00:00
bc7b4988d0 Plumiferos request
Compositor:
Viewer Nodes inside of Groups now work too. To not frustrate interactive
speed, the following rules apply:

- Making a Group editable (or closing) doesn't signal recalculation of
  composite
- clicking on an Input socket always checks changes and calulcates
- When there are Viewers inside an edited Group, Viewers in the main tree
  are not executed.

Also added: a "hide unused sockets" icon in the header of Viewer nodes.
This allows cleanup of Groups, to prevent these sockets get reveiled.
2006-06-03 09:19:10 +00:00
3b9e0e65d2 Compositor: Pressing Rkey now gives a popup for OK, and then will read in
all RenderResult nodes (when "Save Buffers" used) at once.

Before it only read 1 Scene... not too useful.

Also: added wait-cursor for saving images in UV/Image Editor.
2006-05-12 15:17:24 +00:00
e91dddc923 Bugfix: Node editor, ALT+G "UnGroup" crashed when group was editable.
Now it exits this editing mode, and ungroups nicely.
2006-03-14 21:58:16 +00:00
ea9866a75f Memory saving for large renders:
New option "Save Buffers", in first Output panel of renderbuttons, will not
allocate all render buffers, but instead save the rendered tiles to exr.
For each scene rendered, a single exr file then is created.
After rendering, the files get read, and only then the memory allocation is
done.

The exr files are saved in the temp dir (from user settings), and have
names derived from the filename+scene name. That way these buffers remain
relatively unique, and can be re-used later too.

Saving all render-layers and passes in a single file (as F3 command) will
be done later. Also reading back the current muli-layer exr files is not
supported yet (will read black). The purpose is that these files then can
be used as input for the Compositor.

One fun thing I added; after rendering once with this option, close
Blender, and restart it. If you have a Composite set up press 'R' on an
active RenderResult node. This will refresh the node(s) and load the exr,
so you can composite again without a re-render.
2006-03-14 21:29:42 +00:00
fe3506f6d4 WIP commit on getting the 'render result layers' saved in a single
file. Previous fix accidentally committed parts of that... :)

Note: it is currently disabled still... will commit the real version
soon.
2006-03-14 17:48:40 +00:00
8a8c70c63a A couple of render improvements;
- Bug fix: the upper tile in a collumn for Panorama render didn't put the
  mainthread to sleep properly. Now panorama renders 25% faster if you had
  set Y-Parts to 4.

- Enabling Compositing in Scene for first time now adds a "Composite" node
  too, so render output gets applied.
- An attempt to render with "Do Composite" without "Composite" node will
  throw an error and stops rendering. In background mode it will just not
  render at all, and print errors.
- Errors that prevent rendering now give a popup menu again.
- Having MBlur or Fields option on will now normally render, but with an
  error print in console (not done yet...)
2006-03-12 11:51:56 +00:00
973b442075 Compositing goodie: ESC now works to stop, but it will finish the node it
was working on.
2006-03-08 21:12:48 +00:00
d0011f3318 Compositing workflow goodie; each 'render result' node now has a button
option to re-render that specific node. Also works for nodes using other
scenes.
2006-03-07 21:26:37 +00:00
04ec4a2530 Compositor upgrade;
- Links now can be made between any socket type. The nodes recognize amount
  of channels, and will convert types if needed.
  Conversions from RGBA to 1 channel will use the 'RGB to BW' formula.

  Also note that conversions only happen when required. So you can blur an
  alpha channel, filter it, and put this in a 1-channel socket without any
  conversion to happen, which saves memory & cpu time.

  http://www.blender.org/bf/rt.jpg

  The blur nodes don't accept Vector input yet... But filter does.

- RGB Curve Nodes now have the premultiply option resored, 2 x faster

- Fixed some confusing code in Node Group handling... much stabler now
2006-02-20 13:43:40 +00:00
387f9a7c6d Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)

-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.

-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.

Current classes are (compositor examples):

Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes

-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
  later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
  to re-use these temp files on starting Blender or loading files, showing
  the last result of a render command.

The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!

-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
90fa460d2a 3 very simple new composite nodes that I wanted for working with here. Hope the code is ok,
they work ok in testing here and get done what I need, any checks or fixes are welcome.

* Separate RGBA: Separates an input RGBA image into its R, G, B and A channels
* Separate HSVA: Separates an input RGBA image into H, S, V and A channels
* Set Alpha: Takes an input RGBA image and an alpha value channel and combines them
into a single RGBA image channel. You can also set the alpha for the entire image
with the number field when there's no input alpha channel. TODO: Allow input alpha
channel with no input image, in order to output a solid colour, with alpha.
2006-02-17 13:51:55 +00:00
9da59fdb5a Bug fix: copying a scene, choosing 'empty scene' did a corrupt copy of the
scene render layers

Little feat: Render Result Nodes that use other scene, have icon in button
to indicate this.
2006-02-14 11:28:13 +00:00
ff7f544dec Preview rendering improvement;
Until now, on each mouse/key event preview render restarted with first tile.
It now rememers where it was, and continues rendering.
Also tried to get threaded preview working, but its more work than I can
spend right now. Back to bugs :)
2006-02-13 19:27:16 +00:00
e4a0390b39 Group Nodes made functional: each group now can be re-used (instanced)
with SHIFT+G. This works as well for local groups as library-linked
groups.

Also fixed that group nodes were copying internal data to the outside,
which made it impossible to use the socket-buttons to set individual
values for each group-instance.

Library-linked groups are prevented from editing. But, try to open a
group and it will give a request for 'make local'. The make local rule
is identical to other library data in blender, meaning:
- if all users of the library data are local -> the library data is
  flagged 'local', and if needed a unique name is made
- if there's mixed users (local and from other library data) it makes
  a full copy, and assigns this copy to all local users.
2006-02-07 15:50:55 +00:00
f45546a1d3 iImage based Vector Blur
After a couple of experiments with variable blur filters, I tried
a more interesting, and who knows... original approach. :)

First watch results here:
http://www.blender.org/bf/rt0001_0030.avi
http://www.blender.org/bf/hand0001_0060.avi

These are the steps in producing such results:

- In preprocess, the speed vectors to previous and next frame are
  calculated. Speed vectors are screen-aligned and in pixel size.
- while rendering, these vectors get calculated per sample, and
  accumulated in the vector buffer checking for "minimum speed".
  (on start the vector buffer is initialized on max speed).

- After render:
- The entire image, all pixels, then is converted to quad polygons.
- Also the z value of the pixels is assigned to the polygons
- The vertices for the quads use averaged speed vectors (of the 4
  corner faces), using a 'minimum but non-zero' speed rule.

  This minimal speed trick works very well to prevent 'tearing' apart
  when multiple faces move in different directions in a pixel, or to
  be able to separate moving pixels clearly from non-moving ones

- So, now we have a sort of 'mask' of quad polygons. The previous steps
  guaranteed that this mask doesn't have antialias color info, and has
  speed vectors that ensure individual parts to move nicely without
  tearing effects. The Z allows multiple layers of moving masks.

- Then, in temporal buffer, faces get tagged if they move or not
- These tags then go to an anti-alias routine, which assigns alpha
  values to edge faces, based on the method we used in past to antialias
  bitmaps (still in our code, check the antialias.c in imbuf!)

- finally, the tag buffer is used to tag which z values of the original
  image have to be included (to allow blur go behind stuff).

- OK, now we're ready for accumulating! In a loop, all faces then get
  drawn (with zbuffer) with increasing influence of their speed vectors.
  The resulting image then is accumulated on top of the original with a
  decreasing weighting value.

It sounds all quite complex... but the speed is still encouraging. Above
images have 64 mblur steps, which takes about 1-3 seconds per frame.

Usage notes:

- Make sure the render-layer has passes 'Vector' and 'Z' on.
- add in Compositor the VectorBlur node, and connect the image, Z and
  speed to the inputs.
- The node allows to set amount of steps (10 steps = 10 forward, 10 back).
  and to set a maximum speed in pixels... to prevent extreme moving things
  to blur too wide.
2006-02-06 22:11:50 +00:00
98a0768028 Compositor: Added a basic "Time Node".
Just indicate start/end frame, and node outputs with Curve a value between
0.0 and 1.0.
2006-02-04 14:38:51 +00:00
1db5c23716 More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.

The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.

Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.

- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".

- Bug fixes

Added redraw event for Image window, when using compositor render.

Text objects were not rendered using background render (probably a bug
since depsgraph was added)

Dropdown buttons in Node editor were not refreshed after usage

Sometimes render window did not open, this due to wrong check for 'esc'.

Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
d8ae1c93f3 Accidentally committed without log...
This commit removes old preview-image signals for Compositor, this was
obsolete when event-based updates were added, and was still causing
recalculations for example on loading files.
2006-02-02 22:35:23 +00:00
f493e8ed2e features & fixes:
- Enabled Groups to execute in Compositor. They were ignored still.
  Note; inside of groups nothing is cached, so a change of a group input
  will recalculate it fully. This is needed because groups are linked
  data (instances use same internal nodes).

- Made Composit node "Viewer" display correctly input for images with
  1/2/3/4 channels.

- Added pass rendering, tested now with only regular Materials. For
  Material nodes this is quite more complex... since they cannot be
  easily separated in passes (each Material does a full shade)
  In this commit all pass render is disabled though, will continue work on
  that later.
  Sneak preview: http://www.blender.org/bf/rt.jpg  (temporal image)

- What did remain is the 'Normal' pass output. Normal works very nice for
  relighting effects. Use the "Normal Node" to define where more or less
  light should be. (Use "Value Map" node to tweak influence of the
  Normal node 'dot' output.)

- EVIL bug fix: I've spend almost a day finding it... when combining AO and
  mirror render, the event queue was totally screwing up... two things not
  related at all!
  Found out error was in ray-mirror code, which was using partially
  uninitialized 'ShadeInput' data to pass on to render code.

- Another fix; made sure that while thread render, the threads don't get
  events, only the main program will do. Might fix issues reported by
  people on linux/windows.
2006-02-02 17:54:22 +00:00