Commit Graph

273 Commits

Author SHA1 Message Date
Lukas Toenne
26b3dfa30e Automatically hide unused (=unlinked) node sockets in collapsed ("hidden") nodes. This is to make nodes with many sockets cleaner and simpler, which is the purpose of collapsing nodes in the first place.
The hiding code uses the SOCK_IN_USE flags already present. These were only temporarily set by the shader node code for determining needed texture coordinate types. Now they are used persistently and updated along with the sock->link pointers.
2011-12-19 12:04:05 +00:00
Dalai Felinto
2a6fdbcccd Cycles Gamma Node
Node specially useful for Texture correction.

This is also a nice example of a simple node made from scratch in case someone wants to create their custom nodes.
Review by Brecht.
2011-12-16 20:35:06 +00:00
6673c76e78 Muting node patch: second part. Also fix [#27636] Muting shading nodes is ignored
Now, compositing, shading and texture nodes have a consistent muting system, with default behaving as previous (for compo), and which can be optionaly customized by each node.
Shader nodes are also GLSL muted.

However, Cycles is currently unaware of muted nodes, will try to address this…
2011-11-20 16:38:23 +00:00
bbf8315313 Tag unused variable in recent nodes commit. 2011-11-20 16:26:42 +00:00
ca7d391de8 Muting node patch: first part
This allows node type init code to have access to the nodetree type object (needed to allow generic muting node initialization). Huge and boring edits...
2011-11-20 16:13:27 +00:00
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
28ee0f9218 Texturing: texture and 3d view draw type changes, these should only have any
effect for a render engine using new shading nodes. In short:

* No longer uses images assigned to faces in the uv layer, rather the active
  image texture node is what is edited/painted/drawn.
* Textured draw type now shows the active image texture node, with solid
  lighting.
* Material draw mode shows GLSL shader of a simplified material node tree,
  using solid lighting.
* Textures for modifiers, brushes, etc, are now available from a dropdown in
  the texture tab in the properties editor. These do not use new shading nodes
  yet.

http://wiki.blender.org/index.php/Dev:2.6/Source/Render/TextureWorkflow
2011-11-08 13:07:16 +00:00
db75cc4cde Nodes: add cycles shader nodes, these will only be available to render engines
that use the new shading nodes system. Documentation:

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes
2011-11-08 11:38:16 +00:00
7b43abb90e Camera tracking integration
===========================

Rest of changes from camera tracking gsoc project.

This commit includes:

- New compositor nodes:
  * Movie Clip input node
  * Movie Undistortion node
  * Transformation node
  * 2D stabilization node

- Slight changes in existing node to prevent code duplication
2011-11-07 12:56:05 +00:00
bb8fe0bf4a minor edits
- remove unneeded type check from convert grease pencil operator.
- correct some error prints & use __func__.
- make copy_libblock take an ID* argument rather than void*.
2011-11-07 04:36:37 +00:00
1f291a69c1 correct spelling mistakes 2011-11-03 03:00:45 +00:00
ac52c79cb1 RenderEngine/Nodes: system to check for shading nodes compatibility
* Scene.use_shading_nodes property to check if RenderEngine is using new shading
  nodes system, and RenderEngine.bl_use_shading_nodes to set this.
* Add mechanism for tagging nodes as being compatible with the old/new system.
2011-11-02 19:24:30 +00:00
a267f9ba4e edits ontop of Alex's patch from r41292.
pass main rather than use G.main when naming from -> to relative paths.
2011-10-26 21:22:35 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
5cf593a778 strcpy() --> BLI_strncpy(), where source strings are not fixed and target size is known. 2011-10-19 23:10:54 +00:00
Lukas Toenne
0d7bd0f9b6 Adds an update flag to the bNode struct (similar to bNodeTree->update).
This prevents access to non-existent typeinfo during type initialization,
when node types have been removed and such nodes are deleted from older files.
All blenkernel functions now only set the node->update flag instead of directly
calling the update function.  All operators, etc. calling blenkernel functions
to modify nodes should make a ntreeUpdate call afterward (they already did that
anyway).

Editor/RNA/renderer/etc. high-level functions still can do immediate updates by
using nodeUpdate and nodeUpdateID (replacing NodeTagChanged/NodeTagIDChanged
respectively). These old functions were previously used only for setting
compositor node needexec flags and clearing cached data, but have become generic
update functions that require type-specific functionality (i.e. a valid typeinfo
struct).
2011-10-19 17:08:35 +00:00
58587a3881 replace strncpy with BLI_strncpy, in some cases strncpy was being misused since it doesnt ensure \0 termination.
also dont call CTX_data_scene() twice when checking for function arguments.
2011-09-26 18:51:10 +00:00
84d06f252e tag & comment unused vars with /* UNUSED */ 2011-09-20 08:48:48 +00:00
2222f536f8 use replace 0 with NULL for pointers, set some functions static
also fixed own errors in recent static check commit.
2011-09-16 08:20:21 +00:00
Lukas Toenne
7db716599c Fix for crash when duplicating image or render layer nodes.
These nodes use cached buffers (in sock->cache), which need to be cleared when duplicating the node, otherwise the buffer will be freed twice.
2011-09-07 12:46:30 +00:00
53671577a4 Fixed potential crash in NodeTagIDChanged. Discovered after merge trunk
into tomato where there were no check for tree before calling this function.
Old design worked fine with this.

Mark some arguments as UNUSED.
2011-09-06 18:15:34 +00:00
decc2c2e77 Node merge: fix crash loading files with unknown nodes (e.g. cycles files). 2011-09-06 17:34:56 +00:00
Lukas Toenne
884fc84793 Fix for multiple parallel group node executions.
This would previously break because begin/end functions for each tree type still have some checks of the ntree->execdata pointer in them, despite the intended use of execdata instances instead of trees themselves for execution data storage. This is an artifact of the old execution system that required these checks to be made in the functions to avoid multiple execution of top-level trees. Now these functions take an additional argument, so group nodes can prevent them from setting and checking the nodetree->execdata pointers.
2011-09-06 16:32:51 +00:00
0991bed413 fix some complier warnings and add -Wundef to CMake's default GCC warnings. 2011-09-05 23:40:52 +00:00
Lukas Toenne
8e0fe8bff7 Merged the particles-2010 branch with node improvements into trunk.
This branch adds mostly organizational improvements to the node system by renaming the node folders and files. A couple of internal features have been added too.
Detailed information can be found on the wiki page:

http://wiki.blender.org/index.php/User:Phonybone/Particles2010
2011-09-05 21:01:50 +00:00
540f0c64b5 add in asserts for when array/non array RNA funcions are used incorrectly, would have made previous fix a lot easier to find.
also remove unused argument from RNA_property_array_check.
2011-08-14 10:28:18 +00:00
de10ffab75 Bugfix #27761
Material nodes: when no output node was active, it sets one.
Not common to happen anymore, only for deleting output nodes
without clicking on nodes.
2011-07-09 17:03:35 +00:00
830fe8af84 Updated the indent, sorry! 2011-07-04 19:22:37 +00:00
c4491f558b Current situation
A mesh can consist out of multiple material. Take a character with clothing's. the skin can be a different material as the different clothing's. During compositing it is a common use-case to only do a part of the composit on only a specific material. Currently this can not be done.

In blender movies this feature is known to be implemented, but until now it never got integrated into trunk.
Proposal

With material index the Blender internal renderer will be capable of creating a buffer containing the material indexes of the first pixel-hit. This will be implemented in the same manner as the object index.

In the compositor the ID Mask node can be used to extract the information out of the Render pass.
Impact
User interface

On the properties-space the next changes will be done

    Scene⇒Render layer⇒Passes⇒Material index will be added
    Material⇒Options⇒Pass index will be added

DNA

    Material struct will get an new field called “index”. this will be a short-type.
    Material struct the field pad will be removed.
    A new Render-layer pass will be added (bit 1«18)

RNA

    Material RNA is updated (based on “pass index” from object)
    Render layer RNA is updated (based on IndexOB)

Blender internal renderer

The Blender internal renderer will process the render pass as a copy of the Object index.
Blender compositor

The render layer input will get a new output socket called “IndexMA”
Usage

An example on how to use material index can be found at:

https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests/compositing/composite_materialindex.blend

This is also example of a commit message longer than the commit itself :)
2011-07-04 18:14:41 +00:00
8eb375048e removing python includes for blenkernel since pynodes are commented. 2011-06-19 09:32:37 +00:00
83609edd51 Fix related to #27309: group nodes with a linked datablock that was missing would crash. 2011-06-02 17:34:01 +00:00
3986896500 copying/freeing node trees now adjusts grease pencil user count.
also NULL freed texture node socket data incase its used again by accident.
2011-05-02 08:37:44 +00:00
Lukas Toenne
5c4743b9ee Another fix for node groups: Internal socket stack did not get complete initialization of the sockettype value, leading to wrong b/w outputs. 2011-04-24 05:13:35 +00:00
176e45f88e fix for possible (but unlikely) crash.
added NULL check in case nodeAddNodeType() is given an invalid type or the dynamic node cant be found.
2011-04-23 08:02:29 +00:00
Lukas Toenne
6b4cecc466 Fix for group output memory leak, bug #27104. This happens when an internal node in a group has multiple output buffers, but only some of them are used. Then all the buffers would be created, but the unlinked outputs were not correctly tagged for freeing after group execution. 2011-04-23 07:21:10 +00:00
Lukas Toenne
a6c2d8680b Internal need_exec tagging for group nodes, fixes #27034. Non-compositor node trees (texture and material) only use the need_exec flag to exclude cyclic dependencies, ugly double use of that flag. Oh well, hopefully can replace this altogether one day ;) 2011-04-20 20:31:43 +00:00
Lukas Toenne
6cb761f10c Corrected updating inside edited groups, fix for #27018. This was caused by edit updates being restricted to the actual node. Edit functions now should use the generic snode_tag_changed, which also updates all instances of the currently edited group. 2011-04-19 15:15:50 +00:00
69bd72c3b6 quiet gcc float -> double promotion warnings. 2011-04-02 02:08:33 +00:00
Lukas Toenne
05b2a75bfe Group tree sockets were not being freed after removing. 2011-03-13 22:13:42 +00:00
Lukas Toenne
24f72abf67 Fix for crashes due to links without fromnode pointers. This can happen with "unfinished" links created during the modal linking operator or when creating links from group tree inputs.
In addition don't store unfinished links in the nodetree->links list any more. This makes code a bit safer because all links in that list can be considered valid now. The temporary bNodeLinkDrag structs used by the modal linking operator are now also stored in a list in SpaceNode, so these links can be drawn too (this separation also allows different display of temporary links, e.g. currently they are drawn on top of all nodes).
2011-03-13 22:07:55 +00:00
Lukas Toenne
2907826d8c Fixed the node_recurs_check function used to define the order of nodes in ntreeSolveOrder. This was creating equal node levels in some cases (auto-linking viewer to nodes further downstream), leading to falsely detected circular dependencies. 2011-03-13 17:23:44 +00:00
efc697b481 Bugfix #26443
Node compositor crash:
When you very quickly unlink a socket *right* after connecting it
(within 0.1 second), the compositor started with a noodle without
valid connections, which was not foreseen to happen.
2011-03-10 18:17:20 +00:00
daff7a447e Bugfix #26388
Actually a todo item I forgot:

Material nodes previews now follow the scene "color managenent"
setting.
2011-03-07 11:51:09 +00:00
7fb14d9138 Bugfix #26367
Previous fix I did to make texture-node-paint work, accidentally
cleared tags for compositing nodes to be done while editing.
2011-03-05 17:04:30 +00:00
24fa1d1f04 Two additional fixes for node-tree + texture paint:
- "need exec" flag was cleared in wrong tree for preview renders
  (it should clear it in the copy, i did in original).
  This fixes projection paint on images with previews open
- Previews for nodes were copied always, now only for previews 
  invoked by node editor itself.
2011-03-04 12:59:09 +00:00
18afcbcb7d bugfix #26267
ImageWindow + 3D view texture paint + texture preview render + texture nodes.
Threading hell! But it works now :)
2011-03-03 18:53:07 +00:00
Nathan Letwory
0ff06e21cd doxygen: blender/blenkernel tagged. 2011-02-27 20:40:57 +00:00
38bd8dcf05 Bugfix #26221
Two bugs in one:

- Lukas commit monday for new group/socket handling accidentally removed
  to set socketype in stacks, which as used by (texture) nodes to detect
  whether value, color or vector had to be read.
  Result was that all texture nodes were rendering as B&W

- Old 2.5 bug: preview renders for texture nodes didn't call a 
  NodeEndExec function, which gave crashes on deleting nodes.

The change in interface_hanlers.c is only a comment to explain
how keymaps are being found.
2011-02-26 13:53:15 +00:00
09e8a8222c needed for building without python 2011-02-25 11:25:11 +00:00
Lukas Toenne
04d04f6401 Fixed memory leak in group nodes. Only buffers from exposed sockets should remain after group execution. 2011-02-24 15:48:09 +00:00