Commit Graph

437 Commits

Author SHA1 Message Date
Campbell Barton
06cc89d744 Fix T43976: Edit-mode crash /w (scene/screen.scene) mismatch 2015-03-16 09:57:15 +11:00
Campbell Barton
6b610500b9 Cleanup: indentation 2015-03-11 13:14:24 +11:00
Campbell Barton
34479d8b63 Snap to Active: missing armature/pose/mball/curve
de-duplicate active center calc between transform & snap-to-selected.
2015-02-23 23:05:54 +11:00
Jorge Bernal
072d80a9de Fix T42858: Non uniform gamelogic names on copy
Use generic function for consistent behavior

D949 by @lordloki
2015-01-29 16:43:20 +11:00
Bastien Montagne
fca515838e Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
Nicholas Bishop
07da01ddb2 Replace explicit object type check with already-existing macro 2014-08-05 10:57:54 -04:00
Sergey Sharybin
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
Bastien Montagne
e0fd1bf432 Fix T41227: Do not select unselectable items when unhiding them! 2014-07-29 12:58:12 +02:00
Campbell Barton
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
Campbell Barton
bb9719b7ab Code cleanup: replace direct operator calls with ED_object_toggle_modes 2014-06-18 16:29:03 +10:00
Campbell Barton
24c7adde0f Code cleanup: de-duplicate flag check in ED_object_toggle_modes 2014-06-18 16:23:50 +10:00
Lukas Tönne
cd60c18be1 Fix T40080: forcefield_toggle_exec() doesn't always enable force field.
Kudos to Brent Baccala for investigating and suggesting a fix.
2014-05-08 08:13:55 +02:00
Campbell Barton
b82d639f3d Stop all dynamic enums using translations (from blend file data) 2014-05-05 15:23:35 +10:00
Campbell Barton
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
Campbell Barton
48446870a8 Code cleanup: remove redundant CTX calls 2014-04-30 08:11:47 +10:00
Campbell Barton
3216e4b202 API Cleanup: Use BKE_constraint prefix for constraint api 2014-04-11 11:47:07 +10:00
Campbell Barton
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
Campbell Barton
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
Campbell Barton
35ed7486c7 Mesh API: rename 'octree' to 'spatial' since internally its using kdtree 2014-03-13 01:49:47 +11:00
Campbell Barton
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
Campbell Barton
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
Bastien Montagne
aeca473a41 Usual UI messages fixes. 2014-01-21 20:18:07 +01:00
Campbell Barton
348cf17448 Code Cleanup: no need to pass empty strings as default values 2014-01-16 22:00:29 +11:00
Campbell Barton
af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
Brecht Van Lommel
8c444958fc Fix T38234: changing smooth/flat shading on linked mesh data should not be allowed. 2014-01-15 16:02:48 +01:00
Campbell Barton
3b024d63fe Text3d: fix font family feature for unicode and correct tooltip 2014-01-06 01:37:19 +11:00
Campbell Barton
6734936c13 RNA API: use bool's for enum itemf callbacks. 2014-01-04 18:10:01 +11:00
Campbell Barton
a5cb2229ab Text3d: avoid converting utf8 to wchar_t in editmode 2014-01-03 14:20:35 +11:00
Campbell Barton
f5076d54cb 'Transform' Python Function for armature, curve and lattice.
patch by Paolo Acampora with some edits.
2013-12-17 23:04:36 +11:00
Campbell Barton
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
Campbell Barton
d232486b40 Fix T37543: Multiline 3D Text saved in edit mode breaks on load 2013-11-21 04:32:28 +11:00
Sergey Sharybin
000312ab51 Remove Surface modifier when removing force field from object
Summary:
Before this adding Surface type of force field and removing
this field would leave Surface modifier alive in the stack.

This might be really misleading and annoying.

Now removing force field will ensure no modifiers needed for
it are remained in the stack.

This also fixes missing notifier to redraw modifier stack
when changing force field type.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D13
2013-11-19 17:19:06 +06:00
Bastien Montagne
6e76152816 Fix [#36846] Adding a cloth sim to an object does not make it possible to go into Particle Mode for that object.
Softbody/cloth were not checked when building available modes enum.
2013-09-30 10:20:54 +00:00
Campbell Barton
3527d2fb27 code cleanup: quiet warnings 2013-09-08 06:05:42 +00:00
Sergey Sharybin
3db1e1eb72 Followup for rev59629.
Condition in pose mode seemd to be inverted, which made it so
pose mode could not be entered.
2013-08-30 10:20:31 +00:00
Campbell Barton
291ad172a1 follow up on r59628, setting modes now ensures that other modes exit first,
this was only done in some cases before and it was possible to enable weightpaint+sculpt at the same time when enabling sculpt by directly running the mode switching operator.

add generic function to ensure a compatible mode before entering the new mode (added to each operators exec function)
2013-08-29 10:34:09 +00:00
Bastien Montagne
f157753120 Fix [#36308] Custom hotkey "Set Object Mode" - "Object Mode" doesn't work properly
There was actually two different issues:
* mode and toggle options had "remanant" values, when e.g. you used MODE_EDIT/toggle, these would be used again with the newly defined keymap (which sets eg MODE_OBJECT/notoggle)... Defining those props as PROP_SKIP_SAVE fixed this.

* Toggling was not supported for MODE_OBJECT, fixed this (can indeed be handy to have a shortcut to toggle between current mode and Object one ;) ).
2013-08-26 15:43:34 +00:00
Sergey Sharybin
785a67f396 Partial revert of recenr cu->disp merge commit
That ended up in tricky code trying to mimic depsgraph
branch behavior API-wise preserving texspace and bound
box calculation compatible with previous releases.

So for now bring cu->disp back to the trunk but keep
texpsace and boundbox APIs the same as in the branch.

This keeps texpsapce and boundbox behavior fully compatible
with previous releases and still makes API the same as
for meshes.
2013-08-21 07:40:19 +00:00
Campbell Barton
68c8530be1 change to object-smooth poll function, no need to check for active object, just check we're not in editmode. 2013-08-12 06:10:29 +00:00
Campbell Barton
fc4a777511 use '_exec' suffix for operator execute callbacks, also picky change to sizeof() use in BLI_array.h 2013-07-28 17:06:31 +00:00
Campbell Barton
9634f8f115 transform was flushing the selection (inline), now skip this and use the selection as-is.
flush the selection on entering editmode instead (since the selection mode can be changed with another mesh).
is other tools leave the selection incorrectly flushed, those will need to be fixed so transform works as expected.
2013-07-22 10:44:24 +00:00
Campbell Barton
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
Campbell Barton
7bb1279279 fix [#35489] mode_set() not working in background mode, Scene change doesn't change mode either 2013-06-02 22:21:45 +00:00
Bastien Montagne
127c39b8a4 Fix for [#35224] Transform Orientation - order inconsistency
Fix turned out to remove as much "manual UI" from 3D view header as possible. Mode selector and all transform manipulators/orientations stuff are now RNA-based UI (leaving basically only edit mesh select modes with custom handlers, as they have some quite specific features).

To achieve this, four main modifications were done:
* enum-operator-generated menus are now MENU (i.e. dropdown lists) in headers too.
* All bit-flag enums expanded in ROW buttons now have a handling consistent with e.g. layers, or what we already have for transform manipulators, i.e. clicking select only one element, shift-click to select multiple ones.
* Consequently, the three RNA booleans manipulators flags are merged into a single bit-flag enum (yes, this is also an API change, though I doubt many scripts use it).
* Now the width of enum-based dropdown lists is computed from longest item name in enum, no more from a dummy place holder string (when no label/name is given).

All this allows to remove some code from 3DView/transform areas, that was actually mostly duplicating RNA/operator one.

Also done a few optimizations here and there (among others, do not pass &numitems to RNA_property_enum_items() when you do not need it, saves at least an iteration over enum items to count them).

Many thanks to Brecht for the reviews!
2013-05-12 13:16:11 +00:00
Campbell Barton
f74201190d code cleanup: remove references to BLI_rand.h 2013-05-08 12:59:35 +00:00
Campbell Barton
37e73aa368 code cleanup: use BKE naming conventions for functions in BKE_editmesh.h and BKE_editmesh_bvh.h 2013-04-16 05:59:48 +00:00
Campbell Barton
6da961775f code cleanup: rename BKE_tessmesh -> BKE_editmesh, rename EditDerivedBMesh.tc -> em. ('tc' is odd name which isn't used elsewhere). 2013-04-13 20:31:52 +00:00
Gaia Clary
9eea6c7057 improved tooltips even more (as discussed in IRC) 2013-04-13 09:32:27 +00:00
Gaia Clary
f181952a28 improved tooltips 2013-04-13 09:27:03 +00:00
Campbell Barton
790374d07d code cleanup: rename editmode functions so we have ED_object_editmode_load/enter/exit 2013-03-21 14:18:17 +00:00