Commit Graph

6763 Commits

Author SHA1 Message Date
Thomas Dinges
e04b7dc209 Node Toolbar:
* Use column() layout, this way it uses a bit less space.
2013-04-14 09:17:03 +00:00
Thomas Dinges
7e1352ba7c Code cleanup:
* Remove obsolete comment from layout file.
2013-04-13 23:06:33 +00:00
Thomas Dinges
98f78fde23 Code cleanup / Layout script:
* Never ever use something like "rowsub" as variable.
2013-04-13 22:52:28 +00:00
Campbell Barton
7c4be99281 make buttons for edge/face area, length, angles etc. more compact. 2013-04-13 22:29:58 +00:00
Campbell Barton
dffbbe65cd remove checks for 'context.scene' when checking if freestyle is enabled. 2013-04-13 22:21:21 +00:00
Campbell Barton
a298cac952 show weight-display options in editmode. 2013-04-13 22:12:55 +00:00
Campbell Barton
31c375b97a Mesh Drawing:
Option to draw mesh vertex-weights in editmode, available from the 'Mesh Display' panel.

TODO: get this to work when modifiers are applied in solid mode (texface-solidmode is working).
2013-04-13 20:20:21 +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
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
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
Bastien Montagne
0e4b092c2d More fixes for addon i18n messages management. 2013-04-12 12:19:50 +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
Sergey Sharybin
daaca80664 Hide preview for nodes created with Setup Tracking Scene 2013-04-11 13:34:51 +00:00
Sergey Sharybin
432a260869 Setup tracking scene shall work with Cycles now 2013-04-11 13:29:51 +00:00
Konrad Kleine
f2ff494b24 Added circle selection menu entry for lattice, pose and armature. 2013-04-11 13:29:01 +00:00
Sergey Sharybin
c6606986cc Fix for Setup Tracking Scene operator
- Ported to new node add operator
- Alpha mode shall be set to Transparent
2013-04-11 13:25:05 +00:00
Campbell Barton
2c6a82dd0a py api: minor change to operator attribute access, do identity comparison with None (no functional change). 2013-04-11 10:16:18 +00:00
Campbell Barton
577a1b9239 fix [#34805] Bake action ignores parent motion
in fact this is more feature request.
add an option to bake a parented objects animation, then clear the parent and apply the action.
2013-04-11 08:42:25 +00:00
Thomas Dinges
d7f56d85c2 * Better tooltip for WM_OT_properties_context_change. 2013-04-10 20:36:22 +00:00
Tamito Kajiyama
384e14bc84 Added to the Freestyle panel in the Render buttons a button to switch to the Render Layers context. 2013-04-10 20:20:20 +00:00
Jens Verwiebe
cbe9ae244e Add a gui control for setting omp threads in fluids 2013-04-10 18:35:18 +00:00
Jens Verwiebe
367de67889 OSX: remove the applescript and env var for omp_set_treads from plist 2013-04-10 15:22:39 +00:00
Campbell Barton
791815c9d4 py api: path_reference_copy() use try/except when copying images, can fail for odd reasons (currently fails if the dest dir is a symlink and not using expected permissions). 2013-04-10 12:16:27 +00:00
Campbell Barton
44a661e6a8 py api: simple function to get an image from an objects for simple formats that only support one image per object. 2013-04-10 11:43:25 +00:00
Thomas Dinges
a963e7ae42 Code cleanup. 2013-04-10 02:58:22 +00:00
Tamito Kajiyama
0fe1616e13 Fix for [#34934] Freestyle options are in wrong tab.
Added a label to guide users to line style settings in the Render Layers context
(in line with the similar labels found in the Cloth and Soft Body modifier panels),
so that Freestyle options per render layer can be more easily found.
2013-04-09 23:54:11 +00:00
Bastien Montagne
6382f6bedd Various edits preparing addons' translations tools (not everything yet functionnal/tested, though).
Also workaround a nasty bug, where unregistered py classes remain listed in relevant __subclasses__() calls, which would lead to crash with python addons i18n tools (main translation was not affected, as messages extracting tools are executed in a brand new "factory startup" Blender ;) ).
2013-04-09 08:56:35 +00:00
Antony Riakiotakis
32c1314d28 Texture tools robustness:
* Pressing x or y to scale overlay immediately presents visual feedback
instead of requiring mouse motion
* Hide the ovelay icon when stencil is active since you can't deactivate
then.
2013-04-08 15:42:13 +00:00
Campbell Barton
b14f68521e select-camera operator could select hidden cameras, also disable freestyle for make lite target. 2013-04-08 04:54:57 +00:00
Thomas Dinges
279a2796ba Fix for [#34901] "Add SSS Preset" gives error.
* Mark Preset operator as 'Internal' only, so it does not show up inside the search menu. We cannot be sure if we meet the context requirements otherwise (unless we add a poll to each subclass).
2013-04-07 15:18:12 +00:00
Thomas Dinges
858ff6b696 Fix for [#34898] Typo in error message of mathutils.Vector
* Also fixed some more cases of "more then" -> "more than".
2013-04-07 15:09:06 +00:00
Campbell Barton
eb495b2a8a use lowercase name for freestyle module (as with all other blender modules). 2013-04-07 11:22:54 +00:00
Thomas Dinges
551f0fa091 Freestyle UI:
* Remove "Unit" prefix from line thickness property. (discussed with Tamito in IRC)
2013-04-07 10:23:48 +00:00
Bastien Montagne
4a66bf8f4a Usual typo fixes... ;) 2013-04-07 10:21:22 +00:00
Thomas Dinges
0edbcd4cf9 Freestyle UI / Code cleanup:
* Do not share poll with other files, create own poll classes. 
* Avoid some splits() and use rows instead (less code).
* Remove some commented C code.
* layout = self.layout declarations come before variable declarations.
2013-04-07 10:10:00 +00:00
Tamito Kajiyama
bcf2ee7399 Recovered factory settings for Freestyle. 2013-04-07 09:25:28 +00:00
Campbell Barton
63d523336f freestyle lineset tag attribute was defined but not used, also some code cleanup. 2013-04-07 01:38:03 +00:00
Thomas Dinges
ef57e50acf Code cleanup:
* Remove commented C code from properties_render_layer.py
2013-04-06 23:08:06 +00:00
Thomas Dinges
9c117ba54e Properties Editor / Render Layers:
* Cycles Render layers UI was broken after freestyle merge (changes were not merged). Did manual edits now with some tweaks.
* Some layout fixes for Mask Layer.
2013-04-06 23:05:32 +00:00
Tamito Kajiyama
464a149b21 Part I of the Freestyle branch merger: new 'freestyle' folders.
This commit is the first part of a two-part merger of the soc-2008-mxcurioni
(Freestyle) branch.  New 'freestyle' folders were added to the source/blender/
and release/script/ directories through a couple of svn copy operations
(instead of svn merge, due to broken svn:mergeinfo properties of the branch).
2013-04-06 15:45:02 +00:00
Sergey Sharybin
acfc0ea511 svn merge ^/trunk/blender -r55815:55840 2013-04-06 13:24:34 +00:00
Gaia Clary
2d76a828ca Fix: 34874 Weight Paint UI inconsistent: removed conflicting shortcut definition, added weight assign tools to specials menu 2013-04-06 10:52:52 +00:00
Tamito Kajiyama
72d0cc1f61 Minor white space fix. 2013-04-06 07:53:57 +00:00
Campbell Barton
1d5f988778 patch [#34890] BMesh Poke Face.
by Francisco De La Cruz (xercesblue), with some of my own changes/improvements.

Converts faces to triangle-fans (useful to run on ngons).

To access select a group of faces and press "Alt+P" or alternatively select the operator from the Faces menu (Ctrl+F)
2013-04-06 02:45:43 +00:00
Campbell Barton
89926a0598 svn merge ^/trunk/blender -r55776:55813 2013-04-05 15:42:31 +00:00
Antony Riakiotakis
5ad071633f Stencil dimension control:
* Shift-Rclick and holding right click, x or y will trigger constrained
scaling of overlay. Pressing again will revert to uniform scaling.
* Added operator, visible under the mapping drop menu, to fit stencil
aspect ratio to brush image aspect ratio.
* Made it possible to access stencil attributes from python as vec.x,
vec.y. Thanks to kgeogeo for pointing out!
2013-04-05 13:00:16 +00:00
Campbell Barton
98752a1f30 py api additions needed for fixing [#34864].
- add rna property 'as_bytes' method so you can get a string property as python bytes (bypass encoding).
- make bpy.path.abspath/relpath compatible with bytes.
- add 'relpath' option to bpy_extras.image_utils.load_image(), so you can load an image relative to a path.
2013-04-05 00:30:32 +00:00