Commit Graph

36179 Commits

Author SHA1 Message Date
Ton Roosendaal
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
Campbell Barton
47ee5f56b6 minor cleanup to debug drawing code in the BGE, dont convert strings to STR_String, only to get them back as regular strings. 2013-01-12 16:49:37 +00:00
Campbell Barton
68d83f4140 quiet compiler warning with string formatting in CParser::Term 2013-01-12 15:32:05 +00:00
Campbell Barton
c93e127e7a code cleanup: style and replace (float)sin, (float)cos with sinf, cosf 2013-01-12 14:28:23 +00:00
Sergey Sharybin
aab01c86cf Patch #33837: ffmpeg1.1 and libav9.1 compatibility update
Patch makes it possible to compile blender with recent ffmpeg
and libav libraries, mainly by getting rid of deprecated API.

Original patch by Campbell Barton with own modifications to
support compilation with older ffmpeg versions.

This patch could break compatibility of FFV1 videos playing
back in older players, mainly because of alpha support changes.
Preserving compatibility with such players became a headache
and think it's high time to get rid of workarounds here.
2013-01-12 12:51:10 +00:00
Ton Roosendaal
497e6bfff9 Bug fix #33842
Old bug:

Image Editor, Generated Image, use "Replace" operator failed, was mising correct
signal to handle type change to "From File".
2013-01-12 12:46:25 +00:00
Ton Roosendaal
129fb516f4 Security fix:
"Pack Blender Libraries" now first does a check if the .blend files are all used
with relative paths. This to prevent bad things happen on unpacking.
2013-01-12 11:59:22 +00:00
Ton Roosendaal
7db00f0826 Usability:
Ancient annoying thing for zooming in 2d views: when a view was restricted to keep
aspect ratio, it only allowed vertical or horizontal MMB-drag zooms, depending 
portrait or landscape size of editors. Same for trackpad and magic mouse.

Now vertical zoom drag always works for editors like buttons, nodes.
2013-01-12 11:00:27 +00:00
Sergey Sharybin
7a90af7b5a Packed and generated images support for Cycles
This commit adds support of packed and generated images
for Cycles when using SVM backend. Movies are still not
supported. This changes also doesn't touch OSL which is
much less trivial to adopt for any images which are not
saved to disk.

Implementation details:

- When adding images to Image Manager is now possible
  to mark image as builtin. Builtin images will bypass
  OIIO loader and will use special loading callbacks.

- Callbacks are set by Blender Session and they're
  using C++ RNA interface to obtain needed data (pixels,
  dimensions, is_float flag).

- Image Manager assumes file path is used as reference
  to a builtin images, but in fact currently image
  datablock name is used for reference. This makes it
  easy to find an image in BlendData database.

- Added some extra properties to Image RNA:
  * channels, which denotes actual number of channels
    in ImBuf. This is needed to treat image's pixels
    correct (before it wasn't possible because API
    used internal number of channels for pixels which
    is in fact doesn't correlate with image depth)
  * is_float, which is truth if image is stored in
    float buffer of ImBuf.

- Implemented string lookup for C++ RNA collections
  for cases there's no manual lookup function.

OSL is not supported because it used own image loading
and filtering routines and there's seems to be no API
to feed pre-loaded pixels directly to the library.

Think we'll either need to add some API to support
such kind of feeding or consider OSL does not have
support of packed images at all.

Movies are not supported at this moment because of lack
of RNA API to load specified frame. It's not difficult
to solve, just need to consider what to best here:
* Either write some general python interface for ImBuf
  and use it via C++ API, or
* Write a PY API function which will return pixels for
  given frame, or
* Use bad-level BKE_* call

Anyway, small steps, further improvements later.

Reviewed by Brecht, thanks!
2013-01-12 10:59:13 +00:00
Campbell Barton
5e6917a18e patch [#33738] Extend Selection option unified and added to few operators
from Sebastian Nell (codemanx), with minor edits
2013-01-12 10:48:10 +00:00
Campbell Barton
45c453c9b1 replace inline with BLI_INLINE define. 2013-01-12 10:39:09 +00:00
Mitchell Stokes
03df7e9a56 BGE: Fix for [#33839] "a logic.joysticks Crashes BGE" reported by Josiah Lane (solarlune).
On a scene change the SCA_JoystickManager gets destroyed which in turn means all of it's joystick instances are released. Since SCA_PythonJoystick was just using a borrowed reference, this allowed the joystick to be freed. Now the joystick's refcount is incremented so that the SCA_PythonJoystick's joystick reference will survive across scene changes.
2013-01-12 05:44:08 +00:00
Ton Roosendaal
2f4cc3530d Bug fix #33826
Post 2.65a issue

Now scrollbars appear/disappear correctly, a bug in checking if mouse clicks
where on panel headers popped up. That disabled using scrollers next to a
panel header.
2013-01-11 15:19:47 +00:00
Howard Trickey
d1d3384750 Fix knife angle constraint bug #33813 by changing knife mvals to floats.
The problem was that by snapping the integer mouse values to
lines through the previous point, the angle was slightly off.
2013-01-11 14:13:22 +00:00
Campbell Barton
f68e9db583 add padding for node view-all, view-home operators. 2013-01-11 04:34:15 +00:00
Campbell Barton
a4d5ef8c7d fix for bpy.props string get-length callback, PyUnicode_GetLength() isn't a measure of the buffer size. 2013-01-11 04:09:54 +00:00
Campbell Barton
d0569dd68e win32 has no kill, force crash for now, perhaps windows devs can do this more correctly. 2013-01-11 03:26:49 +00:00
Campbell Barton
4d7583b66f code cleanup: warnings, also add check in crash handler that a wmWindowManager is present. 2013-01-11 03:21:24 +00:00
Campbell Barton
65497a25ba fix for error in gradient theme rgba_char_args_set() use, was setting char's to float values. 2013-01-11 03:19:52 +00:00
Alex Fraser
17c428d4df Changing units of stiffness parameter in classical (new) SPH solver: used to be speed of sound squared; now just speed of sound.
The classical SPH solver was not in 2.65, so this change is unlikely to affect many users. But beta users who have been trying it out will need to change the stiffness parameter to sqrt(old value).
2013-01-11 03:06:10 +00:00
Alex Fraser
61833ddd5a Fix own mistake in SPH solver selection. Thanks Campbell for pointing it out. 2013-01-11 02:03:22 +00:00
Campbell Barton
0c3e570868 remove CustomData_get_active_offset(), use CustomData_get_offset to return the active layer, matching CustomData_get() 2013-01-11 01:41:27 +00:00
Campbell Barton
3fc0d2691d include a stacktrace in the crashlog text written by the segfault handler. 2013-01-11 01:30:44 +00:00
Campbell Barton
91d4fb5d6c speedup for DM_to_bmesh_ex(), no need to check vertex order when converting faces since the loops are already in order, will speedup modifiers that use bmesh. 2013-01-10 18:34:09 +00:00
Campbell Barton
de6fe1294c minor speedup for DM_to_bmesh_ex(), only duplicate the edge array when the derivedMesh type isn't a CDDM. 2013-01-10 18:31:14 +00:00
Ton Roosendaal
70a59a3262 Depsgraph hack feature - experimental
Many depsgraph failures are because some data in the graph is being
recalculated too early (or not at all).

Since we better support animators with working renders, here's a hack to
allow manual additional updates on frame changes.

In Property Editor, Object, Panel "Relations Extra" you now have two
buttons:
- Extra Object Update
- Extra Data Update

This will do an extra update of object and/or its data ONLY on frame changes.
Update happens as last.

Tested on files collected in Wiki todo, several cases now work OK, especially
the lags on updates.
2013-01-10 18:20:29 +00:00
Sergey Sharybin
c92be1a9a5 Correction to do_versions() in 53676
Affect on curve radius only if offset/extrude was used,
otherwise radius could have been used for other things
(like controlling hair) which will likely break
compatibility.

Reported by Tube project guys.
2013-01-10 18:11:56 +00:00
Brecht Van Lommel
b3802d0041 Fix build error on Mac, bool needs an #include. 2013-01-10 17:46:23 +00:00
Brecht Van Lommel
b39090bb5a Fix #33752: UV Orco coordinates were wrong for Cycles (and other external
render engines). Replaced generating orco_index by filling the UV loop data
directly which is easier and all that needed to be done anyway.
2013-01-10 17:37:17 +00:00
Campbell Barton
18536e201f add a segfault handler that writes out the info log into a crash file alongside the blend file. 2013-01-10 16:37:48 +00:00
Sergey Sharybin
f6f33515ac Fix #33822: Compositor gets stuck if a sequencer window is also visible
Issue was caused by a fix for rendered sequencer preview mode, which
will likely conflict with compositor job. Made it so compositor job
will be killed when sequencer uses rendered preview.
2013-01-10 16:11:12 +00:00
Campbell Barton
1c99e6aa0b pyapi internal api code: check for == -1 rather then < 0, for known error returns. 2013-01-10 15:22:19 +00:00
Campbell Barton
e56844e98b simple speedup for view3d numeric panel - dont loop on verts or edges if none are selected. 2013-01-10 14:38:30 +00:00
Lukas Toenne
127b5423d6 Another fix for bpy.props getters/setters: PyC_AsArray does a refcount decrement internally on errors, need to skip Py_DECREF in that case to avoid negative refcounts. 2013-01-10 14:36:08 +00:00
Campbell Barton
983e5fe5f1 fix for own mistake in recent changes to scanfill, bmo_triangle_fill_exec() (alt+f), was missing BLI_SCANFILL_CALC_HOLES argument.
reported as [#33819]
2013-01-10 14:28:06 +00:00
Campbell Barton
1df1f9fdd3 adding vertex color layer in mesh editmode would overwrite UV's, strange nobody reported this since its been there since 2.63. 2013-01-10 13:59:52 +00:00
Lukas Toenne
273cf512dd Fix for bpy.props getter/setter callbacks. These were missing a valid GIL state when being called outside the UI context. 2013-01-10 12:32:09 +00:00
Campbell Barton
c3c3df3aec editmesh texface drawing, reuse customdata offset rather then looking up each UV and vertex color, gives overall ~9.5% drawing speedup in my tests.
was also doing NULL checks on UV's which are never NULL in this case.
2013-01-10 12:07:01 +00:00
Ton Roosendaal
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
Campbell Barton
7c64109bce bmesh todo: uv stretch area draw mode wasn't calculating ngon area - added area_poly_v2(). 2013-01-10 08:16:19 +00:00
Campbell Barton
ce4116c35c don't call BKE_mesh_tessface_ensure() from DM_to_mesh(), caller must do this instead. 2013-01-10 05:50:21 +00:00
Campbell Barton
0ce1be552e transforming verts was getting the bevel weight for each vertex even if bevel-weight wasnt being transformed. 2013-01-10 05:35:10 +00:00
Campbell Barton
7083350913 fix for editmesh calculating normals twice when using the number-buttons. 2013-01-10 04:46:51 +00:00
Campbell Barton
ceb9701507 don't store bevel weights or edge crease customdata layers in editmode unless they are needed.
configurable in 'Geometry Data' panel, will be added when running crease edges transform for example.
2013-01-10 04:43:31 +00:00
Campbell Barton
97d1abfe95 speedup for editmesh getVert and getEdge, were doing 2x customdata layer lookups for crease and bevel weight, also make use of the existing meshdata array for lookups. 2013-01-09 18:20:11 +00:00
Lukas Toenne
e5113c51a7 Small fix for r53685: Allow setting NULL/None as parent, i.e. detach a node from a frame. 2013-01-09 16:15:06 +00:00
Lukas Toenne
b29f703881 Make the node.parent property editable in RNA, so frame hierarchy can be changed by scripts without resorting to operator hacks.
Performs sanity checks internally to make sure that
a) Only frames are used as parents. In future other nodes may be used for parenting, that will require more sophisticated poll functions.
b) Avoid infinite recursion. If the supposed parent is already attached to a frame node the parent assignment will be ignored.
2013-01-09 16:07:42 +00:00
Ton Roosendaal
9a4a5fa2b4 Usability fix:
Blender's data link button (typically with menu and searching options)
now has a X icon to clear its contents. 

Before you had to click, delete text, enter.

For example:
- Object Parent
- Modifier objects or vertexgroups

This fix saves each user 100 clicks per day, with 100k users
that's 3 billion clicks per year!
2013-01-09 15:58:34 +00:00
Brecht Van Lommel
b02dd1e719 Fix #33815: blender internal crash rendering material pass with strands.
Patch from Sergey with modifications.
2013-01-09 15:39:26 +00:00
Campbell Barton
f9c87b86fc partial fix for [#32581] Mesh properties API does not allow for zeros in byte array
bmesh access allows zero bytes, support still needs adding via RNA.
2013-01-09 13:25:46 +00:00