Commit Graph

47061 Commits

Author SHA1 Message Date
Campbell Barton
4d1e8cec1a code cleanup: editmesh draw functions, make face drawing more consistent. 2013-04-13 17:57:11 +00:00
Lukas Toenne
dfeddd3549 Node editor: create the toolbar area right at the start in node space, in order to show the '+' icon for expanding. 2013-04-13 17:36:31 +00:00
Thomas Dinges
a646f505c3 Node UI:
* Now that the toolbar is useful, add menu entry into the "View" menu.
2013-04-13 16:32:28 +00:00
Antony Riakiotakis
15f3bbfe9e Fix some compilation errors for MinGW. Thanks to vildas on irc for
bringing this to attention.
2013-04-13 16:29:18 +00:00
Bastien Montagne
649b92e688 Fix: uiBlockSetNFunc was using uiButHandleFunc as param signature, instead of uiButHandleNFunc one (was working because both are the same currently). 2013-04-13 16:28:39 +00:00
Thomas Dinges
ceacf24e3d Node Toolbar:
* Have panels closed by default.
2013-04-13 16:26:55 +00:00
Thomas Dinges
50e7e34520 Node categories / Add menu:
* Fix for Subsurface Scattering node.
2013-04-13 15:51:25 +00:00
Lukas Toenne
94931f9f45 Replacing the node Add menu and making the toolbar useful
As some people have already noticed, the "Add" menu for nodes is a bit messy since pynodes merge. The reason for this is that the order of nodes in submenus (categories) was previously defined by the order in which all nodes are registered (at the bottom of blenkernel/intern/node.c). For the dynamic registration of node types now possible this system of defining node order along with registration is no longer viable: while it would still sort of work for C nodes, it is completely meaningless for dynamic (python) nodes, which are basically registered automatically in whatever order modules and addons are loaded, with the added complexity of unloading and reloading.

To fix this problem and add a bunch of desirable features this commit replaces the C menu with a python implementation. The new menu does not rely on any particular order of types in the node registry, but instead uses a simple explicit list of all the available nodes, grouped by categories (in scripts/nodeitems_builtins.py).

There are a number of additional features that become possible with this implementation:

1) Node Toolbar can be populated!
The list of nodes is used to create 2 UI items for each node: 1 entry in a submenu of "Add" menu and 1 item in a node toolbar panel with basically the same functionality. Clicking a button in the toolbar will add a new node of this type, just like selecting an item in the menu. The toolbar has the advantage of having collapsible panels for each category, so users can decide if they don't need certain nodes categories and have the rest more easily accessible.

2) Each node item is a true operator call.
The old Add menu is a pretty old piece of C code which doesn't even use proper operator buttons. Now there is a generic node_add operator which can be used very flexibly for adding any of the available nodes.

3) Node Items support additional settings.
Each "NodeItem" consists of the basic node type plus an optional list of initial settings that shall be applied to a new instance. This gives additional flexibility for creating variants of the same node or for defining preferred initial settings. E.g. it has been requested to disable previews for all nodes except inputs, this would be simple change in the py code and much less intrusive than in C.

4) Node items can be generated with a function.
A callback can be used in any category instead of the fixed list, which generates a set of items based on the context (much like dynamic enum items in bpy.props). Originally this was implemented for group nodes, because these nodes only make sense when linked to a node tree from the library data. This principle could come in handy for a number of other nodes, e.g. Image nodes could provide a similar list of node variants based on images in the library - no need to first add node, then select an image.

WARNING: pynodes scripters will have to rework their "draw_add_menu" callback in node tree types, this has been removed now! It was already pretty redundant, since one can add draw functions to the Add menu just like for any other menu. In the future i'd like to improve the categories system further so scripters can use it for custom node systems too, for now just make a draw callback and attach it to the Add menu.
2013-04-13 15:38:02 +00:00
Ton Roosendaal
a710434f56 Usability fix, own collection.
If you have two windows, each with different scene, the render output for a window
would go to the other, if it was already drawing a render for the other scene.

Now you can have renders draw correct in two windows for two scenes.
2013-04-13 15:14:34 +00:00
Campbell Barton
2baa59e36d code cleanup: remove unused string formatting in bli_adddirstrings(), also remove unused initializations and comment unused vars. 2013-04-13 14:57:08 +00:00
Ton Roosendaal
53bb59f209 Accidentally left in test function. All's fine now! 2013-04-13 14:15:16 +00:00
Antony Riakiotakis
9e8047d37b Fix compilation, ifdef test_file just in case it is useful for later. 2013-04-13 14:05:31 +00:00
Thomas Dinges
84071fbf0a Cycles / Save Buffers:
* Save Buffers could not be disabled in the UI, when "Full Sample" was enabled in Blender Internal.
2013-04-13 12:49:22 +00:00
Ton Roosendaal
d867cefa32 Bug fix #34896
The feature "Keep Session" was also loading that session when you double-click
on a .blend to open it, or when a .blend file was on commandline.

Moved this feature to the main() in creator.c, so it can check on it properly, skipping the
kept session when a file was loaded.
2013-04-13 12:03:20 +00:00
Gaia Clary
9eea6c7057 improved tooltips even more (as discussed in IRC) 2013-04-13 09:32:27 +00:00
Thomas Dinges
6f9495fc29 Fix for [#34968] Cross compiling from linux for windows is broken
* Patch by Martijn Berger (juicyfruit).
2013-04-13 09:28:07 +00:00
Gaia Clary
f181952a28 improved tooltips 2013-04-13 09:27:03 +00:00
Antony Riakiotakis
fb9d88692d Add update to brush texture preview when brush is changed. Solves
cycling through tools with number or tool keys and no texture preview
getting updated.
2013-04-13 08:41:52 +00:00
Campbell Barton
2c47244954 code cleanup: use const char for args and replace wm_keyconfig_list_find() -> BLI_findstring() 2013-04-13 04:28:04 +00:00
Campbell Barton
2f9b7410dc code cleanup: warnings + style 2013-04-13 00:43:49 +00:00
Antony Riakiotakis
7cf1d86e4a Allow rake/random brush rotation for random mapping mode. Some
interesting things can be accomplished this way, such as tiger stripes
for instance.
2013-04-12 23:55:11 +00:00
Antony Riakiotakis
9d0b08365f Fixes:
* Overlay invalidation did not happen when changing brush, .either
through UI or through shortcuts
* Add initiliazation of curves before threaded overlay texture
evaluation or we may get memory leaks due to race conditions.
2013-04-12 21:58:18 +00:00
Antony Riakiotakis
a074df37c7 oversight on scons, this should fix. 2013-04-12 17:59:38 +00:00
Antony Riakiotakis
d0beabb642 Add function to query maximum texture size. Also, make texture upload
functions aware of this limit.
2013-04-12 17:56:07 +00:00
Antony Riakiotakis
a305452275 Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:

Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:

These attributes/aspects are:

Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)

Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.

Properties that affect this are:

Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.

These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
Antony Riakiotakis
8f658d4264 Add property update for radial control operator. It will be necessary
for upcoming overlay refresh commit, but since that commit is becoming
too big, better have this separate to avoid getting this lost in the
noise.
2013-04-12 15:45:44 +00:00
Lukas Toenne
58d211acdd Fix for user count when adding a new library node tree. This needs to decrease user count by 1 to compensate for increment in RNA_property_pointer_set. 2013-04-12 15:42:16 +00:00
Brecht Van Lommel
55ac53fcde Fix #34322: cycles crash with (undo) save during threaded render. The mesh save
code was modifying pointers in the Mesh which gave crashes with another thread
accessing the data at the same time. This could crash other threaded operations
like blender internal render or physics baking too but was less likely.

As a solution I've now changed the save code that it does not modify the mesh
data structure in place but rather a copy, as undo file saving should probably
be fully read-only regardless of how an improved threading architecture might
work.

Thanks to Sergey for tracking down the cause of this crash.
2013-04-12 15:33:09 +00:00
Brecht Van Lommel
22230ced41 Fix #34961: camera fly mode would reset camera scale. 2013-04-12 14:25:08 +00:00
Sergey Sharybin
27097d1373 Blender is compilable with strict compiler flags again 2013-04-12 13:01:50 +00:00
Ton Roosendaal
adb96478a7 Adding scrollbar default to Python console and Python Info log. 2013-04-12 12:30:05 +00:00
Bastien Montagne
0e4b092c2d More fixes for addon i18n messages management. 2013-04-12 12:19:50 +00:00
Lukas Toenne
c83925599a Added 'move' functions to the inputs and outputs node socket collections (similar to move function in CollectionProperty). This is useful to change the socket order in pynodes. Otherwise one would have to remember socket values and links, remove a socket, insert a new one and copy back these values, which is tedious and error prone. 2013-04-12 12:19:22 +00:00
Campbell Barton
e8474d64f8 minor edit to bake printouts which could get mixed because of \r. 2013-04-12 12:03:56 +00:00
Lukas Toenne
09a82f413d Removed a lot of now-unnecessary checks from node RNA. The typeinfo pointers in bNodeTree, bNode and bNodeSocket are now always pointing to valid type structs. If a tree, node or socket has an unknown type at load time it will be pointed to a dummy "UndefinedType" struct instead, which has default settings and allows for nice debugging. Checking if node->typeinfo etc. is NULL is not necessary any more, makes code a lot easier and smaller. 2013-04-12 11:43:21 +00:00
Sergey Sharybin
0d86c3f84c Image draw method option
This option replaces previously added GPU limit
option, which became tricky to follow after GLSL
display space conversion.

There're 4 modes available:
- AUTO which will try to guess which mode is
  best to use.
  Currently It'll try using GLSL and if it fails,
  will fallback to 2D textures.
  Probably it'll make sense checking on whether
  2D textures works well but currently such behavior
  shall be sufficient.
  Later we could make this method smarter (for example
  don't try to use GLSL on certain GPU or so).
- GLSL will currently behave the same way as AUTO,
  but it is intended to always try using GLSL
  (unless it can not be used because of existing
  limitation of dither and RGB curves).
- 2D Textures will use CPU-based color space conversion
  and use OGL 2D Texture to display the image.
  Image will be displayed in tiles, so there shall be
  no big GPU memory consumption.
- DrawPixels will straightly fallback to glDrawPixels
  without trying to use any fancy GPU stuff.

Hopefully this will also fix
#34943: Blender crashes when resizing the Compositing Screen Window
2013-04-12 10:52:47 +00:00
Campbell Barton
677a96e189 add render slot cycle forward/backwards menu items. 2013-04-12 10:19:31 +00:00
Lukas Toenne
be35762950 Made the update callback in bNodeTree registerable in RNA, this was still missing for pynodes. This update callback can be used for "global" updates of the node tree as a whole, as opposed to "local" updates of individual nodes. Any kind of update that takes node connections into account (such as dependency sorting) and does not just work on a single node should be done in the nodetree.update function rather than node.update. 2013-04-12 08:43:08 +00:00
Lukas Toenne
048df1a07c Small change to the node space RNA function for opening a node group: pass the node tree as explicit argument plus an optional group node, instead of trying to get the node tree from a node property. This is more flexible for future nodes that want to change the node editor. Node group operators can rely on group node types, but the generic RNA functions should not. 2013-04-12 07:35:49 +00:00
Campbell Barton
ba845f6313 fix for own recent addition of transform indervidual-axis in editmode, not working if the object was rotated. 2013-04-12 02:16:44 +00:00
Dalai Felinto
1c80388a73 bge fix: framing mode "Expanded" not updated when resizing blenderplayer
now, with a 'resize' routine for the engine we can/should also recreate some
buffers that are created only at init time (e.g., 2d filters, dome fbos, ...).

This bug was always present in Blender (since 2.49 at least).

Bugfix supported by NF-UBC Nereus Program as part of the development
of OceanViz/NereusViz
2013-04-12 01:52:30 +00:00
Campbell Barton
502ddd3128 code cleanup: warnings and style. 2013-04-12 00:50:40 +00:00
Brecht Van Lommel
742c1cb328 Related to #34558: clarify the description for the "default" parameter in bpy.props.EnumProperty. 2013-04-11 18:10:57 +00:00
Jens Verwiebe
bd07cac232 Correct stub for snapObjectsRayEx 2013-04-11 15:40:57 +00:00
Jens Verwiebe
f8293b8068 Add stub for snapObjectsRayEx 2013-04-11 15:35:16 +00:00
Jens Verwiebe
8128444bad Add stub for snapObjectsRayEx 2013-04-11 15:33:10 +00:00
Thomas Dinges
e835863254 And another compile fix for Windows / scons for r55946. 2013-04-11 15:33:04 +00:00
Thomas Dinges
38cf856ea9 Compile fix for r55970. 2013-04-11 15:21:03 +00:00
Brecht Van Lommel
120fe74ffe Fix #34817: improve OpenGL preview render speed, it got quite a bit slower since 2.60.
Doing linearization with GLSL was already faster, but even faster is to just read the
bytes instead of floats and convert those to linear, since byte => float is just a quick
256 entry table lookup. Also made it assign the bytes directly to the image buffer so
they do not need to be converted back from float to byte for file saving, and made sky
render write the background color with OpenGL instead of doing it on the CPU.
2013-04-11 15:15:06 +00:00
Brecht Van Lommel
7164596891 Fix #34956: rendering animation with audio would crash with an older ffmpeg
after recent changes.

New ffmpeg versions accept align = 0 as a parameter and will set it to 1
automatically, but older ones need to pass align = 1.
2013-04-11 14:46:41 +00:00