Commit Graph

53698 Commits

Author SHA1 Message Date
Sybren A. Stüvel
76ca6ed26e Alembic: prevent a couple of unnecessary multiplications 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
e0bf97d8b4 Alembic: be more explicit in y-up versus z-up variables. 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
06c25ace7b Alembic: removed a lot of unnecessary & duplicate code from abc_util.cc
create_transform_matrix(float[4][4]) did mostly the same as
create_transform_matrix(Object *, float[4][4]), but more elegant.
However, the former has some inconsistencies with the latter (which
are now merged and made explicit, turned out one was for z-up→y-up
while the other was for y-up→z-up), and was renamed to
copy_m44_axis_swap(...) to convey its purpose more clearly.

Furthermore, "loc" has been renamed to "trans", as matrices don't
store locations but translations; and more variables now have a src_
or dst_ prefix to denote whether they contain a matrix/vector in the
source or destination axis orientation.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
1c3b6e042a Alembic: added note 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
b0967e9d42 Alembic: allow copy_{z,y}up_from_{y,z}up() to be called with yup=zup
This allows in-place conversion between z-up and y-up, by passing the
same variable to both arguments.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
00e0a94b3c Alembic: import empties under their own name in Alembic, not their parent's
Before this commit something strange happened, as the m_data_name of
an inherit data-less object was used.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
cbe0709db2 Alembic: Don't compute world matrix when it's not necessary. 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
62a47f9660 Alembic: cleaned up hack in AbcObjectReader::read_matrix() 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
347a4956a0 Alembic: added some clarification 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
c0ec0a19da Alembic: added some getter functions to help debug prints etc. 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
5f23f5b516 Alembic: do not presume to predict the parent name
AbcExporter::createTransformWriter() tries to predict the parent Xform
name, but if it cannot be found has multiple ways of creating it, possibly
under a different name than originally searched for.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
56cfd3d5a7 Alembic: Removed AbcTransformWriter::m_parent
It was set, but never read anywhere.
2017-04-06 16:03:59 +02:00
Campbell Barton
f74b4a010d Cleanup: function naming for manipulator
Rename 'stats_*' to 'protectflag_to_drawflags_*' (was too vague).
Also remove NULL check from gimbal_axis
2017-04-06 12:26:07 +10:00
Campbell Barton
5e3b6e951b Cleanup: minor changes to transform-manipulator
Match stats_editbone & stats_pchan behavior to avoid confusion.
2017-04-06 12:02:32 +10:00
lazydodo
7ae9d092d0 Fix alembic build error with MSVC 2017-04-05 10:59:29 -06:00
Sergey Sharybin
f921442a44 Depsghraph: Remove unused function 2017-04-05 15:36:17 +02:00
Kévin Dietrich
6d55dcf4dd Alembic: addition of a simple logging class.
The idea is to have a system where we properly log error messages and
let the users know that errors occured redirecting them to the console
for explanations. This is only implemented for the exporter since the
importer already has similar functionalities; however they shall
ultimately be unified in some way.

Reviewers: sybren, dfelinto

Differential Revision: https://developer.blender.org/D2541
2017-04-05 04:56:38 +02:00
Campbell Barton
411e7abe94 Cleanup: redundant casts 2017-04-05 01:08:19 +10:00
Bastien Montagne
9170e49250 Fix missing protection of RNA_pointer_as_string() against NULL pointers.
Odd that issue was never reached before? Looks like it hit in
datablock_idprops branch though...
2017-04-04 16:04:13 +02:00
Sergey Sharybin
7b149bfde6 Depsgraph: Use atomic operation to tag the changed ID 2017-04-04 15:43:12 +02:00
Sergey Sharybin
ca5ccf5cd4 Task: Remove non-atomic pool suspended flag assignment
This was done some lines above by atomic fetch and and.
2017-04-04 12:32:15 +02:00
Sergey Sharybin
54a60eff24 Fix blender player 2017-04-03 12:31:33 +02:00
Gaia Clary
368b74315a Collada - add flag to limit precision of exported data, mainly to simplify debugging 2017-04-03 10:48:00 +02:00
Gaia Clary
f65d6ea954 fix: collada - do proper conversion from int to bool (as with other nearby parameters) 2017-04-03 10:45:24 +02:00
Gaia Clary
3bf0026bec fix: T50412 - collada: Replaced precision local limit function by blender's own implementation 2017-04-01 15:29:50 +02:00
Campbell Barton
e1fb080743 Cleanup: style 2017-04-01 12:09:17 +11:00
Sergey Sharybin
6c42079b78 Depsgraph: Correction for the previous local view commit
Need to flush layers from components back to ID node.
2017-03-31 17:08:18 +02:00
Sergey Sharybin
25ab3aac9d Fix threading conflicts in multitex_ext_safe()
This function was modifying texture datablock, which makes the call
unsafe for call from multiple threads. Now we pass the argument that
we don't need nodes to the underlying functions.

There will be still race condition in noise texture, but that should
at least be free from crashes. Doesn't mean we shouldn't fix it tho.
2017-03-31 17:08:18 +02:00
Alexander Romanov
27d20a04b5 Fix unreported bug in Blender Render: using unnormalized normal in normal map node in the same way as in baking 2017-03-31 17:53:55 +03:00
Campbell Barton
ff693959d8 WM: Previous commit broke common-case loading new file
Handle this in the operator
2017-03-31 23:48:10 +11:00
Campbell Barton
7f7c807a92 Keep current app-template when selecting 'New File' 2017-03-31 22:06:36 +11:00
Bastien Montagne
e5fa738ce9 UI cleanup: simplify Icon handling of uiDefAutoButR for PROP_POINTER.
Comes from D113, but really not related to the patch's topic!
2017-03-31 12:14:27 +02:00
Germano Cavalcante
d097c2a1b3 Fix T51072: The reference of a pyobject may be being overwritten in bm_mesh_remap_cd_update
In this case the Pyobject gets lost from pybm, and bm.free() does not invalidate the PyElem.
This will cause the destructor of python to read invalid memory and crash.

The solution is to make a copy of the pyobjects pointers before overwriting.
2017-03-31 01:01:16 -03:00
Campbell Barton
14c2083460 Cleanup: warnings 2017-03-31 09:48:57 +11:00
Bastien Montagne
4cfac9edab Cleanup/fix bad code in IDP_SetIndexArray()
Mainly, using index before checking for its validity...
2017-03-30 22:52:53 +02:00
raa
5b3b0b4778 Redraw parent popup when the child popup is closed 2017-03-30 16:48:18 +03:00
Sergey Sharybin
843be91002 Depsgraph: Fix missing updates when in local view
This area is a subject of reconsideration, so for now used simplest
way possible -- ensure depsgraph's nodes have proper layer flags
when going in and out of local mode.
2017-03-30 14:42:55 +02:00
Campbell Barton
31e6249256 Mirror Modifier: Add offsets for mirrored UVs
The mirror modifier now has two fields that specify a -1 to 1 offset for
the U and V axes when mirroring their coordinates.

D1844 by @circuitfox
2017-03-30 13:15:02 +11:00
Campbell Barton
dd662c74ae Fix skin mark operator
Accessed custom-data layer offset before creating.
2017-03-29 20:11:54 +11:00
Campbell Barton
a7ca991841 Fix crash closing window in background mode 2017-03-29 20:11:54 +11:00
Campbell Barton
cb6ec44fc7 Fix missing NULL check in gpencil poll
Also de-duplicate poll functions
2017-03-29 20:11:54 +11:00
Campbell Barton
df7f6a3e2e Option to load startup file with empty-data
Useful for batch conversion and tests.
2017-03-29 20:11:54 +11:00
Campbell Barton
d808557d15 Fix memory leak re-registering operators
Re-registering an operator used by the keymap would lead memory.
Reload scripts for eg leaked over ~1600 blocks.
2017-03-29 13:35:15 +11:00
Bastien Montagne
69aa6577b3 Forgot those IDP_LibLinkProperty call on node sockets IDProps in previous commit... 2017-03-28 14:38:00 +02:00
raa
59bb4ca1b0 Fix: Icon offset for pie buttons 2017-03-28 13:44:02 +03:00
Bastien Montagne
e1909958d9 Fix lib_link_cachefile.
That one was:
* Resetting non-ID pointers (lib_link_xxx funcs should only affect ID
  pointers, everything else shall be done in direct_link_xxx func).
* Even worse, always calling lib_link_animdata, even when
  LIB_TAG_NEED_LINK tag was unset...
2017-03-28 10:15:52 +02:00
Bastien Montagne
bed327f1ce Bring back lib_link_mesh() in 'order' with other libdata liblink functions.
We do not need any special handling anymore for usercount of images used
by faces/polygons (tpage stuff), since we have the 'real_user' handling,
which will gracefully cope with all possible situations.

So better not keep that ugly confusing useless special case.
2017-03-28 10:10:15 +02:00
Bastien Montagne
39172c6f34 readfile.c: Cleanup lib_link code a bit.
Mainly:
* Add missing `IDP_LibLinkProperty()` calls for many ID types
  (harmless currently, but better be consistent here!).
* Bring lib_link_xxx functions more in line with each other.
* Replace some long if/else by switch.
2017-03-28 10:03:59 +02:00
Campbell Barton
1b5acbb329 Correct splash size check 2017-03-28 17:07:37 +11:00
raa
5ce120b865 Fix columns with fixed width 2017-03-28 00:07:31 +03:00
Campbell Barton
086320a62e CMake: WITH_PYTHON_SECURITY=OFF was ignored
Allow auto-execution to be enabled,
also move this to user-prefs versioning code.
2017-03-27 13:02:41 +11:00
Campbell Barton
356aacab6b Add back missing include 2017-03-27 09:14:40 +11:00
raa
505b3b7328 Fix padding and align calculation for box layouts 2017-03-26 18:02:11 +03:00
raa
4bdb2d4885 Fix: Ignore min flag for rows that require all available width 2017-03-26 12:19:01 +03:00
raa
fa63515c37 Fix: Use "round" instead of "floor" in snapping UI to pixels 2017-03-26 12:16:04 +03:00
raa
001fce167a Fix: Button's label can be NULL 2017-03-26 12:04:16 +03:00
Germano Cavalcante
ed072e1dcd re-adds the include "BLI_math.h" to custondata
It was removed here rBd52191616b5f
2017-03-26 04:08:16 -03:00
Wouter
fe3fb23697 Automatic DPI for all platforms, per monitor DPI for Windows.
For Windows 8.1 and X11 (Linux, BSD) now use the DPI specified by the operating
system, which previously only worked on macOS. For Windows this is handled per
monitor, for X11 this is based on Xft.dpi or xrandr --dpi. This should result
in appropriate font and button sizes by default in most cases.

The UI has been simplified to a single UI Scale factor relative to the automatic
DPI, instead of two DPI and Virtual Pixel Size settings. There is forward and
backwards compatibility for existing user preferences.

Reviewed By: brecht, LazyDodo

Differential Revision: https://developer.blender.org/D2539
2017-03-25 11:22:16 +01:00
Germano Cavalcante
a6f74453b6 Fix unreported: inaccuracy of interpolation of custom color layers due to float truncation
Same solution from rBd23459f51640 but now in `layerInterp_mcol`
Also a cleaning was done in the includes
2017-03-24 20:06:43 -03:00
Campbell Barton
f68145011f WM: Application Templates
This adds the ability to switch between different application-configurations
without interfering with Blender's normal operation.

This commit doesn't include any templates,
so its mostly to allow collaboration for the Blender 101 project
and other custom configurations.

Application templates can be installed & selected from the file menu.

Other details:

- The `bl_app_template_utils` module handles template activation
  (similar to `addon_utils`).
- The `bl_app_override` module is a general module
  to assist scripts overriding parts of Blender in reversible way.

See docs:
https://docs.blender.org/manual/en/dev/advanced/app_templates.html

See patch: D2565
2017-03-25 10:04:04 +11:00
Bastien Montagne
a7f16c17c2 Fix various i18n ambiguous issues reported in T43295. 2017-03-24 20:02:15 +01:00
Bastien Montagne
dab3865c0b Fix UI message issue, and style cleanup (!) 2017-03-24 20:02:15 +01:00
Sergey Sharybin
8e58e197fd Ашч T50995: Wrong freestyle render with new depgraph
The iossue was caused by 0371ef1/
2017-03-24 16:33:26 +01:00
Sergey Sharybin
6aa972ebd4 Fix/workaround T51007: Material viewport mode crash on node with more than 64 outputs
Ideally we need to find a way to remove such a static limit here, but it's not so
trivial to implement for texture nodes. Requires some bigger system redesign there.

Just raising limit for now, which is fine for modern systems.
2017-03-24 14:36:00 +01:00
Sergey Sharybin
467d824f80 Fix T50238: Cycles: difference in texture position between OpenGL and Cycles render 2017-03-24 12:24:14 +01:00
Germano Cavalcante
d52191616b Fix for last fix of fix: (unsigned)char is limited to 255
setting char as value outside its range will wrap
2017-03-24 04:35:17 -03:00
Germano Cavalcante
178708f142 Fix of last commit. Clamp values that will be used! 2017-03-24 04:13:16 -03:00
Germano Cavalcante
d23459f516 Fix T51038: layerInterp_mloopcol was casting instead of rounding the interpolated RGBA channels
Casting to int truncates a floating-point number, that is, it loose the fractional part.
2017-03-24 04:06:30 -03:00
Campbell Barton
50f9fc7a53 BLI_path_util: Add BLI_path_join
There weren't any convenient ways to join multiple paths in C
that accounted for corner cases.
2017-03-24 17:40:35 +11:00
Campbell Barton
0453c807e0 Add: BKE_appdir_folder_id_ex
Allows getting the path without using a static string.
2017-03-24 10:35:58 +11:00
Campbell Barton
6a6566a7fc Cleanup: line-length 2017-03-24 10:11:01 +11:00
Campbell Barton
05b7591c62 BLI_path_util: Add string versions of SEP, ALTSEP
This allows for adding separators in string literals.
2017-03-24 05:23:03 +11:00
Jens Verwiebe
e04970b392 Fix player stubs (tm) 2017-03-23 15:47:23 +01:00
Gaia Clary
2c78b0c71f Collada - Export: now use bind_mat and rest_mat custom properties (when the use_bind_info option is enabled and the properties exist) 2017-03-23 14:14:23 +01:00
Gaia Clary
b48ba0909a Collada - Import: now add bind_mat and rest_mat as custom properties (when the use_bind_info option is enabled) 2017-03-23 14:14:23 +01:00
Gaia Clary
476f5c473a Collada - remove no longer used functions (moved to collada_utils) 2017-03-23 14:14:23 +01:00
Gaia Clary
51d4743033 Collada - Added support for custom bind matrix (using new bind_mat custom property) 2017-03-23 14:14:22 +01:00
Gaia Clary
6cfa962986 Collada - removed TransformBase baseclass (not needed for anything) 2017-03-23 14:14:22 +01:00
Gaia Clary
7c094f6079 Collada - Added some helper functions into collada_utils, for common usage in the collada module 2017-03-23 14:14:22 +01:00
Gaia Clary
092d673689 Added new option for storing bindpose matrix, see T50412 2017-03-23 14:14:22 +01:00
Gaia Clary
339d0170d1 collada: Simplify reading Node Matrix 2017-03-23 14:14:22 +01:00
Gaia Clary
1729dd9998 collada: Make sure that bone use_conncet is set to false when connect type is not defined in Import 2017-03-23 14:14:22 +01:00
Gaia Clary
33e32c341a collada: add extern 'C' for c header includes 2017-03-23 14:14:22 +01:00
Gaia Clary
ec3989441f fix: collada - Connected bones get their tails set to wrong location when fix leaf nodes option is enabled 2017-03-23 14:14:22 +01:00
Gaia Clary
1978ac65c4 collada: use local variable to avoid repeated call of bone chain_length_calculator 2017-03-23 14:14:22 +01:00
Gaia Clary
89631485cc collada: use vector copy function instead of direct assigning 2017-03-23 14:14:22 +01:00
Luca Rood
4f4a484b9b Cloth refactor: Remove goal springs and some other cleanup
This removes the goal springs, in favor of simply calculating the goal forces on the vertices directly. The vertices already store all the necessary data for the goal forces, thus the springs were redundant, and just defined both ends as being the same vertex.

The main advantage of removing the goal springs, is an increase in flexibility, allowing us to much more nicely do some neat dynamic stuff with the goals/pins, such as animated vertex weights. But this also has the advantage of simpler code, and a slightly reduced memory footprint.

This also removes the `f`, `dfdx` and `dfdv` fields from the `ClothSpring` struct, as that data is only used by the solver, and is re-computed on each step, and thus does not need to be stored throughout the simulation.

Reviewers: sergey

Reviewed By: sergey

Tags: #physics

Differential Revision: https://developer.blender.org/D2514
2017-03-23 03:52:46 -03:00
Campbell Barton
a63ba2739e Cleanup: remove redundant temp dir init
This is already called by wm_init_userdef, in old code
different initialization methods were used but now it's not needed.

Confusing since prefs are loaded in this function that don't initialize temp.
2017-03-23 15:05:42 +11:00
Campbell Barton
12b62b58e1 Cleanup: minor wm_homefile_read simplification
Logic in this function is a bit scattered,
minor changes to avoid confusion.

Also rename 'from_memory' to 'use_factory_settings'.
2017-03-23 10:42:09 +11:00
Mike Erwin
762319e911 fix redundant assignment
Thanks clang for the warning.
2017-03-22 16:26:53 -04:00
Campbell Barton
d8b34a17ac Cleanup: remove BLI_getlastdir
Replace with BLI_path_name_at_index
2017-03-23 06:33:30 +11:00
Aaron Carlisle
c7a4f96f88 Pydoc: Change Wikipedia links and grammar in mathutils matrix code 2017-03-22 14:54:22 -04:00
Bastien Montagne
2ba1868c3f Cleanup/optimization: Simplify some usages of uiItemFullO/_ptr, avoid multiple search of same op. 2017-03-22 19:42:19 +01:00
Campbell Barton
387ba87ad3 Cleanup: ignore open-blend as startup/prefs basis
No reason startup/prefs would ever be blend-file relative.
2017-03-23 05:24:05 +11:00
Sergey Sharybin
dc5007648c Depsgraph: Fix missing relations update tag when typing #frame
New depsgraph requires relations to be updated after drivers changes.
2017-03-22 14:44:45 +01:00
Alexander Romanov
8563d3b254 Create correct node after image file drag&drop for Blender Render 2017-03-22 12:00:33 +03:00
Campbell Barton
d0253b2ea4 BLI_path_util: add BLI_path_name_at_index
Utility to get a file/dir in the path by index,
supporting negative indices to start from the end of the path.

Without this it wasn't straightforward to get
the a files parent directory name from a filepath.
2017-03-22 19:34:43 +11:00
Campbell Barton
253281f9d6 Fix for splash not opening centered
When the new window didn't end up using the size stored in the preferences
the splash would not be centered (even outside the screen in some cases).

Now centered popups listen for window resizing.
2017-03-22 13:53:54 +11:00
Germano Cavalcante
13d8661503 Fix T51012: Surface modifier was not working with curves
This prevented the Force Field Curve Shape of working
2017-03-20 18:51:32 -03:00
Bastien Montagne
6b86b446d3 Cleanup: useless call to glRasterPos before view3d_cached_text_draw_add()
Probably some leftover from much older code?
2017-03-20 14:36:06 +01:00