Commit Graph

2525 Commits

Author SHA1 Message Date
92d7955d13 fix for struct definition building with msvc2008 and some style cleanup. 2013-03-24 01:19:55 +00:00
3966722057 code cleanup: misc warnings/style 2013-03-21 02:58:21 +00:00
8655be437d code cleanup: use bool where values are true/false, for view3d and related functions. 2013-03-20 23:14:18 +00:00
01e9dae3dc code cleanup 2013-03-18 18:25:05 +00:00
Lukas Toenne
4638e5f99a Merge of the PyNodes branch (aka "custom nodes") into trunk.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.

=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.

Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].

=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].

The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.

[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2013-03-18 16:34:57 +00:00
655ed9cc7f style cleanup 2013-03-18 11:44:56 +00:00
9d896f8f84 Border rendering now works for all scenes used in compositor,
before this only active scene would be rendered with border.

When do_render_fields_blur_3d() is finished, it'll modify
render's display rect so it'll correspond bordered render
result placed on black backgrund. Actual border is stored
nowhere, which makes it only way to re-calculate disprect
for all other renders used in compo based on source. Not
so big deal actually.

Also needed to modify Cycles a bit, because before this
patch it used border settings from scene being rendered.
Now made it so render data is passing to external engines.

Using a property inside RenderEngine structure for this.
Not best ever design for passing render data, but this
would prevent API breakage. So now external engines could
access engine.render to access active rendering settings.

Reviewed by Brecht, thanks!
2013-03-14 07:38:37 +00:00
385650974a Fix for build error with previous commit, seems the order of #includes matters here. 2013-03-13 17:30:31 +00:00
874b692e80 More UI message i18n fixes and improvements...
Rendering messages are now translatable.
2013-03-10 16:55:01 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
6fd187e4df code cleanup: 0 --> NULL 2013-03-08 06:32:00 +00:00
c36f20a7d2 style cleanup 2013-03-08 04:00:06 +00:00
53b7bc8f1f Change !BLI_ghashIterator_isDone to BLI_ghashIterator_notDone. It is
always used in that context so we can at least avoid reverting it twice
:p.
2013-03-06 20:55:04 +00:00
f2bb536994 code cleanup: also change BKE_blender.h BLENDER_VERSION_CHAR to 'a' so as not to confuse things. 2013-03-05 14:47:49 +00:00
384948908a patch [#34103] path_util_split_dirstring.patch, path_util_split_dirstring_2.patch, path_util_split_dirstring_3.patch
from Lawrence D'Oliveiro (ldo)

Get rid of BLI_splitdirstring, replace with calls to BLI_split_dirfile, BLI_split_dir_part and BLI_split_file_part as appropriate.
2013-03-05 06:26:10 +00:00
e39f05e5fa patch [#34103] fileops_1.patch
from Lawrence D'Oliveiro (ldo) 

Add comments and use of bool type in fileops.c
2013-03-05 03:53:22 +00:00
f44b54d2a7 patch [#34103]
from Lawrence D'Oliveiro (ldo)

More use of bool type, necessitating adding inclusion of BLI_utildefines.h, or moving it up in the inclusion order if it was already included, in various places
- storage.c: make some variables only used in bli_builddir local to that
- storage.c: BLI_file_descriptor_size should allow 0 as a valid file descriptor
- path_util.c: make pointers to non-reentrant storage returned from folder routines const, necessitating making variables holding these returned pointers const elsewhere as well
- path_util.c: BLI_string_to_utf8 closes iconv context in case of conversion error
-  blf_lang.c: fill_locales routine now has its own "languages" local variable to construct paths (was stealing internal storage belonging to BLI_get_folder before)
2013-03-05 03:17:46 +00:00
42ca1c8dcd Fix for image transparency backwards compatibility. Now the texture datablock has
a Use Alpha option again. This makes the case where you enabled Premultiply on the
image and disabled Use Alpha on the texture work again.

That's mostly useful when you have a straight alpha image file which has no useful
RGB colors in zero alpha regions (e.g. renders). Then sometimes you don't want to
use the alpha for the texture stack mixing, but you still want to multiply it into
the RGB channels to avoid a blocky transition into zero alpha regions.

This also removes the version patch that copied image datablocks because it's not
reliable and might be causing bug #34434. This does mean we are no longer backwards
compatible for cases where two different texture datablocks with Use Alpha enabled
and disabled where using the same image.
2013-03-04 13:18:14 +00:00
f691ee0627 Fix #34501: Painting on image editor with texture brush causes memory leaks in render module
Issue was caused by svn rev54721 where donequeue wasn't fully handled
in cases rendering was canceled, which lead to some render results
unfreed.
2013-03-04 12:40:24 +00:00
79e80d8322 code cleanup: ~400 duplicate lines for AO form factor math. 2013-03-03 05:07:58 +00:00
1039135965 More UI messages fixes... 2013-02-28 15:31:20 +00:00
4f3ca854e1 Fix various warnings with clang build, and adjust cmake clang warnings flags
to include a few more that gcc is using too.
2013-02-26 21:58:06 +00:00
9b5b9e7a09 Fix #34351: Displacement map Bake margin does not work 2013-02-22 09:57:10 +00:00
6b600d0793 Blender Internal: optimization to remove sleep() calls from the render threading
code. This gives a speedup up to a couple of seconds based only on the image
resolution and tile size. For complex renders a second or two is not so noticeable
but for quick ones it's nice to save some time. On the default cube this gives me
about half a second speedup.

Patch by Johan Walles, based on the render branch implementation by me.
2013-02-21 18:08:07 +00:00
9a86abd440 code cleanup: remove unused runtime var - World.fastcol 2013-02-21 17:10:27 +00:00
b9333b304c Fix visible seams on normal map bake due to clear colour being black:
This is a special case, tangent space normal maps should be cleared to
0.5, 0.5, 1.0. This is good practice but there's no reason why not to
automate this (for artists whose bump map fu may be a bit shallow).

Thanks to Morten Mikkelsen for reporting.
2013-02-20 15:06:13 +00:00
e3944f5bfa Divide by 3 instead of multiplying by variations of 0.333
Fixes small precision problems.
2013-02-14 17:35:43 +00:00
5d6f83b179 remove redundant if statement. 2013-02-13 05:07:46 +00:00
58a6f07649 Bug fix #34213 (2)
Adding non-RGBA float buffers as texture crashes MipMap code.
Images with less than 4 channels not supported (yet). Not sure
if we ever should even... normals, Z, vectors, UV, Index, all
don't like downsampling.
2013-02-12 15:51:05 +00:00
c4d248cc76 Fix #34194: Render Layer node didn't initialize color management flag properly
Bang! How we didn't notice this for so long -- seems scenes came from render
layer node were rendering as if color management disabled (byte image wouldn't
be linearized).
2013-02-11 12:25:54 +00:00
2005f7c6c0 style cleanup: also some typos 2013-02-11 00:49:00 +00:00
b5962b7ccd Fix #34186: VSE: Incorrect movie output when scene strip is muted by keyframe 2013-02-10 09:27:25 +00:00
ebf18c6df9 Corrections to alpha pipeline do_versions
Basically they're aimed to solve issues when scene with sky
was used for compositing. If compo used alpha output result
of current trunk would be completely different form hwo it
was before.

Two heuristics here:
- If there's no world or world color is black, it completely
  equals to straight alpha mode, no further magic is needed
  to preserve compatibility

- If scene is used as Render Layer node and something is
  connected to Alpha output of this node, ensure alpha mode
  for this scene is set to Premultiplied.

Basically it shall give better compatibility and make
4K mango project just happy! :)
2013-02-08 16:25:35 +00:00
cef952a750 fix for error in own recent commit, null check before assignment. 2013-02-08 04:43:36 +00:00
7cb62127b3 Fix #34156: Spec. and Alpha Intensity OpenGL issue
Issue was caused by alpha pipeline cleanup: apparently depending on
use_alpha flag different channels for spec/alpha would be used.

Made it so talpha is computed from Image->ignore_alpha instead of
always considering to be TRUTH.

This is not so much trivial to understand what's going on here, but
it's not new issue. Anyway, if someone have got ideas how to improve
feedback here -- ideas are welcome! For now only regression is fixed.
2013-02-07 15:36:59 +00:00
441c7fb79a fix for crashes running some operators in background mode and some divide by zero errors. 2013-02-06 02:48:03 +00:00
f40dc45054 fix [#34125] Crash when bake margin = 0
regression since 2.65, just missing NULL check.
2013-02-06 00:48:17 +00:00
9ddf928dbd remove stringify macro from alloc's 2013-02-05 09:42:40 +00:00
791e38afd2 fix [#34105] bake artifacts
different threads could allocate the mask buffer and overwrite the same pointer, regression since 2.65
2013-02-05 08:16:04 +00:00
69993c5d40 style cleanup: spaces -> tabs 2013-02-04 00:18:09 +00:00
518bfbb1c9 style cleanup 2013-02-02 04:58:03 +00:00
6fca85780b style cleanup: also correct doc example for 'foreach_get/set' 2013-02-02 00:34:34 +00:00
cc96196f10 Fix #34004: crash when canceling ongoing render with scene strip
Issue was caused by recursive call of RE_BlenderFrame. Solved by
reshuffling image pool init/free in do_render_all_options.

Should be harmless, but doublecheck on this is welcome.
2013-01-28 13:29:10 +00:00
c411cde415 header cleanup, include BLI before BKE, also use bool for ntreeShaderExecTree 2013-01-24 21:57:13 +00:00
b12a019948 Usability
- Cycles materials now render in Blender Internal too, skipping the nodes.
  Not very useful, but at least things then show up on renders and in
  previews.

- Node editor: if wrong shader nodes are in a tree, they draw with thene
  color RED ALERT headers now. (Switching render engine will show it).
2013-01-24 16:11:07 +00:00
69900035b3 fix for G,G causing vertex slide in UV/Image window, also comment unused defines/enums. 2013-01-24 08:49:40 +00:00
59a187b338 Fix threading issues of viewport rendering when using movies/generated images
Issue was caused by the fact that guarded allocator is not thread-safe and
generated images/movies could allocate memory when loading pixels to Cycles.

Currently solved by switching memory allocator to using mutex lock (the same
as sued for jobs) when viewport rendering is used.

Nicer solution would be to make guarded allocator thread-safe by using atomic
operations and lock-free lists, but that's more serious change.
2013-01-24 08:14:20 +00:00
9ff704db39 style cleanup: bake 2013-01-23 23:28:22 +00:00
b9472cbd83 Code cleanup: move render baking code into own file. 2013-01-23 13:13:16 +00:00
a03cc5c6c5 Fix small issue found in vertex color bake bug that caused the result to be
different each time, due to float precision issues. The camera matrix itself
should not be modified in render, just its copy.
2013-01-23 13:13:10 +00:00