code cleanup: use booleans for mesh and selection code.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55429 954f8c5b-7b00-dc11-b283-0030488c597c
UI Tweak: "Add to Group" button creates new group if no groups exist

Previously, the "Add to Group" button would show an empty search popup when there were no existing groups. While this does mean that the button behaves differently at different times, this way is more streamlined and should be less confusing than seeing an empty search popup or a greyed out "add to group" button or a "+" button which jumps around in different situations.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55435 954f8c5b-7b00-dc11-b283-0030488c597c
Fix for bug reported on bf-committers: RNA function nodetree.links.new does not remove existing links when connecting to a linked input. The check for socket connection limits was 1 off, needs to add 1 to the link counter to anticipate the newly added link.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55436 954f8c5b-7b00-dc11-b283-0030488c597c
Fix for compositor bug introduced in pynodes branch by removing the default MuteNode for unspecified nodes in the COM_Converter. Not sure why i removed this in the first place, but it means that reroute nodes are not properly replaced in composites. It worked for preview and viewer composite because the reroute nodes are replaced there already by the node tree localization ... this needs to be cleaned up.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55437 954f8c5b-7b00-dc11-b283-0030488c597c
Make Blender compile again normal again with gcc 4.2

-Wredundant-decls is giving 1000s of lines of warnings for every file...





git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55438 954f8c5b-7b00-dc11-b283-0030488c597c
Add a license document for i18n monospace font.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55439 954f8c5b-7b00-dc11-b283-0030488c597c
Fix for #34708 and #34709, cycles group nodes were not working well with 0 or 2+ group input/output nodes.

The issue here was that the proxy nodes created for connecting extern group node sockets to the internal nodes were generated by the input/output nodes themselves.

0 input/output nodes: there would be no proxy that external group node sockets can map to
2+ input/output nodes: additional nodes would overwrite entries from previous nodes, so that only one of the input/output nodes would be used.

Solution is to always generate exactly 1 proxy node for every group socket in advance, regardless of whether it is used internally. Internal node sockets can then all map to this proxy node.

In the case out output nodes there should only ever be one active node, otherwise the connection to the proxy would be ambiguous. For this purpose the NODE_DO_OUTPUT flag has been exposed to RNA, so that cycles can check it and only use the active output.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55440 954f8c5b-7b00-dc11-b283-0030488c597c
add back -Wredundant-decls, just not for older gcc's


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55441 954f8c5b-7b00-dc11-b283-0030488c597c
When making a node group always add one input and one output node, regardless of whether there are any exposed sockets. The standard common case is that some sockets will eventually have to be exposed anyway, and it's easier to just delete the unused node instead of having to look it up in the menu.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55442 954f8c5b-7b00-dc11-b283-0030488c597c
add option to convert grease pencil into poly line directly.

Without this, bezier curves at 12 resolution are very high detail for many tasks when converted from freehand strokes.
so add the option to convert 1:1 grease pencil points to curve polygons.

also add use_handles option to curve conversion which is used when converting beziers to poly lines.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55443 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #34694. This was actually a bug in the compositor's Bokeh Blur operation. It was writing outside of allocated memory in case of (0, 0) size buffers, with the usual unpredictable results.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55444 954f8c5b-7b00-dc11-b283-0030488c597c
- add knife project to toolbar.
- when running knife project, disable vertex selection since it may select areas between the newly cut regions.
  add EDBM_selectmode_disable() function since loopcut does this too.
- (optimization) avoid looping over all geometry when flushing and no selection exists.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55445 954f8c5b-7b00-dc11-b283-0030488c597c
Small fix: make node backdrop draw with nearest-pixel filter, so it zooms in 
showing pixels. Issue was it also blurred image at zoom level 1... maybe subpixel
issue. Anyway - for inspecting exact composite results, zooming in showing pixels
is nicer anyway.



git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55446 954f8c5b-7b00-dc11-b283-0030488c597c
OSX/tablet: fix a longstanding bug with certain devices and a cornercases

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55447 954f8c5b-7b00-dc11-b283-0030488c597c
Prefetching for movie clips

This commit basically implements frames prefetching for
movie clip datablock.

Number of frames to be prefetched is controlled in User
Preferences, System tab, Prefetch Frames option.

Currently prefetching is destructive-less for movie cache,
meaning mo frames will be removed from the cache when while
prefetching. This is because it's half of simplier to
implement, but it also makes sense from tracking point of
view -- we could want to playback in both directions and
removing frames from behind time cursor is not always a
good idea.

Anyway, smarter prefetching strategy could be developed
later.

Some implementation notes:

- Added MEM_CacheLimiter_get_memory_in_use function to get
  memory usage of specified memory limiter.

- Fixed prototype of MEM_CacheLimiter_get_maximum which
  was simply wrong (used wrong data type for output).

- Added some utility functions to movie clip and movie
  cache for direct cache interaction and obtaining cache
  statistics.

- Prefetching is implemented using general jobs system.
  which is invoking from clip draw function.

- Prefetcing will stop as soon other job or playback starts.
  This is done from performance point of view. Jobs will
  likely require lots of CPU power and better to provide
  whole CPU to it.

  Playback is a bit more complicated case. For jpeg sequence
  playback prefetching while paying back is nice. But trying
  to prefetch heavy exr images and doing color space
  conversion slows down both playback and prefetching.

TODO:

- Think of better policy of dealing with already cached frames
  (like when cached frames from other clips prevents frames
  from current clip to be prefetched)

- Currently a bit funky redraw notification happens from
  prefetch job. Perhaps own ND_ is better to have here.

- Hiding clip while prefetch is active in theory shall stop
  prefetching job.

- Having multiple clips opened on file load will prefetch
  frames for only one of them.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55448 954f8c5b-7b00-dc11-b283-0030488c597c
Bugfix [#34710] Crash on duplicating object with cloth modifier.

Caused by last commit by me.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55449 954f8c5b-7b00-dc11-b283-0030488c597c
When using border rendering, use the same border for compositor

This makes compositing as fast as it's possible in this case.

The only thing is border render+crop will still give funcy
results. This is the next thing to be solved in compositor.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55450 954f8c5b-7b00-dc11-b283-0030488c597c
Changes to compositor output node

Make it so compositor output node wouldn't be calculated
when Render Result image is not visible on the screen.
This makes compositor tree editing more friendly and
faster.

Also, if there's no viewer image visible on the screen
viewer nodes wouldn't be handled.

Final rendering keeps unchanged for now.

This solves issues when for performance artists are
disconnecting compo output node before tweaking values
in compositor and forgets to attach compo output
node before sending file to the farm.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55451 954f8c5b-7b00-dc11-b283-0030488c597c
I18n users request: add the ability to use a translated name for newly added/created objects or other datablocks.

This simply adds a third "translation type" (in addition to iface and tip), "new data", with relevant user settings flag and helper funcs/macros (and py api).

Currently implemented name translation when adding new objects, as well as modifiers and constraints, will add the others (cd layers, scenes, perhaps nodes [though I think they do not need this], etc.) later.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55452 954f8c5b-7b00-dc11-b283-0030488c597c