fix for missing NULL pointer checks and incorrect array free


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55351 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup: incorrect sized array args, remove some redundant code.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55352 954f8c5b-7b00-dc11-b283-0030488c597c
Cycles / CUDA:
* Simplify Computing Capability Check, only check for major. 

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

Automatic switching for drawing pixel buffers via glDrawPixels or using GPU textures

It works with a User Preference limit, in megapixels, to define whether to use
GPU or direct pixel drawing. Default is now initialized to 10 MP (4k buffers).

Especially for zooming out (draw smaller) texture drawing is much smaller. Also
Nvidia cards typically draw much faster with textures in general.

Added to node backdrop first now, the other editors follow in a next commit.

For coders: added new DNA function to initialize new struct variables, so you
don't have to sub-version files anymore.

   DNA_struct_elem_find(fd->filesdna, "structname", "typename", "varname") 

"filesdna" is the sdna description of the current file being versioned.





git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55354 954f8c5b-7b00-dc11-b283-0030488c597c
Fix evil own bug: paint_redraw accessed freed memory. Still doesn't
solve problem not being able to paint with black in image editor.


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

Image Editor and 3D view background image now use new automatic switching for
drawing GPU texture or OpenGL DrawPixels too. For large zoomed images
it gives massive speedup.



git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55356 954f8c5b-7b00-dc11-b283-0030488c597c
Fix for "draw images as texture"

Zooming in on images in Image window now shows pixels again (was filtered).

Now the glaDrawPixelsTex() and glaDrawPixelsAuto() have an argument to 
define if images should zoom in with linear filter, or draw pixels.



git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55357 954f8c5b-7b00-dc11-b283-0030488c597c
Fix "can't paint" bug no.1, painting with black on image editor did not
paint. Was own regression when optimizing colour operations. I will not
use an alpha bit mask since it may run into portability issues with byte
order.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55358 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup: add 'const' to headers to quiet msvc warnings, also remove (char *) casts that aren't needed now we're on Python3.3


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55359 954f8c5b-7b00-dc11-b283-0030488c597c
use const pointers for file loading and booleans for animation system return values passed as pointers.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55360 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup: name mesh functions more consistently, also use bools for mesh args.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55362 954f8c5b-7b00-dc11-b283-0030488c597c
Fix: Setting cursor to semitransparent objects will fail because of clip
alpha, added option when drawing depth to disable alpha clip override.
We use that in texture paint cursor now. Not too common but may be
useful for people dealing with cloning plugins.

Reported by kgeogeo on irc, thanks.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55363 954f8c5b-7b00-dc11-b283-0030488c597c
Forgot to commit the button to set memory limit for using GPU Images...



git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55366 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #34672: Image sampling line didn't use color management for byte buffers

This makes it so sample line (for all image editor, sequencer and compositor)
displaying managed color for byte buffers as well. It was simply not implemented
before.

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


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55368 954f8c5b-7b00-dc11-b283-0030488c597c
Just added a comment:

To make circle select allow pass-through for view events, several issues have to be
tackled. 
 1) other modal ops run on top (border select), 
 2) middlemouse is used now 
 3) and what for tablet/trackpad or people without middlemouse?

The MMB deselection for border/circle is not optimal now... needs rethinking this.

Better would be to check on non-persistant-modality for circle, to start with gesture style
event like lasso or border can do now.



git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55369 954f8c5b-7b00-dc11-b283-0030488c597c
Bug fix, irc:

Curves widget error: after deleting a point, and click to add a new point, on dragging
it the point flipped up 20 pixels. Was caused by changed layout and region view matrix.

Solved by storing actual mousecoords instead of mapped ones.




git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55370 954f8c5b-7b00-dc11-b283-0030488c597c
Fix for [#34671] Video file overwritten even though overwrite option is unselected
* Grey out Placeholders and Overwrite for Movie formats. 

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55371 954f8c5b-7b00-dc11-b283-0030488c597c
replace format checks with is_movie_format


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@55372 954f8c5b-7b00-dc11-b283-0030488c597c
Merge of the PyNodes branch (aka "custom nodes") into trunk.

PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.

=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.

Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].

=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].

The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.

[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/

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