Commit Graph

1708 Commits

Author SHA1 Message Date
4d65a3297d move double click check into its own function. 2013-01-16 04:17:34 +00:00
f2cfe4b2e9 minor changes to ghost
- use WITH_ASSERT_ABORT define, so GHOST_ASSERT will abort.
- rename XTablet -> GHOST_TabletX11, was confusing since it was named like an xlib struct.
2013-01-16 01:10:06 +00:00
761ac89877 style cleanup 2013-01-15 23:45:41 +00:00
fa759d8ffd Mac HiDPI ("retina") handling:
OK - so you have this nice crisp screen, and still you want to add extra 
monitors to the laptop! That means Blender should switch back and forth to HiDPI 
modes, when you move a window to another monitor.

This code makes the pixelsize scale factor a window property, and handles
an event when a window moves to another monitor. It then changes the
native pixelsize nicely and refreshes entire UI.

You can also have one Blender window on high, and other on low resolution.

Stretching a Blender window from 1 monitor to the other works too, but that
is Apple magic handling it.
2013-01-12 17:07:49 +00:00
bed3618780 Bug fix 33732
Modal operators with hardcoded (in C) event handling now don't get
double clicks anymore. For modal keymaps things work OK.

This fixes number input typing for CTRL+B bevel, for example.
2013-01-10 11:08:38 +00:00
cecbb3498b add RNA_def_struct_ptr(...) to use for runtime struct registration, saves over 2000 string lookups on startup and gives overall ~10% speedup for starting blender on my system. 2013-01-09 05:32:15 +00:00
472595f1d3 Bugfix #33803
(2.65a and older)

Case: ALT+CTRL+U (user prefs) made mousewheel change button values in inactive
window.

On opening 2nd window, or de-activating a window, the modifier
state was kept for that window. That meant that mouse-over in a window was using
the old modifier - for example for scrollwheel it would change values
in buttons.
2013-01-08 14:40:15 +00:00
682df047a0 style cleanup 2013-01-08 02:06:16 +00:00
bb2fd5da01 Trackpad: "pinch/stretch" zooming is non-inversed in default now.
Only tested on Mac trackpads... I'm on it.
2013-01-06 16:28:44 +00:00
fa0805e287 Changes for opengl render to reflect new alpha premul pipeline
without hurting quick texture painting

- ED_view3d_draw_offscreen will now output buffer with
  transparent alpha, if sky needed it should be alpha-undered
  later.

- ED_view3d_draw_offscreen_imbuf now accepts alpha mode as an
  argument which could be either R_ADDSKY or R_PREMULALPHA

- OpenGL render and sequencer's opengl preview will now reflect
  scene's Alpha Mode

- Quick Edit will use OpenGL with transparent alpha mode
2013-01-05 15:33:18 +00:00
4190169282 code cleanup, also remove glError check in font drawing code since its now a debug option. 2013-01-04 17:24:40 +00:00
4fa340c716 Fixes - post 2.65a
- Trackpad swipes now behave same as scrollwheel for listview scrolls
  (disabling 2d view scroll when mouse over)

- Added back 2.4 debug print for glGetError()
  Only useful for developers - to check what goes on when ogl messes up.

- Made more clear print for read factory default. It's not error :)
2013-01-04 14:51:02 +00:00
7139a08566 Some UI message fixes... 2013-01-02 16:56:36 +00:00
c0e1f23e5a Bug fix - post 2.65a
New option "Keep Session" was not using "untitled.blend" as default save name,
in case a startup.blend was kept as session. Could give bad accidents.
2013-01-02 16:10:03 +00:00
79c2571e56 user-preferences for addons. currently unused, example & docs still to come. 2012-12-29 10:24:42 +00:00
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
08fbc48ee5 revert r53356, this stopped the leak but still wasn't working nice.
Add asserts when CTX_data_pointer_get/CTX_data_collection_get are incorrectly used.

disable context inspection for now, Will enable again when its working properly.
2012-12-28 10:08:17 +00:00
7504cf34b4 This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!

This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!

To make all this work, other changes were also necessary:

* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.

* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.

* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.

* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
  Note: not sure whether we should add that one to all UILayout's prop funcs?

Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
f0c1bc830c add option to BLI_scanfill_calc() - BLI_SCANFILL_CALC_HOLES, gives some speedup for BMesh ngons which never have holes and ensures predictable triangle count (totvert - 2), which is needed for pre-calculating array size. 2012-12-27 06:39:27 +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
851cb9b345 Added support of J2K codec for Jpeg2000 writing
This codec is absolutely needed to generate DCP using OpenDCP,
before that external application to convert JP2 to J2K was used
which slowed down export a lot.

New codec is exposed to image format settings panel and called
Codec. Default one is JP2 which creates files with .jp2 extension,
new one is called J2K which creates with .j2c extension.

Other changes:
- Fixed avi jpeg warning which was treating as error here.
- Made it so extension is detecting from ImageFormatData instead
  of image file type, which makes it possible to have different
  extension for the same file type depending on it's settings.

  IRIS format should still be changed (depending on number of
  channels it'll be .bw, .rgb or .rgba extension)

- Default image format settings would be set from image buffer
  when re-saving it. Makes it possible to easily open .j2c file
  and save it using J2K codec (without this change it'll save as
  .jp2 using JP2 codec)
2012-12-23 13:57:09 +00:00
6a57420b52 Small drawing glitch, for UI with transparent overlapping regions;
- The corner 'duplicate/merge area' widget was drawing too often.

(Added comment in subwindow 'active' code, too many redraws are being
sent on moving mouse over region eddges)
2012-12-22 11:52:53 +00:00
a735a2370b Weight gradient tool for weight paint mode
- blends from current weight into alpha zero.
- uses brush alpha & curve.
- respects weight paint vertex/face select modes.
- updates realtime.


Access With
- Alt+LMB (linear gradient)
- Ctrl+Alt+LMB (radial gradient)


note:
- WM_gesture_straightline_* are used but not well suited to this task, may end up replacing with own modal operator.
- Key handling works but needs to be done better.
2012-12-22 08:19:27 +00:00
2a5cabb039 code cleanup and minor changes
- use DummyRNA_NULL_items to replace empty enums.
- replace calloc with malloc in copy_dverts since its copied over after.
- add wmGesture->userdata, so operators that use gestures have somewhere to store their own data (not used yet).
2012-12-22 01:08:42 +00:00
f25618f29a make Node.links return a tuple, this may you can't do socket.links.append() by mistake.
removed RNAMeta mixin class since you cant register subclasses.

also some minor code cleanup
2012-12-21 12:16:13 +00:00
4e2bc939c1 Mac Retina fix:
Mouse coordinates were not mapped correctly for code that allows to use
multiple windows efficiently (mouse over not-active windows).

Apple's high-density display mode works a bit strange, requiring some hacks :/

- Desktop coordinate system (mouse pos and for windows) is as usual
  (set by display resolution settings)
- However, the available pixels in a window is always on 'retina' level.
  (full screen - 2880 wide, but window can be 1440 or 1920 wide)

In order to get this to work for opengl and Blender, we use internally the
coordinates on pixel level. That means that window positions and sizes have
to mappend in our code.

Once all issues for retinas have been tackled, I'll check on clean API for 
it, so you can also use it in future for other high density screens.
2012-12-20 11:14:52 +00:00
acfe74351b improve info view property output for properties.
- Include RNA properties when checking for matches.
- Don't include the context's property store (these are normally set by the UI code and not accessible by a script author)

Note: added CTX_data_dir_get_ex() which has options for returning different members from the context.
2012-12-19 02:08:58 +00:00
e0d585b6c9 fix for crash in recent changes, missing NULL check 2012-12-18 17:06:31 +00:00
27796a34b1 fix for crash in own commit - happend when changing userprefs. 2012-12-18 16:52:46 +00:00
54bab21ca0 use 'bpy.context' when printing properties in the info window. 2012-12-18 16:20:30 +00:00
5fcb12d754 changing RNA properties now prints python script in the info view.
next will add context so bpy.data.xxx[id] are not used for all references.
2012-12-18 15:22:06 +00:00
957604f895 functions to make a string representation of a property & assignment. 2012-12-18 14:11:19 +00:00
6030b08caf Bug fix, IRC collection. (Fix for recent commit)
On saving new files (after loading startup.blend), the user prefs were included.
G.fileflags again...
2012-12-18 12:14:14 +00:00
865b547b44 add checks to style checker script for 'a . b' and 'a []'
also use BLI_findindex for modifiers_indexInObject
2012-12-15 04:44:10 +00:00
073669dd85 Bug fix, irc submitted:
On saving a first .blend after startup, the file would load back as if it was not
saved (showing no name in header). 

The whole FILEFLAGS and G.relabase_valid and G.file_saved etc is messy.
This commit fixes issues, but only adds more mess :)

Will discuss a nicer implementation of all of this.
2012-12-14 18:54:22 +00:00
0990c84f3f Fixes for correct UI scaling display:
- Move to layer (and more popups) didn't scale yet
- User Prefs and render window now open on right location on Mac Retinas
- Brush sizes for painting now scale for Mac Retina
2012-12-14 15:09:59 +00:00
28cd603140 Bugfix - own collection.
Very occasionally Timer Events could still get handled, after stopping
a timer - especially with the timer event still in the queue.

This patch disables such events. Introduced a EVENT_NONE to make sure
it gets ignored everywhere.
2012-12-13 16:21:08 +00:00
c44d105479 Bugfix, IRC report:
If a new userpref.blend was loaded, but no startup.blend existed yet, Blender crashed.
2012-12-13 11:27:21 +00:00
e036c90253 region overlap feature missed view3d grid-scale text, increase string size for title text too. 2012-12-13 05:43:01 +00:00
1ab6306177 minor edits
- add BLENDER_QUIT_FILE define.
- use const for passing rcti's in widget drawing.
2012-12-13 02:40:49 +00:00
96b2dc8e13 style cleanup: changes from recent commits 2012-12-13 01:00:21 +00:00
0260e4b8a3 code cleanup: quiet warnings 2012-12-13 00:47:47 +00:00
9211fae41e Bugfix, irc report:
Crash on running in background mode. Calling GHOST function, but there is 
no GHOST initialized. Easy to skip.
2012-12-12 22:02:08 +00:00
160ebfa4c4 Disable a bugfix I did - to prevent event timers to be used still.
Code looks sane, but somehow it frustrates the panel animation timer, causing
freezes now. Work for tomorrow.
2012-12-12 20:31:12 +00:00
dcf6e5f5f6 Quick fix for ghost error - solves pixelsize to return 0. 2012-12-12 19:09:25 +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
dd0e554d9e Sequencer: add textured solid option for opengl preview 2012-12-12 12:42:12 +00:00
7c699a217a define the size of matrix args for both rows/cols. 2012-12-11 14:29:01 +00:00
22505c10f8 fix [#33442] Units
adding meshes were scaling the user input values so the distance on the button didnt relate to the scale of the object added.

Now use an invoke function that scales unset default values.
2012-12-09 10:48:18 +00:00
c9dd1b0f2c fix playanim - up/down keys were not stepping 10 frames as intended. 2012-12-06 06:01:15 +00:00