Commit Graph

2168 Commits

Author SHA1 Message Date
ef68faa2f9 Fix T41343, hard to remove group from objects.
Added a small menu with a few helper oerators next to each group panel:

* Remove group from all objects
* Select objects in group

More could be added possibly in the future.

Thanks to Campbell for the advice here.
2014-08-06 20:03:16 +02:00
c9dee2b054 Add some missng casts to the size_t 2014-08-06 20:22:24 +06:00
07da01ddb2 Replace explicit object type check with already-existing macro 2014-08-05 10:57:54 -04:00
Dalai Felinto
7f9a4c0c42 Bake-API: cleanup - missing (size_t) promotion 2014-07-31 20:09:07 -03:00
eb016eb3ae Fix T41258: Crash when entering edit mode while viewport render is enabled
The issue was caused by the render engine loading edit mesh, which re-allocates
mesh array which might be referenced by other object's derived meshed.

Worst thing about this is that updating render engine happens from the end of
scene update function, after all the objects are updated and so. This is needed
so render engine gets the update objects which is correct.

The only proper way to solve the issue is to make it so viewport engine does not
leave objects in inconsistent state, meaning nobody will reference to freed data.

In order to reach this we do edit mesh loading before running objects update so
all the objects which uses that mesh will have proper references in the derived
mesh.

This also solves old creepyness which happened before when having single object
in edit mode. tweaking it will calculate derived mesh as a part of scene update,
then this derived mesh will be freed by edit mesh loading and viewport will be
creating derived mesh again.

Now render engine is expected to do nothing with meshes which are in edit mode,
but they still need to load edit data for non0meshes. It's not really easy to
do from the BKE level because needed functions are implemented in the editor.

Thanks Campbell for the review!

Differential Revision: https://developer.blender.org/D697
2014-07-31 20:25:11 +06:00
Dalai Felinto
9952699978 Bake-API: use size_t instead of width, height
(original patch by Sergey Sharybin)

Note: RNA API can't use size_t at the moment. Once it does this patch
can be tweaked a bit to fully benefit from size_t larger dimensions.
(right now num_pixels is passed as int)

Reviewed By: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D688
2014-07-31 00:35:16 -03:00
b64e36d26d BLI_listbase: consistent name prefix 2014-07-30 15:01:16 +10:00
e0fd1bf432 Fix T41227: Do not select unselectable items when unhiding them! 2014-07-29 12:58:12 +02:00
Dalai Felinto
234ae0b5ac T41196: Python call of bake operator cause Blender Crash
We could make the exec to also show the progress bar, but I think it is not needed.
2014-07-27 10:37:05 -03:00
Dalai Felinto
e0d4047136 Bake-API: Test for cyclic node connection
If the active image node contributes to the final material shader
(meaning it's either directly or indirectly connected to an Output Node)
the user will receive an alert about circular dependency.

Similar to what we do for Blender internal the baking will still happen,
but the user will receive the alert which should prevent the image
saving to happen if the result was not intentional.

Core function to check for node output written by Lukas Toenne.

Reviewers: lukastoenne, campbellbarton

Differential Revision: https://developer.blender.org/D673
2014-07-23 11:46:13 -03:00
8489b94e07 Math Lib: rename mul_serie_m3 to mul_m3_series & reorder args
Importantly, reversed mul_serie_m3 argument order (so it matches the m4 function)
2014-07-21 18:57:35 +10:00
7c7b7302d3 Math Lib: use variable length args for mul_serie_m3,m4 (instead of trailing NULL's) 2014-07-20 14:01:42 +10:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
a04a8039f0 Code cleanup 2014-07-18 11:55:59 +10:00
Dalai Felinto
f46223f29e Bake-API: progress (bar) working
Note: This makes no change to the user, the render engine (Cycles) still
need to update the progress during baking. But this is the Blender side
of this.
2014-07-17 10:30:46 -03:00
10da6ddbee Automatic commit by arc 2014-07-16 14:03:37 +02:00
7eb539c04b Sort vertex groups by Armature Hierarchy
Sort vertex groups by Armature Hierarchy

Reviewers: mont29

Differential Revision: https://developer.blender.org/D649
2014-07-16 14:03:36 +02:00
c04f301fc3 Replace BLI_SMALLSTACK_FREE with fake user (quiet warnings in msvc) 2014-07-12 16:48:52 +10:00
e81b1c54d2 Cleanup: get rid of magic numbers. 2014-07-09 15:12:48 +02:00
330633f063 Fix T40785: "Select Grouped" Pass Index mode is redundant.
Revert "Object Select Similar tool now has a Pass Index option."

This reverts commit 7a6919a74e.
2014-07-08 16:18:04 +02:00
f4cf84507b Fix T40877: Bezier Hook to New Object does not work properly 2014-07-07 13:44:24 +06:00
6cc78927a3 Select Grouped -> KeyingSet for bones also shows error messages now when the Keying Set is inappropriate 2014-07-04 00:09:36 +12:00
241a9b5c6e Fix T40823 LoD Add and Remove crash without valid object
Changed the polling method used for both the add and remove LoD operators
to a more appropriate one.
2014-07-02 06:12:31 -07:00
481e8ab3c9 Fix: NLA editor not being updated on using "Make Links" (Ctrl)+(L). We're emitting a ND_NLA_ACTCHANGE signal now to make that work.
Found while documenting the NLA for my upcoming book
2014-06-29 14:22:09 +02:00
33e8451d4b Better description for the "make links" operator.
This is a misnomer: the operator copies data (mostly pointers) of
various types from the active to selected objects. "Make Link" implies
creating a permanent connection between these objects ...
2014-06-26 10:41:54 +02:00
a4d9c8f579 Code cleanup: casts, dead assignment & arg order. 2014-06-26 15:46:42 +10:00
8d6f546f32 Whitespace fix 2014-06-26 14:42:36 +12:00
11e0dddf91 Bugfix T40801: Select grouped objects by Keying Set not working with builtin Keying Sets
Most of the default builtin Keying Sets (e.g. Loc, Rot, Available, etc.) depend
on the currently selected objects, making them unsuitable for use with this feature.
As a result, this feature would silently fail. This commit adds some error messages
which at least let users know what's going on so that they can make other plans
2014-06-26 14:39:44 +12:00
95d6c01478 Fix T40756 Select Linked by Particle System matches ignores selected
psys.

This is inconsistent with other comparable cases like materials, where
the active slot is used to define matching objects.
2014-06-23 08:22:42 +02:00
7bc2f54867 Code cleanup: style 2014-06-22 15:02:27 +10:00
Dalai Felinto
b49e6d04cc Bake-API: small cleanup to prevent unfreed memory when there are baking errors
Fix to be included in 2.71
2014-06-18 19:46:37 -03:00
Dalai Felinto
9cf66d9248 Bake-API: fix for non-NORMAL maps baking black when using cage
Reported by Andy Davies (metalliandy) outside the tracker
Fix to include in 2.71
2014-06-18 19:32:14 -03:00
Dalai Felinto
a3cf97e2aa Fix T4068787 Cycles Bake Selected To Active From Non-Mesh Object Fails With Error
Users can now bake from Mesh, Font, Curve, Surface and Metaballs.
Fix to include in 2.71
2014-06-18 19:20:46 -03:00
bb9719b7ab Code cleanup: replace direct operator calls with ED_object_toggle_modes 2014-06-18 16:29:03 +10:00
24c7adde0f Code cleanup: de-duplicate flag check in ED_object_toggle_modes 2014-06-18 16:23:50 +10:00
Dalai Felinto
fd0b74280e Bake-API: allow custom UV to be baked
Note: the custom UV option is only available when calling the operator
via a script. It's currently not exposed in the UI since it's intended
to be used by scripters

To test it:
bpy.ops.object.bake(type='UV', use_clear=True, uv_layer='MyNewUV')

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D546
2014-06-17 12:16:43 -03:00
Dalai Felinto
2b7ff6de06 Bake-API: increase cage extrusion/ray distance limit
Fix to include in 2.71 (asked via BlenderArtist)
2014-06-13 15:55:05 -03:00
Dalai Felinto
b0708dd718 Bake-API: handle objects with no faces (fix T40601)
Also it has a better error handling for the BVHTree creation
Fix for 2.71
2014-06-13 14:37:59 -03:00
bf462149a6 BLI_bitmap: rename macros
- BLI_BITMAP_SET -> BLI_BITMAP_ENABLE
- BLI_BITMAP_CLEAR -> BLI_BITMAP_DISABLE
- BLI_BITMAP_GET -> BLI_BITMAP_TEST
- BLI_BITMAP_MODIFY -> BLI_BITMAP_SET
2014-06-14 00:47:12 +10:00
Dalai Felinto
aed67dc8a4 Bake-API: Set Custom Cage to be Cage Object
Suggestion by Andy Davies (metalliandy) to conform with industry standard (custom cage is something else apparently)

Note: this is the last bake related commit I plan for 2.71/rc (unless
everyone agrees that we could squeeze in D546 - custom UVs, which would
be really nice to add for 2.71 scripters)

Note 2: I'll update the wiki docs shortly
2014-06-11 22:49:30 -03:00
Dalai Felinto
a8a536d23d Bake-API: new approach for cage
There is a new option to select whether you want to use cage or not.
When not using cage the results will be more similar with Blender
Internal, where the inwards rays (trying to hit the highpoly objects)
don't always come from smooth normals. So if the active object has sharp
edges and an EdgeSplit modifier you get bad corners.

This is useful, however, to bake to planes without the need of adding
extra loops around the edges.

When cage is "on" the user can decide on setting a cage extrusion or to
pick a Custom Cage object. The cage extrusion option works in a
duplicated copy of the active object with EdgeSplit modifiers removed to
inforce smooth normals. The custom cage option takes an object with the
same number of faces as the active object (and the same face ordering).

The custom cage now controls the direction and the origin of the
rays casted to the highpoly objects. The direction is a ray from the
point in the cage mesh to the equivalent point to the base mesh. That
means the face normals are entirely ignored when using a cage object.

For developers:
When using an object cage the ray is calculated from the cage mesh to
the base mesh. It uses the barycentric coordinate from the base mesh UV,
so we expect both meshes to have the same primitive ids (which won't be
the case if the cage gets edited in a destructive way).

That fixes T40023 (giving the expected result when 'use_cage' is false).

Thanks for Andy Davies (metalliandy) for the consulting with normal
baking workflow and extensive testing. His 'stress-test' file will be
added later to our svn tests folder. (The file itself is not public yet
since he still has to add testing notes to it).

Many thanks for the reviewers.

More on cages:
http://wiki.polycount.com/NormalMap/#Working_with_Cages

Reviewers: campbellbarton, sergey

CC: adriano, metalliandy, brecht, malkavian

Differential Revision: https://developer.blender.org/D547
2014-06-11 02:39:35 -03:00
Dalai Felinto
ddf5ef0401 correction from last commit 2014-06-10 21:36:48 -03:00
Dalai Felinto
8a90edca86 Bake-API: removal of unecessary UV tests, as suggested by Campbell Barton 2014-06-10 20:51:34 -03:00
ae4ed68dfe Code cleanup: style 2014-06-06 07:54:05 +10:00
Dalai Felinto
6f1a64830a Bake-API small cleanup 2014-06-03 02:14:28 -03:00
Dalai Felinto
5f3c8cf72d Fix T40476 - Baking multiple selected objects in Cycles final result
depends on last selected object

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D577
2014-06-03 02:14:12 -03:00
Dalai Felinto
b7eff584b0 Bake-API prevent baking for engines that dont support the baking API
In the future we can fallback to the Blender Internal baking.

Review/Suggestions by Campbell Barton
2014-06-03 02:10:47 -03:00
Dalai Felinto
2a9efa4e51 Bake-API: Support for batch baking
When "Selected to Active" is not on, we bake all the selected objects.
This is the same behaviour we have for Blender Internal.

Dev note: I moved most of the validation tests to outside the bake()
routine so the function can be called in loop.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D560
2014-05-29 22:56:57 -03:00
Dalai Felinto
2057a3a2fc Proper fix T40156 Cycles Baking and applyRotation issues
This should be the final fix for the applyrotation issue. It baffles me
that the fix involves discarding the scale transformations for the
normals but it works so I'm happy with it.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D554
2014-05-29 12:20:55 -03:00
3a41797df4 Usual UI messages tweaks. 2014-05-26 20:12:03 +02:00