Commit Graph

53661 Commits

Author SHA1 Message Date
Sybren A. Stüvel
f226b808ff Alembic: code style 2017-04-06 16:47:00 +02:00
Sybren A. Stüvel
3735065d22 Alembic: don't use m_shapes_type 2017-04-06 16:46:51 +02:00
Sybren A. Stüvel
8fe3f47596 Alembic: more lenient check on absence of sheer & homogeneous scaling
Checking precise values of floats is not a good idea.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
a9504580b3 Alembic: simplified conditional statements 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
997ff4bdc4 Alembic import: nicer progress updates 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
d1696622b7 Alembic import: fixed bug where local matrix from Alembic was used as object matrix
Also renamed AbcObjectReader::readObjectMatrix to
setupObjectTransform, as it does more than just reading the object
matrix; it also sets up an object constraint if the Alembic Xform is
animated.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
818ee188e7 Alembic import: separated reading matrix and getting the appropriate Xform object
Also added a bit better error reporting, instead of silently ignoring
invalid Alembic data.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
e4367ccb78 Alembic import: be more lenient towards unknown object types.
Alembic is an interchange and caching format, that can contain custom
object schemas. Blender shouldn't crash (because of failing asserts) just
because it doesn't know such an object type.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
aba7759992 Alembic: don't call object.getFullName() multiple times. 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
2c688bac19 Alembic: Renamed parent_map to reader_map
It's a mapping from full path of an Alembic object to an AbcObjectReader*.
The fact that at some point it is used to construct parent-child relations
doesn't matter.
2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
152ec791ad Alembic: use typedefs to make it easier to handle maps/vectors 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
85672d29f2 Alembic: more const-ness 2017-04-06 16:04:31 +02:00
Sybren A. Stüvel
02d6df80aa Alembic: fixed importer
The importer was guessing whether an Alembic IXform object was part of a
child object, or should be represented as an Empty in Blender. By reversing
the order in which objects are visited, the children can now claim their
parent as part of the same object (so IPolyMesh claims its parent IXform
as part of the same Blender object). This results in much less guesswork.

I've also removed similar guesswork from the code that sets parent pointers,
by simply searching for the parent in a hierarchical way, instead of trying
to predict (again) which IXforms were turned into empties.

Also, visit_object() now actually visits the object -- previously it only
visited its children, and assumed the object it was called on was already
handled by a previous call.
2017-04-06 16:04:31 +02:00
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