Commit Graph

545 Commits

Author SHA1 Message Date
865796375b Cleanup: avoid incrementing/decrementing id->us outside of BKE_library.
We have callbacks for that, they also do some checks and help ensure things are done
correctly. Only place where this is assumed not true is blenloader (since here we
may affect refcount of library IDs as well...).
2015-11-09 21:00:53 +01:00
333feea6e9 Fix T45258, impossible to select brush when removing it from 2d
painting.

Also system added a brush every time it found no paint brush in the
system which is not what we would want.

Solution:
* Brush panel stays visible always, regardless of whether there is a
brush or not.
* We search for first available brush when we find no brush in paint
struct instead of always generating a new one.
* Generating and searching for a brush take a mode argument now. Needed
some refactoring to users of BKE_paint_init as well.
* Did some style cleanups for paint mode enums.

Patch is big but it's mostly argument refactoring.
2015-08-31 22:00:30 +03:00
2e2dc9b9e3 Refactor translation code out of blenfont
- Add blentranslation `BLT_*` module.
- moved & split `BLF_translation.h` into (`BLT_translation.h`, `BLT_lang.h`).
- moved `BLF_*_unifont` functions from `blf_translation.c` to new source file `blf_font_i18n.c`.
2015-08-18 07:01:26 +10:00
9f48aa45ad BGE: added clamping of angular velocity.
Angular velocity clamping was missing from the BGE. It is implemented
similarly to the linear velocity clamping. It is needed to be able to
drive physical simulations of systems that have a limited rotational
speed.

Reviewed by: campbellbarton, panzergame, ton

Differential Revision: https://developer.blender.org/D1365
2015-06-28 12:54:53 +02:00
0305e9604b Fix RNA type access 2015-05-25 00:08:43 +10:00
31f0c27ae7 Depsgraph: Add additional relations/id update tags
This calls are not strictly speaking needed for the old dependency graph, but
due to more granular nature of upcoming depsgraph more actions requires update
of relations of IDs.

On the one hand this extra tags could be wrapped with if() statements, but on
the other hand it makes sense to keep tag in sync so it's clear if some issue
is caused by missing/extra tag or by depsgraph itself.
2015-05-12 16:06:36 +05:00
Julian Eisel
798facbff3 Fix crashes when moving game property with invalid index (from py/redo
panel)

Also hides index option in redo panel to be consistent with similar
operators
2015-04-22 17:20:10 +02:00
a8adeeb6fb Logic Editor: Buttons for moving game properties up/down
D1163 by @panzergame, with minor edits by me (@Severin)
2015-04-21 23:33:45 +02:00
06cc89d744 Fix T43976: Edit-mode crash /w (scene/screen.scene) mismatch 2015-03-16 09:57:15 +11:00
6b610500b9 Cleanup: indentation 2015-03-11 13:14:24 +11:00
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
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
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
07da01ddb2 Replace explicit object type check with already-existing macro 2014-08-05 10:57:54 -04: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
e0fd1bf432 Fix T41227: Do not select unselectable items when unhiding them! 2014-07-29 12:58:12 +02:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10: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
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
b82d639f3d Stop all dynamic enums using translations (from blend file data) 2014-05-05 15:23:35 +10:00
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
48446870a8 Code cleanup: remove redundant CTX calls 2014-04-30 08:11:47 +10:00
3216e4b202 API Cleanup: Use BKE_constraint prefix for constraint api 2014-04-11 11:47:07 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
35ed7486c7 Mesh API: rename 'octree' to 'spatial' since internally its using kdtree 2014-03-13 01:49:47 +11:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
aeca473a41 Usual UI messages fixes. 2014-01-21 20:18:07 +01:00
348cf17448 Code Cleanup: no need to pass empty strings as default values 2014-01-16 22:00:29 +11:00
af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
8c444958fc Fix T38234: changing smooth/flat shading on linked mesh data should not be allowed. 2014-01-15 16:02:48 +01:00
3b024d63fe Text3d: fix font family feature for unicode and correct tooltip 2014-01-06 01:37:19 +11:00
6734936c13 RNA API: use bool's for enum itemf callbacks. 2014-01-04 18:10:01 +11:00
a5cb2229ab Text3d: avoid converting utf8 to wchar_t in editmode 2014-01-03 14:20:35 +11:00
f5076d54cb 'Transform' Python Function for armature, curve and lattice.
patch by Paolo Acampora with some edits.
2013-12-17 23:04:36 +11:00
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
d232486b40 Fix T37543: Multiline 3D Text saved in edit mode breaks on load 2013-11-21 04:32:28 +11:00
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
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
3527d2fb27 code cleanup: quiet warnings 2013-09-08 06:05:42 +00:00
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
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
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
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
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
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
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
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00