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.
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.
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.
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.
- 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
- 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!
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.
- 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!
- 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.
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 :)
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.
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.
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.
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.
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().
- 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.
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.
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.
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.
- 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...)
- 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
(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.
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.
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 :)
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.
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.avihttp://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.
- 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.
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.
- 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.