Commit Graph

467 Commits

Author SHA1 Message Date
Lukas Toenne
a83cdfe41a Associate Node RNA subtypes with their respective bNodeType on registration. This has to be done in blenkernel, since RNA node types are actually registered before the node types. Future dynamic node types registered using the API will register their own explicit RNA types and don't need this hack. 2012-12-20 09:49:11 +00:00
81a762e79f Fix cycles viewport render getting stuck with driven/animated nodes, the updated
flag would not get cleared due to the nodetree not being a real datablock.
2012-12-03 16:21:43 +00:00
Lukas Toenne
46636a601e Removed unused register_ lines from for and while loop nodes. These nodes were already commented out and removed in r51576. 2012-11-30 16:03:34 +00:00
f8759797e6 fix for crash copying nodes, regression since last release. 2012-11-26 16:20:35 +00:00
Dalai Felinto
7cfb79256e Map Range Node (tiles)
this node allows for more control for normalization of the mapped input range.

Made during BlenderPRO 2012 - Brasilia, Brazil :)
Idea and testing: Daniel Salazar
Implementation: yours truly
Reviewed by Lukas Toenne and Sergey Sharybin
2012-11-14 19:53:46 +00:00
27d647dcf8 Cycles: 4 new nodes.
* Tangent: generate a tangent direction for anisotropic shading. Can be either
  radial around X/Y/Z axis, or from a UV map. The default tangent for the
  anisotropic BSDF and geometry node is now always radial Z, for UV tangent use
  this node now.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Tangent

* Normal Map: generate a perturbed normal from an RGB normal map image. This
  is usually chained with an Image Texture node in the color input, to specify
  the normal map image. For tangent space normal maps, the UV coordinates for
  the image must match, and the image texture should be set to Non-Color mode
  to give correct results.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Normal_Map

* Refraction BSDF: for best results this node should be considered as a building
  block and not be used on its own, but rather mixed with a glossy node using a
  fresnel type factor. Otherwise it will give quite dark results at the edges for
  glossy refraction.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Refraction

* Ambient Occlusion: controls the amount of AO a surface receives, rather than
  having just a global factor in the world. Note that this outputs a shader and
  not a color, that's for another time.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Ambient_Occlusion
2012-11-06 19:59:02 +00:00
2122eda05a Bugfix 33075
Nodes could use duplicated memory - and on free you get duplicate-free errors.
Affected texture nodes, but I suspect compositing too.

Fix found by Philipp Oeser. Thanks!
2012-11-04 11:53:13 +00:00
e02b23b81a Render API: shader script node for custom shaders.
* Shader script node added, which stores either a link to a text datablock or
  file on disk, and has functions to add and remove sockets.
* Callback RenderEngine.update_script_node(self, node) added for render engines
  to compile the shader and update the node with new sockets.

Thanks to Thomas, Lukas and Dalai for the implementation.
2012-11-03 14:32:26 +00:00
5549904171 style cleanup 2012-10-29 02:11:40 +00:00
Lukas Toenne
5464979dfd Fix for freeing node trees that are part of other data blocks (material, world, lamp, texture, scene). These node trees were not properly freeing the IDProperty data, due to not being called from BKE_libblock_free.
Now there is an extra function BKE_libblock_free_data, which is called explicitly in ntreeFreeTree if the tree is not part of the library data (ntreeCopyTree does a similar thing using BKE_libblock_copy_data).
2012-10-28 17:09:50 +00:00
13af773398 Bugfix #32975
Shader nodes didn't redraw correct on preview-type changes.
Also made shader node previews draw nicely, without flashing empty images.
2012-10-26 11:29:30 +00:00
Lukas Toenne
09ed97afc5 Internal node links are now cached in a per-node list, instead of being generated as a transient list that is returned from the callback and had to be freed by the caller. These internal links are used for muted nodes, disconnect operators and reroute nodes, to effectively replace the node with direct input-to-output links.
Storing this list in the node has the advantage of requiring far fewer calls to the potentially expensive internal_connect callback. This was called on every node redraw ...

Also it will allow Cycles to properly use the internal links for muted nodes, which ensures consistent behavior. The previous method was not applicable in Cycles because transient list return values are not supported well in the RNA and particularly the C++ API implementation.
2012-10-25 16:49:06 +00:00
5aa6327e2f Cycles UI: keep node input sockets collapsed by default in the properties editor,
when doing the linking in the node editor, to keep the properties editor more
clean in this case.
2012-10-24 21:57:16 +00:00
0fb9b7beda Adding a pixelate node.
This makes it possible to create pixelized scale in the Tile compositor.

Just append the node in front of a scale node or where you want the pixelization to take place.

There were some bugs on this subject, but they used the work around to add a blur size of 0 in the place where they need the pixelization.
2012-10-24 08:36:10 +00:00
1767b65846 style cleanup: also rename bmesh_decimate.c --> bmesh_decimate_collapse.c 2012-10-23 03:38:26 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
92862f96dc code cleanup: use float sizes for function args. 2012-10-15 23:11:59 +00:00
fe09b24e86 Cycles: per-BSDF normal input and new Bump node.
Each BSDF node now has a Normal input, which can be used to set a custom normal
for the BSDF, for example if you want to have only bump on one of the layers in
a multilayer material.

The Bump node can be used to generate a normal from a scalar value, the same as
what happens when you connect a scalar value to the displacement output.

Documentation has been updated with the latest changes:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes

Patch by Agustin Benavidez, some implementation tweaks by me.
2012-10-10 15:56:43 +00:00
f0a9b66469 Cycles: Anisotropic BSDF enabled, with tangents now computed from the active UV map.
It's using the Ward BSDF currently, which has some energy loss so might be a bit
dark. More/better BSDF options can be implemented later.

Patch by Mike Farnsworth, some modifications by me. Currently it's not possible yet
to set a custom tangent, that will follow as part of per-bsdf normals patch.
2012-10-10 13:02:20 +00:00
Lukas Toenne
2a3c65169f Generalization of node dependency sorting, avoid using the sock->link pointer. This pointer only works for sockets that follow the standard 1-to-n connectivity (an output can be linked to multiple inputs, an input can only have one connection). Future node trees may implement 1-to-1 or n-to-1 linking. 2012-10-09 17:30:33 +00:00
f299813bfa Do not use nodeLabel() to generate new nodes' names, this is an UI func returning translated strings, which should never get into data. And it may generates dummy names in some situations (like all new Filter nodes were getting "Soften" as name (default option), better to always get "Filter" in this case!).
(Note for Lockal: also checked fcurves/drivers, but those names are directly taken from RNA prop name, hence they are as UI label, translated in the current language, but not stored in data. So no problem here ;) ).
2012-10-08 07:40:57 +00:00
916a58f4e0 fix [#32743] Freed memory access when freeing materials. 2012-10-03 07:35:29 +00:00
62c151bd1c freeing node trees no longer decreases their user counts, this cause causing invalid memory access when freeing the blend file. 2012-10-02 13:59:05 +00:00
adea12cb01 Cycles: merge of changes from tomato branch.
Regular rendering now works tiled, and supports save buffers to save memory
during render and cache render results.

Brick texture node by Thomas.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Brick_Texture

Image texture Blended Box Mapping.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Image_Texture
http://mango.blender.org/production/blended_box/

Various bug fixes by Sergey and Campbell.
* Fix for reading freed memory in some node setups.
* Fix incorrect memory read when synchronizing mesh motion.
* Fix crash appearing when direct light usage is different on different layers.
* Fix for vector pass gives wrong result in some circumstances.
* Fix for wrong resolution used for rendering Render Layer node.
* Option to cancel rendering when doing initial synchronization.
* No more texture limit when using CPU render.
* Many fixes for new tiled rendering.
2012-09-04 13:29:07 +00:00
aaafa0c2fe code cleanup: move file string defines into BLI_path_utils.h, BKE_utildefines is now unused but keep incase we want to add defines there later. 2012-09-03 22:04:14 +00:00
ed0489bb6e style cleanup: also spelling 2012-08-24 23:22:34 +00:00
65dbeabdc6 style cleanup: indentation, also quiet double promotion warnings for despeckle node. 2012-08-23 16:17:47 +00:00
1ab5a4f0ed despeckle composite node 2012-08-23 06:48:01 +00:00
2b9fd376e1 all areas of blender now do node tree id user count management, except for some exceptions like making a node tree local and material clipboard. 2012-08-22 09:35:46 +00:00
a4fd9f827b fix for bug where scene copy and free didn't manage ID users.
you could for eg, make a full copy of a scene, then manually remove its compo nodes - which would give invalid zero user count.
2012-08-22 09:10:16 +00:00
ffcc63a7d0 node tree functions for copy/free now support optional ID user count management,
this is not used yet, so no functional changes.
2012-08-22 08:54:18 +00:00
6c74d1147e minor cleanup to node pasting. 2012-08-20 13:59:19 +00:00
0f6a6c7499 fix for crash pasting nodes into a node tree when the ID pointer is lost.
also fix for ID user count on paste which wasn't increasing.
2012-08-20 13:51:25 +00:00
Lukas Toenne
f961afece0 Fix for incomplete Reroute node updates. Adding reroute nodes by spliting links would often result in unrelated color sockets or otherwise miss updates.
The reason is that the per-node updates used for Reroute node type inheritance are not supposed to be looking at connected nodes, they are purely for "local" updates. For this sort of "global" update which requires depth-first search, the update function on the node tree level must be used instead.
2012-08-06 18:49:28 +00:00
2b8ac9bc61 inpaint node from tomato branch by Peter Schlaile
http://en.wikipedia.org/wiki/Inpainting
2012-08-06 13:45:11 +00:00
4e2fb45576 style cleanup 2012-08-06 10:03:17 +00:00
df81b50bf2 prevent copy/paste from incompatible types (compo -> material for eg) - would crash instantly. 2012-08-06 08:41:45 +00:00
5bb97305a4 fix for node clipboard leak on exit, also use blenders convention for function naming with BKE clipboard funcs. 2012-08-06 08:25:24 +00:00
e592f757e8 fix for crash when moving frames about in the node space, was possible to move a node into its own child frame (causing recursive parent loop).
also some minor code cleanup.
2012-08-05 20:40:26 +00:00
Lukas Toenne
9d2173518c Clipboard feature for nodes. With the Copy operator a copy of all selected nodes and links between them is stored in an offscreen list (not in the library). The Paste operator then in turn copies these into the active node tree in the editor.
Currently does not support copying of animation data. This would require copying of individual fcurves etc. between data block, which is not implemented yet.

Also it is currently possible to circumvent some constraints of the nodes, in particular for node groups (e.g. no groups inside groups, render layer not inside groups).
2012-08-02 09:52:37 +00:00
e32c60284a style cleanup 2012-07-29 00:20:28 +00:00
5cc0e5f751 Mango request: added an input node to use track's position in compositor
--
svn merge -r48088:48089 -r48091:48092 ^/branches/soc-2011-tomato
2012-07-10 11:01:25 +00:00
24f672d57b fix for blender naming all new node groups "Missing Datablock" 2012-07-09 22:39:35 +00:00
b5135a8bdf fix for making local loosing references to node groups.
node->id was left as an indirect link which wont get saved with the file.
2012-07-05 12:50:50 +00:00
72e170d67a Implementation of node for track position input 2012-06-19 17:29:58 +00:00
265262a5d5 feather option for dilate/erode node - needed for alpha masks so we can (blur in/out), currently only positive values supported. 2012-06-16 13:46:20 +00:00
1f19bacf8e Kaying node from tomato branch
Merge keying node from tomato branch into trunk.

It was considered stable and helpful by Mango team and it'll help
studio pipeline, because nodes would stop disappearing when opening
files in current trunk.

Full information about keying nodes could be found there:
http://wiki.blender.org/index.php/User:Nazg-gul/Keying
2012-06-14 12:19:13 +00:00
d56e77ada5 Keying Screen node from tomato branch
Merge Keying Screen node developed in tomato branch into trunk.

This node is aimed to make dealing with non-even greenscreens better
by generating gradiented image which could be used a input for keyer
nodes.

Based on building voronoi diagram using motion tracking markers as
sites position and average pattern color as color for that site.

Pretty straignforward node, some documentation is there
http://wiki.blender.org/index.php/User:Nazg-gul/Keying#Screen_color
2012-06-14 12:18:42 +00:00
1a625d1416 code cleanup: use const float's where possible and specify vector size. 2012-06-12 23:19:52 +00:00
c945e03c75 rna read/write access to ...
node_tree.nodes.active
2012-06-11 18:43:48 +00:00