Commit Graph

304 Commits

Author SHA1 Message Date
bde6a939e6 View2D could potentially divide stuff by zero, giving bad matrices. 2013-04-18 10:22:42 +00:00
dfa30f8207 Bug fix #34943
With extreme narrow scaled editors, the slider/mask code in View3d could deliver
zero sized or invalid window matrices.

Needs confirmation from Sergey if it works :)
2013-04-18 10:10:58 +00:00
d466e1d3b4 add BLI_rcti,f_recenter()
fix for uninitialized variable use in radial_control_get_properties() and bad cast in bpy api's foreach_parse_args()
2013-03-19 10:54:52 +00:00
01e9dae3dc code cleanup 2013-03-18 18:25:05 +00:00
Lukas Toenne
4638e5f99a 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/
2013-03-18 16:34:57 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
a31a93ca3f Compile fixes for recent code cleanups:
* M_PI was not declared for MSVC.
2013-02-21 17:39:48 +00:00
60c1a7898a use radians for BLF_rotation 2013-02-21 17:15:19 +00:00
b6c82b2e84 fix for glitch drawing file selector dividers (would draw apart or on top of each other depending on the view) 2013-02-02 14:11:58 +00:00
e24443b79a style cleanup 2013-01-09 03:30:15 +00:00
fa28e50ac2 Region scrollbar fix!
Now scrollbars correctly hide and show, making space for the actual contents
in a region. It solves several old hacks, and puts view2d code a bit more
back in control as well. 

Implementation notes:

- The view2d mask feature is working again
- The #define V2D_SCROLL_HORIZONTAL_HIDE means: "turn on hiding".
- Code for UI_view2d_region_reinit() is enforcing better standard view settings

But... two hack/patches needed to be added:

- Region panel drawing: if after generating the button panels it appears
  a scroller hides or reveils, it calls all the generating code again.
  (a simple scale doesn't work due to rounding differences in layout code)

- View2d code that maps 'tot' and 'cur' rects: if this code detects that
  the mask changes, it calcs the map code again.

Also a bugfix (issue in 2.65)

- The left/bottom area split widget was drawing 1 pixel too large sometimes, 
  leaving bad trails on moving area dividers.
2012-12-26 13:05:39 +00:00
1dbb84c1c9 UI DPI scaling fix:
2D views with scale prints (numbers over slider) now follow the text size.
2012-12-19 12:22:15 +00:00
60e35be2d4 UI fixes:
- on setting lower DPI, the regions that were scrolled down would start moving down
  1 pixel on every draw. Caused by rounding error. (int + 0.1 vs int -0.1)
  (Ancient bug)

- circles used in outliner - to denote selection/active - now draw bigger, and better
  centered. (2.66 fix only)
2012-12-17 17:37:48 +00:00
da7ce6a3cc use UI_view2d_getscale() to get the scale for image cursor drawing and ED_mask_pixelspace_factor(). - was getting the image width/height when its not needed before. 2012-12-14 16:51:02 +00:00
96b2dc8e13 style cleanup: changes from recent commits 2012-12-13 01:00:21 +00:00
12b642062c Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability

Short list of main changes:

- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
  Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
  This allows keeping UI and data without actual saves, until you actually save.
  When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v). 
  Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards. 
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
  Old option is called "Save Startup File" the new one "Save User Settings".
  To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
  This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
5753ede9a5 Usability: Logic editor
- View now restricts to the actual region you work on. Makes zoom and pan nicer.
- Added HOME for reset view to 1:1 zoom level.

Also: fixed nasty bug in view2d code that checked validity of 2d views, only
showed (afaik) in the logic eidtor though.

Effect was that zoom in/out would weirdly jump when going across zoomlevel 1.
2012-10-30 15:33:03 +00:00
0405406280 Bugfix #28298
When I added DPI support in the UI, I added code that refreshes views for 2d
regions. These refreshes also happened on screen switches or file select, causing
header views (horizontal scrolled) to clear.

Now the code less intrusive, changing header views in fewer cases. 

This is a patch provided by Anthony Edlin. Thanks dude!
2012-10-25 12:53:27 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
42dd135be0 style cleanup: multiple statements on a single line in interface code. 2012-09-16 23:40:03 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
fed6b2bcb7 code cleanup: remove paranoid/invalid NULL checks and also reduce some unneeded size_t -> int conversions. 2012-09-15 07:31:17 +00:00
aa2d84da37 style cleanup:
also remove some redundant conversions int -> short -> int
2012-09-09 00:00:21 +00:00
c92ab5c3ef code cleanup: use rect size macros 2012-08-21 20:34:05 +00:00
77f47799dd code cleanup: use BLI_RCT_SIZE macro 2012-08-20 23:06:17 +00:00
26f073b327 macros for rectangle center and size 2012-08-20 15:29:02 +00:00
887d517e3b use define for 0.375 = GLA_PIXEL_OFS, used all over the interface.
also use M_SQRT1_2 in math_rotation.c
2012-08-05 17:27:52 +00:00
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
cfb7aee017 style cleanup 2012-07-07 22:51:57 +00:00
558721ab59 More spell checking. 2012-07-04 15:04:38 +00:00
c8c743b609 code cleanup: compile with clang and quiet some warnings. 2012-06-28 12:32:06 +00:00
Lukas Toenne
855b6391ea Basic snapping in node transform operator.
Snapping actually was working already, but grid spacing was set to 1.0, which is basically pixel size in the node editor. Increased this to 1x grid step for fine snapping and 5x grid step for rough snapping.

Grid drawing in node editor now draws 2 levels in slightly different shades to indicate the different snapping modes better.

Node editor also supports the general use_snap tool setting to enable automatic snapping during transform. For now only the incremental snapping is supported, in future could be extended to enable alignment between nodes in a number of ways.
2012-06-28 08:47:22 +00:00
cf129d8cb5 avoid calls to BLF_height_default in a loop calling with the same value, also quiet warning. 2012-06-20 19:23:12 +00:00
b33f0ef0e3 style cleanup 2012-05-27 19:40:36 +00:00
ed679693c9 style cleanup: whitespace/indentation 2012-05-19 13:55:54 +00:00
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
8765dfccf7 style cleanup: correct typos 2012-04-21 14:14:58 +00:00
5b88712ff9 move debug flag into its own global var (G.debug), split up debug options.
--debug
  --debug-ffmpeg
  --debug-python
  --debug-events
  --debug-wm

This makes debug output easier to read - event debug prints would flood output too much before.

For convenience:
  --debug-all turns all debug flags on (works as --debug did before).

also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context.
2012-03-31 00:59:17 +00:00
a6ebffe182 style cleanup: interface 2012-03-30 01:51:25 +00:00
6faeac9fe2 style cleanup: add braces around checks - 'if ELEM() {...}', confuses some parsers that done expand macros. 2012-03-25 22:35:18 +00:00
ab4a2aaf4a style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:38:07 +00:00
2f348d8b5d style cleanup: mainly for mesh code, also some WM function use. 2012-03-24 02:51:46 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
79d97ca509 style cleanup - spelling. 2012-03-08 04:12:11 +00:00
f6ae27daef style cleanup - comment spelling + translate some dutch. 2012-03-04 04:35:12 +00:00
7bbf4b7831 style cleanup
- spelling - turns out we had tessellation spelt wrong all over.
- use \directive for doxy (not @directive)
- remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
2012-03-02 16:05:54 +00:00
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
ed04c21374 code cleanup: use float vector size in function definitions, and const's where the values are unchanged. 2012-02-28 14:05:00 +00:00
b95beea539 style chang, made mainly because I wanted to be able to add breakpoints to MEM_freeN calls which were on the same line as the if's. 2012-01-21 22:00:40 +00:00
e10fd04db0 use BLI_strncpy and BLI_snprintf when the size of the string is known.
fix for sequencer unique naming which was missed with string length update.
2012-01-11 12:33:51 +00:00