1
1

Compare commits

...

332 Commits

Author SHA1 Message Date
a5b4b0f21c Merge branch '28' into custom-manipulators 2017-10-09 20:49:27 +11:00
d68f698cf0 Merge branch '28' into custom-manipulators 2017-06-26 19:38:40 +10:00
a513f1c97e Merge branch '28' into custom-manipulators 2017-06-26 15:47:40 +10:00
5eadb457fd Manipulator: add range_get callback 2017-06-26 15:45:11 +10:00
1ec6c5b4d1 Merge branch '28' into custom-manipulators 2017-06-26 15:10:59 +10:00
5b555dc28a Docs: Manipulator.target_set_handler docstring
Also generalize checks for callable args
2017-06-26 14:18:46 +10:00
7ba53e900f Building without Python works again 2017-06-26 13:59:55 +10:00
6d7f0acf08 Merge branch '28' into custom-manipulators 2017-06-26 13:50:41 +10:00
5eca16cf8b Manipulator: templates/examples for Py-API 2017-06-26 13:14:23 +10:00
085bb4cc82 Merge branch '28' into custom-manipulators 2017-06-26 08:41:35 +10:00
120bd4a729 Merge branch '28' into custom-manipulators 2017-06-26 08:30:57 +10:00
d1639ec787 Manipulator: add Manipulator.target_set_operator
Expose WM_manipulator_set_operator to RNA
2017-06-26 07:56:43 +10:00
e0ec4ab09a Merge branch '28' into custom-manipulators 2017-06-23 17:25:33 +10:00
a879546528 Merge branch '28' into custom-manipulators 2017-06-23 16:49:11 +10:00
e3db258efd Manipulator: Name access 2017-06-23 16:18:31 +10:00
0997fd51e2 Merge branch '28' into custom-manipulators 2017-06-23 15:57:23 +10:00
82d79f1feb Manipulator: expose matrix, scale & flags via RNA 2017-06-23 15:42:55 +10:00
6ea3408e4b Merge branch '28' into custom-manipulators 2017-06-23 14:51:22 +10:00
c2711c6f48 Merge branch '28' into custom-manipulators 2017-06-23 11:21:43 +10:00
1b494fff49 Merge branch '28' into custom-manipulators 2017-06-23 09:21:00 +10:00
b4f354e668 Merge branch '28' into custom-manipulators 2017-06-22 18:40:21 +10:00
1b9399f446 Remove counter of set properties, just check when needed 2017-06-22 18:24:25 +10:00
b4cceaa51c Merge branch '28' into custom-manipulators 2017-06-22 18:13:45 +10:00
4d9eb2c589 RNA/Python API for defining py-manipulator callbacks 2017-06-22 18:05:20 +10:00
e3c2b45138 Cleanup: remove redundant user_data arg
This is already accessible from the property
2017-06-22 14:05:39 +10:00
5ac5729ea7 Remove unneeded length arg
Was also missing assignment to wmManipulatorProperty.type
2017-06-22 13:58:10 +10:00
d8a3400d55 Remove length argument since it's stored in the property 2017-06-22 11:36:31 +10:00
b2f1b1bc31 Missed in last commit 2017-06-22 11:31:37 +10:00
ce4e980d3d Manipulator: properties into 'wmManipulator'
We normally only have one or two, don't have a separate linked list.
Also store type in the property.
2017-06-22 09:40:24 +10:00
e8a04a5a18 PyAPI: Add Manipulator.target_prop_set_property
RNA method for Python to call into C or Py defined manipulators.
naming might change.
2017-06-22 07:49:24 +10:00
ab6411e32c Python support for manipulator target-property definitions
Note that these aren't used at the moment.
2017-06-21 21:10:17 +10:00
c394c9506c Merge branch '28' into custom-manipulators 2017-06-21 17:12:04 +10:00
b483e937a1 Merge branch '28' into custom-manipulators 2017-06-21 14:14:50 +10:00
7966a7baa9 Revert change that added screen to manipulator-map
Temporary screens caused a crash here,
if we can't assume an area will never have its screen changed
better not store a back-pointer.

This makes `rna_ManipulatorProperties_find_operator` search even more
exhaustive. Not nice but hard to avoid :S
2017-06-21 13:24:56 +10:00
f410b18832 PyAPI: minor improvement to type check 2017-06-21 13:23:40 +10:00
695a824595 Merge branch '28' into custom-manipulators 2017-06-21 12:45:02 +10:00
a355197f13 Merge branch '28' into custom-manipulators 2017-06-21 12:23:10 +10:00
bc50631490 Use id-properties for manipulator type data 2017-06-20 15:41:57 +10:00
754925e518 Remove unneeded library 2017-06-20 04:54:57 +10:00
ebf99c6788 Merge branch '28' into custom-manipulators 2017-06-20 04:47:20 +10:00
9e3df0d223 Merge branch '28' into custom-manipulators 2017-06-20 04:13:42 +10:00
ab1af7b3e5 Merge branch '28' into custom-manipulators 2017-06-19 20:22:36 +10:00
0956b09d95 Merge branch '28' into custom-manipulators 2017-06-19 20:21:57 +10:00
f37137cd0b Merge branch '28' into custom-manipulators 2017-06-19 16:58:56 +10:00
726127d0dd Merge branch '28' into custom-manipulators 2017-06-18 01:48:57 +10:00
df541af546 RNA: remove manipulator arg
There is no need since 'self' is the manipulator.
(was left in from these callbacks being attached to manipulator-group).
2017-06-17 10:37:51 +10:00
444914d2a5 RNA wrap wmManipulator.setup callback 2017-06-17 10:27:29 +10:00
1f188d7a1c Merge branch '28' into custom-manipulators 2017-06-17 10:24:50 +10:00
11a74ada7d Merge branch '28' into custom-manipulators 2017-06-16 08:53:29 +10:00
359698b05f Very minor edit (2.8 sync) 2017-06-16 08:46:56 +10:00
f16c595486 Missed in recent removal of face-maps 2017-06-16 08:44:07 +10:00
5e2583a836 Remove face-map / armature integration
Since we're unlikely to use this, it's tedious to keep so many
differences from 'blender2.8' branch.

Currently the only difference between this
branch and 2.8 is RNA/Python work-in-progress integration.
2017-06-16 08:02:25 +10:00
e5a9a4fc6a Merge branch '28' into custom-manipulators 2017-06-16 07:41:42 +10:00
960b32a84c Initial bisect widget
Uses view 3d manipulator option
2017-06-16 06:55:49 +10:00
74ed086b10 Merge branch '28' into custom-manipulators 2017-06-16 06:29:27 +10:00
643df8fdab Add support for delayed removal
This is needed so manipulators can tag themselves for removal
without causing problems from freeing data within a callback.

Also use properties within the dial manipulator and fix an error where
removing a wmManipulatorGroupType didn't remove its keymap.
2017-06-16 06:24:42 +10:00
ff157b2d12 Merge branch '28' into custom-manipulators 2017-06-16 01:33:50 +10:00
4f063b1e9a Merge branch '28' into custom-manipulators 2017-06-15 21:05:12 +10:00
bbfa2f361c Merge branch '28' into custom-manipulators 2017-06-15 20:27:11 +10:00
c3e588455a Dial manipulator didn't have a modal callback
Until 3d-viewport manipulators change functionality we need to it
working how it already is.

So add modal operator which is called from draw when there are no
properties applied to the manipulator.

This will be needed to have a general rotation manipulator.
2017-06-15 20:20:35 +10:00
28d623f95d Don't use undo for manipulator tweak operator
This causes problems when tweaking an operator
2017-06-15 06:07:13 +10:00
748d06ae5a Fix divide by zero dragging the arrow 2017-06-15 06:06:45 +10:00
58526b3bec Cleanup: remove redundant access function 2017-06-15 05:33:49 +10:00
e70f887534 Cleanup: use consistent abbreviation for manipulator vars 2017-06-15 02:45:17 +10:00
1c20d194e1 Manipulator Properties
- Add a different kind of properties that use function callbacks
  instead of RNA.
  Needed for situations when there isn't 1:1 correspondence
  between the manipulator's position and the internal value.
- Move manipulator properties into their own file.
2017-06-15 02:44:22 +10:00
0e44c1af38 Merge branch 'blender2.8' into custom-manipulators 2017-06-14 17:19:01 +10:00
e073bb66bd Cleanup: rename callbacks 2017-06-14 16:27:44 +10:00
5530aa6aaa Cleanup: remove DNA_manipulator_types.h 2017-06-14 04:14:32 +10:00
6bb897a76d Cleanup, rename callbacks 2017-06-14 03:19:53 +10:00
98bcc65543 Edit to last commit, add string versions of add-remove 2017-06-14 02:50:42 +10:00
aff22a4b39 RNA/Py API for runtime add/remove
WindowManager.manipulator_group_type_add/remove
2017-06-14 02:37:02 +10:00
b37c589319 Further changes to manipulator API's.
These changes are intended for operators to register their own
widget-types temporarily, so _every_ operator that uses manipulators
doesn't need to keep them continuously polling the view to check if the
operator is running.

- Register `wmManipulatorGroupType` globally (like all other RNA types).
- Add `wmManipulatorGroupTypeRef` for type-maps to reference groups.
- Remove `wmManipulatorMapType.idname` (spaceid & regionid are enough info).
- Add PERSISTENT flag for `wmManipulatorGroupType`
  intended for use with operators so loading a new file for eg doesn't
  keep the manipulator type around.
2017-06-14 00:04:35 +10:00
7dd24427ef Move manipulator type API into its own file 2017-06-13 17:47:45 +10:00
0b1e9ff65d Support dynamic registration w/ RNA widget types
Dynamically registered types are now correctly initialized in each view.
2017-06-13 16:48:59 +10:00
04f7eca61a Remove unused register+init functions
This needs to be split out for dynamic registered types anyway.
2017-06-13 15:15:09 +10:00
ea4ffbe0e9 Merge branch '28' into custom-manipulators 2017-06-13 14:18:59 +10:00
a27e361495 Merge branch '28' into custom-manipulators 2017-06-12 14:44:46 +10:00
af2a93a94e Merge branch '28' into custom-manipulators 2017-06-10 15:34:22 +10:00
fa1145d475 Cleanup: consistent naming
Use shorter names for manipulator
2017-06-10 10:20:54 +10:00
e24950052b Merge branch '28' into custom-manipulators 2017-06-10 09:18:56 +10:00
072f3c5723 Replace array of properties with a named list
This is useful for Py/RNA access.

Add support for indexing arrays too.
2017-06-10 09:16:43 +10:00
37f8c03ab3 Add arrow and dial manipulators with RNA access 2017-06-09 20:41:17 +10:00
e15cde73b1 Merge branch 'blender2.8' into custom-manipulators 2017-06-09 19:51:59 +10:00
98e50c0881 RNA: Expose face-map manipulator to Python 2017-06-09 16:28:47 +10:00
b93e52d752 Missed last commit 2017-06-09 15:55:27 +10:00
8b91a7e8e9 Rename intersect callback to test_select
Be specific since this isn't for general intersection tests.
2017-06-09 15:51:59 +10:00
3e0a09f604 Cleanup: shorten struct member names
For wmManipulatorMap the its clear from the context we're
operating on manipulators.
2017-06-09 15:40:37 +10:00
48115c08e0 Remove unused widget/operator integration
While this is a useful feature, current integration is untested
and stored the operator in the wmManipulatorGroupType
instead of its instance.
2017-06-09 14:52:48 +10:00
ee36ae1356 Expose wmManipulatorGroupType.setup & refresh callbacks 2017-06-09 14:32:38 +10:00
44a8616084 Rename RNA wrapper calls 2017-06-09 07:39:37 +10:00
3e62e9101c Fix for manipulator identifier string duplication
Also no need for static buffers
2017-06-09 06:03:04 +10:00
ebcde286d8 Expose wmManipulatorGroup.bl_options 2017-06-09 05:24:42 +10:00
409756e65f Cleanup, naming (init and Python's __init__ too similar) 2017-06-09 04:51:05 +10:00
f5a0199a70 Merge branch '28' into custom-manipulators 2017-06-09 04:25:23 +10:00
e9c022b7d3 Using default keymap now works for RNA manipulators
All widget groups must now define a name and idname.

Also fix crash where keymap's wouldnt be initialized for runtime
registered types.
2017-06-09 04:21:45 +10:00
070dd04a2a Cleanup widget API
Rename handler -> modal (matches operator)
2017-06-09 00:13:32 +10:00
123af0cd5f Unregister support for manipulator type 2017-06-08 21:32:02 +10:00
17ff2ab254 RNA: Add registerable wmWidgetType
Works on a basic level - creating Python widgetgroups and widgets, drawing.
Still lots more to do though.
2017-06-08 19:26:21 +10:00
c7612fca5f Merge branch '28' into custom-manipulators 2017-06-08 08:05:30 +10:00
7783645c9f Merge branch '28' into custom-manipulators 2017-06-08 05:36:15 +10:00
d0aa8af9c9 Add wmManipulatorType, extract from wmManipulator
Having the type in mixed in with instance
made it hard to expose types to RNA/Python.

This disables face-map select,
we could enable it but it looks like face maps will be made to work
differently.
2017-06-08 05:02:39 +10:00
3159f14daa Rename py API files
Will use for manipulator and manipulatorgroup.
2017-06-08 00:20:46 +10:00
99e9e4c5ca Merge branch '28' into custom-manipulators 2017-06-08 00:07:48 +10:00
8d8ae5cb16 Sync with 2.8, various minor redundant changes 2017-06-07 23:28:20 +10:00
e6b7e9942e sync with 2.8 2017-06-07 22:27:36 +10:00
d68f80182b Merge branch '28' into custom-manipulators 2017-06-07 22:22:09 +10:00
008e16c83e WM: move manipulator API into its own files
Getting to be a hassle to track multiple manipulator classes
and callbacks.
2017-06-07 22:01:30 +10:00
421beeb6e4 WM: add box preset and expose colors 2017-06-07 21:25:16 +10:00
8671b44fe5 Merge branch '28' into custom-manipulators 2017-06-07 15:54:53 +10:00
560ecfac4e RNA wrap other functions 2017-06-07 03:22:22 +10:00
ca137a25e8 Merge branch 'blender2.8' into custom-manipulators 2017-06-06 23:08:51 +10:00
ecdd76c91a WM: remove unused return values 2017-06-06 23:04:46 +10:00
ab1e87260f Merge branch 'blender2.8' into custom-manipulators 2017-06-06 22:19:24 +10:00
058aa20bb1 Merge branch 'blender2.8' into custom-manipulators 2017-06-06 20:11:26 +10:00
c681902bc8 PyAPI: Initial manipulator API
Only expose new/remove/clear & manipulator_draw function.
2017-06-06 17:33:35 +10:00
a45ca3c724 Merge branch 'blender2.8' into custom-manipulators 2017-06-06 17:13:58 +10:00
af32502dec Merge branch 'blender2.8' into custom-manipulators 2017-06-06 16:55:50 +10:00
97f023fb2d WM: functions for assigning all manipulator callbacks
- move callbacks into type struct
- rename render_3d_intersection -> draw_select
- add header for function signatures (needed for types and api headers).
2017-06-06 16:53:12 +10:00
8abe421a0f Merge branch 'blender2.8' into custom-manipulators 2017-06-06 03:56:46 +10:00
a28d2a16b7 Use term 'manipulator' for RNA instead of 'widget'
Annoying to have different names for RNA/DNA.
2017-06-05 23:33:32 +10:00
d4c06d6505 PyAPI: postpone initializing widget-group
Py callbacks don't work when class is in middle of registration.
2017-06-05 22:59:43 +10:00
a8b50c1689 PyAPI: widget group (un)register working again
WIP, not yet usable.
2017-06-05 22:11:38 +10:00
f8fe811987 Merge branch 'blender2.8' into custom-manipulators 2017-06-05 18:27:42 +10:00
f5e1b21895 Merge branch 'blender2.8' into custom-manipulators 2017-06-05 14:53:47 +10:00
3db43918d2 Fix from merge 2017-06-03 00:41:15 +10:00
afa27f13e3 Merge branch 'blender2.8' into custom-manipulators 2017-06-03 00:00:17 +10:00
Dalai Felinto
7a5098f78e Fix blenderplayer build (ED_object_facemap*) 2017-06-01 12:45:23 +02:00
Dalai Felinto
6b77aba9fc Merge remote-tracking branch 'origin/blender2.8' into custom-manipulators 2017-06-01 12:43:38 +02:00
7d903fea7d Merge branch '28' into custom-manipulators 2017-06-01 19:42:08 +10:00
a0c668d8ed Merge branch '28' into custom-manipulators 2017-06-01 17:43:42 +10:00
ad0690f78f Missed when removing face-map DNA 2017-06-01 14:56:12 +10:00
562d137e39 Merge branch '28' into custom-manipulators 2017-06-01 14:05:44 +10:00
863f389222 Merge branch '28' into custom-manipulators 2017-06-01 02:29:24 +10:00
50081bba77 Face-map bone parent support 2017-06-01 00:43:18 +10:00
0e7d8ddb1e Merge branch '28' into custom-manipulators 2017-05-31 23:30:56 +10:00
8745042282 Fix face-map button being greyed out 2017-05-31 17:02:08 +10:00
6b88a00b24 Fix selecting bones 2017-05-31 16:59:48 +10:00
a1a61547db Ensure pose-mode cache exists
Files that were saved in pose-mode or selecting pose bones,
would have invalid cache.
2017-05-31 16:39:15 +10:00
6639765e5e Merge branch 'blender2.8' into custom-manipulators 2017-05-31 15:04:02 +10:00
1dec6bb10b Merge branch 'blender2.8' into custom-manipulators 2017-05-31 01:34:45 +10:00
82270f208d fmap-only option now only works with active object
This may change but for now match clay/eevee.
2017-05-30 19:55:42 +10:00
b7871351f6 Limit only face-map option to active-pose armature 2017-05-30 19:13:19 +10:00
cf170445b8 Show only face-map now works in clay/eevee engines 2017-05-30 19:03:10 +10:00
138e821f64 Merge branch 'blender2.8' into custom-manipulators 2017-05-30 18:30:55 +10:00
Dalai Felinto
59429dbaf9 Fix typo 2017-05-30 10:19:40 +02:00
2045b4b5ef Sync with 2.8 2017-05-30 17:40:38 +10:00
79d34f4fde Minor edits 2017-05-30 17:36:05 +10:00
e109fdea5a Missed while updating custom-data again! 2017-05-30 17:30:22 +10:00
44b99ba9b0 Rename object_fmap -> object_facemap_ops
Also ED_fmap -> ED_object_facemap
2017-05-30 17:23:13 +10:00
fc24b039db Remove face-maps from GPU buffer
We wont use this long-term so remove to make merge easier.
2017-05-30 17:03:23 +10:00
e32e317a61 Missed CD update re-using PolyIndex 2017-05-30 16:51:35 +10:00
8c8d752f96 Cleanup: use BKE_object_facemap_* prefix for face-map operations 2017-05-30 16:38:03 +10:00
42160fd180 Rename facemaps -> object_facemaps
Since face-maps are just a property of objects, like BKE_object_deform.h
2017-05-30 16:29:43 +10:00
4d71af8bc4 Re-use poly-index layer for face-map
Poly index was used for a short time when switching to BMesh.

This is practically the same kind of data,
any inconsistency between object face-maps will need to be supported
anyway - since object & mesh might span blend-files.
2017-05-30 16:10:26 +10:00
ca87117afe Add missing NULL check (face-map might not have a bone) 2017-05-30 16:10:13 +10:00
02bed8fcbf Accidentally removed last commit 2017-05-30 15:55:58 +10:00
65b374087a Remove face-map DNA from pose-channels
Manually setting up links per bone to an object & facemap is tedious.

It's also going to cause quiet a bit of book-keeping internally to
ensure its always valid (linking, adding removing objects proxies).

Instead match the face-maps names to bones (as with vertex groups).
The DNA members have been moved into runtime cache.

This also adds an option for bones to use facemaps,
to avoid excessive searching on heavy armatures that might use very few
(if any) face-maps.
2017-05-30 15:46:20 +10:00
21ebc593f2 Merge branch 'blender2.8' into custom-manipulators 2017-05-30 12:35:44 +10:00
704b1bf7f0 Use face-group color 2017-05-30 01:49:06 +10:00
0ed4570bad Basic face-map drawing
No alpha yet, need to investigate
2017-05-30 00:43:20 +10:00
d8bd5217bf Merge branch 'blender2.8' into custom-manipulators 2017-05-29 22:12:40 +10:00
2772fdf402 Merge branch 'blender2.8' into custom-manipulators 2017-05-29 21:06:02 +10:00
9a4ca03cfd Only show backdrop manipulator when its enabled 2017-05-29 21:03:48 +10:00
4570d44c4e Fix node backdrop manipulator 2017-05-29 15:17:31 +10:00
acf6db7e2b Update to use GPU matrix 2017-05-29 14:40:36 +10:00
1658b5ef05 Merge branch '28' into custom-manipulators 2017-05-29 14:30:37 +10:00
9f466a4f97 Merge branch 'blender2.8' into custom-manipulators 2017-05-29 12:22:04 +10:00
0393e6b08d Merge branch 'blender2.8' into custom-manipulators 2017-04-14 17:21:26 +10:00
7f753eadb4 Merge branch 'blender2.8' into custom-manipulators 2017-04-12 21:06:25 +10:00
d982ab4260 Merge branch 'blender2.8' into custom-manipulators 2017-04-09 16:15:22 +10:00
a1a4f58726 Add back widgets accidentally lost in merge (facemaps usable again) 2017-04-08 12:33:18 +10:00
51223284e1 Merge branch 'blender2.8' into custom-manipulators 2017-04-08 12:10:36 +10:00
039fcb524e Merge branch 'blender2.8' into custom-manipulators 2017-04-08 12:02:44 +10:00
f4a3689492 Merge branch 'blender2.8' into custom-manipulators 2017-04-08 11:33:24 +10:00
7fee1af6c8 Merge branch 'blender2.8' into custom-manipulators 2017-04-07 23:04:10 +10:00
d30f313141 Merge branch 'blender2.8' into custom-manipulators 2017-04-07 21:44:21 +10:00
Dalai Felinto
0887703616 OpenGL: Port wm_manipulator_geometryinfo_draw
Thanks to Clément Foucault for the help with the Batch API!
2017-04-07 12:33:00 +02:00
Dalai Felinto
3b3901a964 Fix wm_manipulators.c wrongly include of GL/GLEW.h 2017-04-07 12:32:11 +02:00
Dalai Felinto
70391ff991 OpenGL: Port arrow_manipulator.c to gawain
The conversion of wm_manipulator_geometryinfo_draw is still pending.
2017-04-07 12:28:42 +02:00
a814294044 Merge branch 'blender2.8' into custom-manipulators 2017-04-07 14:38:23 +10:00
820961d4ed Remove redundant headers 2017-04-07 01:02:51 +10:00
4d3efa6419 Merge branch 'blender2.8' into custom-manipulators 2017-04-07 00:05:32 +10:00
212c57c1c7 remove unused var 2017-04-06 20:52:35 +10:00
42467c884f Merge branch 'blender2.8' into custom-manipulators 2017-04-06 20:21:07 +10:00
8c01b2da98 Minor sync with master 2017-04-06 20:12:55 +10:00
5e2c9e87cb revert file rename (since these are in 2.8x already) 2017-04-06 19:48:59 +10:00
7be09871d3 Update widget exporter 2017-04-06 17:29:11 +10:00
cf1d476a10 Accidentally left this in last commit 2017-04-06 17:26:07 +10:00
6444572c46 Cleanup: only expose base struct for manipulator geometry 2017-04-06 16:33:06 +10:00
ccc5a8757b Cleanup: rename file 2017-04-06 15:43:59 +10:00
e1567156c5 Merge branch 'blender2.8' into custom-manipulators 2017-04-06 15:22:16 +10:00
c320172a8b Remove redundant includes 2017-04-06 13:12:50 +10:00
c49a84e48d Remove manipulator_drawflags_refresh
This decoupled setting draw flags from calculating the manipulator center.

I can't see any advantage to doing this with the current code
It just increases the chance the two get out of sync.
2017-04-06 13:02:07 +10:00
c301dc445a Use obmat for manipulator center instead of 'loc'
Would show wrong location with parenting.
2017-04-06 12:47:00 +10:00
89c8d3cd45 Remove BKE_pose_where_is from protectflag_to_drawflags_pchan 2017-04-06 12:41:02 +10:00
dbccccc0a5 Merge branch 'blender2.8' into custom-manipulators 2017-04-06 12:32:44 +10:00
e34540a674 Merge branch 'blender2.8' into custom-manipulators 2017-04-06 12:16:58 +10:00
a29fb3945f Sync with 2.8 2017-04-06 11:52:18 +10:00
365546a662 Add null check to gimbal_axis (sync with 2.8) 2017-04-06 11:35:04 +10:00
d4bd16b30d Merge branch 'blender2.8' into custom-manipulators 2017-04-06 11:20:51 +10:00
cf1287308f Disable depth test for scale widget 2017-04-06 00:44:39 +10:00
37176c7acb Merge branch 'blender2.8' into custom-manipulators 2017-04-06 00:21:23 +10:00
0b6876d1e9 Remove USE_IMM ifdefs 2017-04-05 19:41:16 +10:00
9f643efc66 Finish of removal of GLU deps
Will commit full removal next
2017-04-05 19:31:05 +10:00
124b21f200 Merge branch 'blender2.8' into custom-manipulators 2017-04-05 19:08:52 +10:00
bfe7546f88 Support clipping for dial widgets
Apply changes from @Severin's recent commit ebe1b4f1 to dial widgets.
2017-04-05 13:16:10 +10:00
6c84d67d9f Merge branch 'blender2.8' into custom-manipulators 2017-04-05 11:43:16 +10:00
ec12951262 Merge branch 'blender2.8' into custom-manipulators 2017-04-04 23:18:22 +10:00
c81fd28116 Merge branch 'master' into custom-manipulators 2017-04-03 22:56:51 +10:00
8042d05c5b Work in progress move from GLU to IMM
Drawing rotation widgets now uses IMM, but not arrows
See USE_IMM define.
2017-04-03 22:53:27 +10:00
0c7d2e499e Merge branch 'blender2.8' into custom-manipulators 2017-04-03 15:27:27 +10:00
9bb9419219 Merge branch 'blender2.8' into custom-manipulators 2017-04-03 13:18:03 +10:00
01a5cd5cec Merge branch 'blender2.8' into custom-manipulators 2017-04-03 13:01:56 +10:00
691df9f29d Merge branch 'blender2.8' into custom-manipulators
Needed to add GLU back for purpose of merging, noted with IMM-FIXME
2017-04-03 13:00:49 +10:00
1dcb15608f Merge branch 'blender2.8' into custom-manipulators 2017-04-03 12:30:55 +10:00
6005a378d0 Merge branch 'blender2.8' into custom-manipulators
Also remove sequencer widget.
2017-03-31 23:31:11 +11:00
94783a601a Merge branch 'blender2.8' into custom-manipulators 2017-03-31 23:04:56 +11:00
8faeeef2e3 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 22:35:32 +11:00
55fec0582f Merge branch 'blender2.8' into custom-manipulators 2017-03-31 22:32:50 +11:00
d6f394621f Merge branch 'blender2.8' into custom-manipulators 2017-03-31 22:23:14 +11:00
ff716e3c34 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:41:26 +11:00
38f910f9e2 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:30:26 +11:00
147467d201 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:28:03 +11:00
57146919e0 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:23:09 +11:00
3fe1a05032 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:21:47 +11:00
abc08c81b5 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:53:13 +11:00
b5ddaa81c8 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:49:53 +11:00
9aa36de62c Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:41:46 +11:00
ae0f75b56d Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:37:32 +11:00
ec312cacca Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:08:17 +11:00
e1fa97f318 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:05:20 +11:00
6fb08f6fb3 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 19:10:28 +11:00
4e999dea52 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:36:34 +11:00
903ebdb96c Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:32:16 +11:00
f046ab9950 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:27:53 +11:00
721ad61f50 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:27:01 +11:00
7cc3c433ed Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:14:00 +11:00
2b94f1d073 Merge branch 'blender2.8' into custom-manipulators
This removes graph 3d render feature, also use same variables as master
for SpaceNode.

The feature (could be added back if needed),
but didn't get such a positive functionality review, see D1781,
although this is still an open topic.
2017-03-31 18:12:11 +11:00
8336244e38 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 17:32:28 +11:00
6cc9716c15 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 17:19:47 +11:00
6d77187f09 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 17:13:57 +11:00
67685e4b4d Merge branch 'blender2.8' into custom-manipulators
Note, this doesn't use the changes from 2.8x, since the code was so different.
Move to use imm API will need to be done manually.
2017-03-31 17:11:46 +11:00
db428a389a Merge branch 'blender2.8' into custom-manipulators 2017-03-31 16:58:22 +11:00
9b61a70f8d Merge branch 'blender2.8' into custom-manipulators 2017-03-31 16:52:10 +11:00
fa1198b104 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 16:49:38 +11:00
fd17d7a864 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 16:45:17 +11:00
b2ad248cdd Merge branch 'blender2.8' into custom-manipulators 2017-03-31 15:26:20 +11:00
6060e86cf2 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 15:14:18 +11:00
5fa7e76d30 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 15:13:42 +11:00
d18ed646ee Add missing header (for abort) 2017-03-31 15:01:44 +11:00
9b62d329f4 Merge branch 'blender2.8' into custom-manipulators 2017-03-30 18:11:27 +11:00
8190356911 Merge branch 'blender2.8' into custom-manipulators 2017-03-30 17:23:56 +11:00
669104b5da Merge branch 'blender2.8' into custom-manipulators 2017-03-30 17:23:05 +11:00
6c4f3d11aa Merge branch 'blender2.8' into custom-manipulators 2017-03-30 17:08:09 +11:00
Julian Eisel
8e97c6af0d Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/blenkernel/intern/library_query.c
	source/blender/editors/include/ED_transform.h
	source/blender/editors/interface/resources.c
	source/blender/editors/transform/transform_manipulator.c
2017-02-12 21:27:43 +01:00
Julian Eisel
04e4cb9714 Merge branch 'blender2.8' into custom-manipulators 2017-01-30 00:16:43 +01:00
Julian Eisel
bfe151e5f7 Fix compile error 2017-01-30 00:15:48 +01:00
Julian Eisel
f1e7f6ec58 Merge branch 'blender2.8' into custom-manipulators 2017-01-20 17:05:49 +01:00
Julian Eisel
b77d3f55c0 Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/space_view3d/view3d_ops.c
	source/blender/editors/transform/transform_manipulator.c
2017-01-14 17:50:24 +01:00
Julian Eisel
83c17d8de8 Don't limit manipulator scale to 200 2016-12-16 01:20:18 +01:00
Julian Eisel
da3523c48f Fix compile issues after merging 2016-12-16 01:10:18 +01:00
Julian Eisel
591cee2707 Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/editors/interface/resources.c
	source/blender/editors/space_node/drawnode.c
	source/blender/makesrna/intern/rna_wm.c
2016-12-16 00:58:06 +01:00
Julian Eisel
c696b70dae Fix incorrect color of axes on "Reset to Default Theme" 2016-11-10 23:21:02 +01:00
Julian Eisel
701689f354 Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
2016-11-10 23:17:57 +01:00
Julian Eisel
aadb4c0640 Fix Blenderplayer not compiling.... 2016-10-17 17:13:51 +02:00
Julian Eisel
b706b745ce Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/editors/interface/resources.c
	source/blender/editors/space_api/spacetypes.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/windowmanager/CMakeLists.txt
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_types.h
	source/blender/windowmanager/manipulators/intern/wm_manipulator.c
	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
	source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
2016-10-16 21:19:02 +02:00
Julian Eisel
c21122f0d3 Move manipulator drawing for new viewport into own function, add comments 2016-10-07 16:26:03 +02:00
Julian Eisel
78ed4e7e20 Merge branch 'temp_manipulators_core' into custom-manipulators
Conflicts:
	source/blender/editors/interface/resources.c
	source/blender/editors/space_api/spacetypes.c
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/windowmanager/CMakeLists.txt
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_types.h
	source/blender/windowmanager/manipulators/intern/wm_manipulator.c
	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
	source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
2016-10-07 16:15:02 +02:00
Julian Eisel
1e0a74fc25 Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/editors/space_view3d/view3d_draw.c
2016-10-07 15:44:43 +02:00
Julian Eisel
59cb21ab5a Merge branch 'blender2.8' into temp_manipulators_core 2016-10-07 15:15:24 +02:00
Julian Eisel
11ae190f00 Apply patch on blender2.8 branch
Ended up just deleting temp_manipulators_core branch and recreating it from blender2.8 branch. Applied D2232 on it then.
2016-10-07 01:32:59 +02:00
Julian Eisel
a19f862bd9 Bring back stuff removed in temp_manipulators_core
Was removed for merge into blender2.8, but we still need it in this branch.
2016-10-07 00:11:35 +02:00
Julian Eisel
67a161d703 Merge branch 'temp_manipulators_core' into custom-manipulators
Conflicts:
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/makesdna/DNA_view3d_types.h
2016-10-06 23:29:53 +02:00
Julian Eisel
62afcdedc5 Remove unneeded UserPref options
At least initial merge we don't need them.
2016-10-06 21:34:04 +02:00
Julian Eisel
fb7977a2f3 Remove any remaining OpenGL calls
This branch is likely going to be merged into blender2.8 branch soon so I rather avoid any OpenGL code that might need to be rewritten later.
2016-10-06 20:58:35 +02:00
Julian Eisel
c5f7486d4f Cleanup: Comments 2016-10-06 19:51:22 +02:00
Julian Eisel
2bdf886c5e Remove DNA_manipulator_types.h for now
At least for initial merge we don't need anything in DNA (and I'm not sure how DNA structs are handled which are not explicitely saved to disk... does it still store some info about it?).
2016-10-04 17:06:20 +02:00
Julian Eisel
aac3c0b6c8 Fix selected manipulators only drawn while hovering 2016-10-04 15:23:08 +02:00
Julian Eisel
7f56f62975 Fix a few memory leaks due to double allocation 2016-10-04 14:52:14 +02:00
Julian Eisel
28fa9ec7c0 Make manipulators work with changes from last merge 2016-10-04 02:16:28 +02:00
Julian Eisel
ebe25664d9 Merge branch 'temp_manipulators_core' into custom-manipulators 2016-10-03 23:55:09 +02:00
Julian Eisel
12d2bdd372 Move some manipulator flags to manipulator-group-type level
Had to do some changes to allow this, basically the wmManipulator.mgroup pointer to get the manipulator-group from the manipulator is back which is a bit ugly. Think that's fine though, only a minor annoyance.
2016-10-03 23:54:16 +02:00
Julian Eisel
291c28642d Split wmManipulator flag into behavior flags and state flags 2016-10-03 20:04:21 +02:00
Julian Eisel
3d707e94cd Fix some stupid mistakes in previous commit 2016-10-03 19:25:52 +02:00
Julian Eisel
30da20d0ee Fixes to make branch working after latest merge 2016-10-03 18:59:29 +02:00
Julian Eisel
f1d01b004e Merge branch 'temp_manipulators_core' into custom-manipulators 2016-10-03 18:28:45 +02:00
Julian Eisel
2712e4b4f4 Refactor manipulator draw routine
Updating and drawing works closer together now, makes it easier to define what to draw (3D vs 2D vs depth-culled manipulators) and to avoid unnecessary updates. Totally untested :)
2016-10-03 18:28:12 +02:00
Julian Eisel
d1e68a92aa Fix local ListBase var not initialized 2016-10-03 01:35:02 +02:00
Julian Eisel
100d043fce Merge branch 'temp_manipulators_core' into custom-manipulators
Also made changes to get branch compile and work.
Conflicts:
	source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h
2016-10-03 01:31:15 +02:00
Julian Eisel
d4f3278962 Fixes for custom-manipulators branch 2016-10-03 00:52:41 +02:00
Julian Eisel
dbe147257d Refactor lookups for hovered manipulator
2D manipulators now have priority over 3D ones, think that's what you'd want usually. Untested code, need to merge into custom_manipulators first.
2016-10-03 00:23:34 +02:00
Julian Eisel
2e595daee3 Refactor manipulator-group flags
Flags are internal now, not exposed to non-manipulator window manager code.
2016-10-02 22:12:10 +02:00
Julian Eisel
3668050589 Merge branch 'master' into temp_manipulators_core 2016-09-30 01:29:16 +02:00
Julian Eisel
0d4ea39f95 Merge branch 'blender2.8' into custom-manipulators 2016-09-30 01:28:53 +02:00
Julian Eisel
3571559577 Merge branch 'temp_manipulators_core' into custom-manipulators 2016-09-29 18:56:37 +02:00
Julian Eisel
109ba2d190 More fixes for recent refactor 2016-09-29 18:50:42 +02:00
Julian Eisel
781dc08f09 Some fixes for manipulator tweaking after recent changes 2016-09-29 18:40:24 +02:00
Julian Eisel
1571c8bc9e Merge branch 'temp_manipulators_core' into custom-manipulators 2016-09-29 01:00:17 +02:00
Julian Eisel
f6a814554a Fix some errors in last commit 2016-09-29 00:59:39 +02:00
Julian Eisel
2976d3e120 Make branch compile after latest merge 2016-09-29 00:53:11 +02:00
Julian Eisel
c5d8a674f9 Merge branch 'temp_manipulators_core' into custom-manipulators
Conflicts:
	source/blender/blenkernel/BKE_screen.h
	source/blender/blenkernel/intern/screen.c
	source/blender/editors/interface/resources.c
	source/blender/editors/screen/screen_edit.c
	source/blender/editors/space_api/spacetypes.c
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/makesdna/DNA_view3d_types.h
	source/blender/windowmanager/CMakeLists.txt
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/intern/wm_event_system.c
	source/blender/windowmanager/intern/wm_init_exit.c
	source/blender/windowmanager/manipulators/WM_manipulator_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_types.h
	source/blender/windowmanager/manipulators/intern/wm_manipulator.c
	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
	source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
	source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h
2016-09-29 00:22:20 +02:00
Julian Eisel
075bf33e0f Regions now use a single manipulator-map again
Instead of having multiple manipulator-maps for 2D and 3D manipulators, manipulator-group-types should be tagged as being either 2D or 3D. When it comes to drawing these can be drawn separately.
Note that more work needs to be done here (added some todo marks), but there are probably going to be quite a few issues when merging into custom_manipulators, so will handle these first.
2016-09-29 00:12:24 +02:00
Julian Eisel
319db37ac1 Remove manipulator library for initial core merge
Will continue work on them in 2.8 based custom_manipulators branch, there I can also work on making manipulator drawing based on OpenGL 3.2 core profile.
2016-09-25 01:00:45 +02:00
Julian Eisel
bd239c7661 Rebase wiggly-widgets branch onto blender2.8 branch
This commit adds a new 'custom-manipulators' branch in which changes of the wiggly-widgets branch are applied onto the blender2.8 branch. I've done it so I can start porting manipulator drawing code to use the new abstractions for OpenGL 3.2 core profile.
At some point I had to do it anyway - better earlier than later to reduce loss of git history.
From now on this is the main branch for the custom manipulators project, I'll delete the wiggly-widgets branch in a bit (but keep it available at https://github.com/julianeisel/blender/tree/wiggly-widgets). It's still possible to merge some manipulators for pre-2.8 by rewriting the drawing of those to use OpenGL <= 2.1 (or copy & pasting from earlier state).
2016-09-23 02:45:57 +02:00
Julian Eisel
d208684398 Fix 3 bugs causing startup to fail in wiggly-widgets branch 2016-09-22 02:13:24 +02:00
Julian Eisel
581f3825ed Merge branch 'master' into temp_manipulators_core 2016-09-22 01:19:44 +02:00
Julian Eisel
90df954585 Use GPU_glew.h to include glew 2016-09-21 02:15:25 +02:00
Julian Eisel
dcd0858ef6 Fix manipulator update event define using already used value
Quite old issue even, since 97bb7d0a5b.
2016-09-21 02:13:17 +02:00
Julian Eisel
f822d3b32f Merge branch 'master' into temp_manipulators_core 2016-09-20 00:11:52 +02:00
Julian Eisel
157bd82fde Move structs to lower level, avoid storing manipulator-group pointers, naming, etc 2016-09-15 12:50:05 +02:00
Julian Eisel
37d225ce55 Move manipulator-group creation into own function 2016-09-15 02:26:30 +02:00
Julian Eisel
e930182b29 Remove unused manipulator-map update flag 2016-09-15 02:26:30 +02:00
Julian Eisel
c77ed84edc Avoid include in header file 2016-09-14 23:57:28 +02:00
Julian Eisel
2849dc429b Add SpaceType.manipulators callback for startup registration of manipulator-maps
Aaaannd the usual cleanup.
2016-09-14 17:02:12 +02:00
Julian Eisel
1b1be1576a Cleanup: Rename manipulator_draw_intern->manipulator_drawinfo_draw 2016-09-14 14:55:04 +02:00
Julian Eisel
ddb0a27e0e Cleanup: Line length, indentation, etc 2016-09-13 15:30:13 +02:00
Julian Eisel
e2b79f8756 Resolve some XXX'es and TODO's
And some cleanup.
2016-09-13 00:42:32 +02:00
Julian Eisel
dbd6f806fe Merge branch 'master' into temp_manipulators_core 2016-09-12 23:27:09 +02:00
Julian Eisel
fc719f3e9a Avoid bad-level calls to WM_manipulatormap_delete from BKE 2016-09-12 17:44:55 +02:00
Julian Eisel
ac7e3ba7e8 Cleanup: Comments 2016-09-11 23:59:10 +02:00
Julian Eisel
eea7125d54 Add some missing function calls for manipulators 2016-09-11 23:17:36 +02:00
Julian Eisel
9372e8a16b More renaming (widget->manipulator): Variables, sturct members, comments, etc 2016-09-11 23:06:15 +02:00
Julian Eisel
459fe932da Hook up manipulator core with window-manager 2016-09-11 20:05:11 +02:00
Julian Eisel
0b95deb6fa Fix accidentaly changed prefix capitalization 2016-09-11 18:59:08 +02:00
Julian Eisel
e6706d533e Merge branch 'master' into temp_manipulators_core 2016-09-11 15:53:11 +02:00
Julian Eisel
8e7e73afa6 Rename remaining structs (widget->manipulator)
And some other stuff ;)
2016-09-11 14:56:09 +02:00
Julian Eisel
a7a78728e2 Rename operators (widget->manipulator) 2016-09-11 14:43:40 +02:00
Julian Eisel
32cd173259 Rename functions and defines (widget->manipulator) 2016-09-11 14:34:19 +02:00
Julian Eisel
b464e93947 Rename types (wmWidget->wmManipulator) 2016-09-09 17:54:18 +02:00
Julian Eisel
64da6d876d Rename files and folders (widget->manipulator) 2016-09-09 17:21:32 +02:00
Julian Eisel
49fcfd4be9 Minor cleanup 2016-09-09 15:34:47 +02:00
Julian Eisel
ae55eeb2ce Initially add widget files and get them compiling
Another temp_ branch :S This time for preparing custom manipulators core code for merge.
2016-09-08 22:48:37 +02:00
3 changed files with 133 additions and 7 deletions

View File

@@ -0,0 +1,89 @@
# Apache License, Version 2.0
import bpy
from bpy.types import Operator
from bpy.props import StringProperty
from bpy_extras.io_utils import ExportHelper
def mesh_triangulate(me):
import bmesh
bm = bmesh.new()
bm.from_mesh(me)
bmesh.ops.triangulate(bm, faces=bm.faces)
bm.to_mesh(me)
bm.free()
class ExportWidget(Operator, ExportHelper):
"""Export a widget mesh as a C file"""
bl_idname = "export_scene.widget"
bl_label = "Export Widget"
bl_options = {'PRESET', 'UNDO'}
filename_ext = ".c"
filter_glob = StringProperty(
default="*.c;",
options={'HIDDEN'},
)
@classmethod
def poll(cls, context):
obj = context.active_object
return (obj and obj.type == 'MESH')
def execute(self, context):
ob = context.active_object
scene = context.scene
try:
me = ob.to_mesh(scene, True, 'PREVIEW', calc_tessface=False)
except RuntimeError:
me = None
if me is None:
return {'CANCELLED'}
mesh_triangulate(me)
f = open(self.filepath, 'w')
f.write("static const float verts[][3] = {\n")
for v in me.vertices:
f.write("\t{%.6f, %.6f, %.6f},\n" % v.co[:])
f.write("};\n\n")
f.write("static const float normals[][3] = {\n")
for v in me.vertices:
f.write("\t{%.6f, %.6f, %.6f},\n" % v.normal[:])
f.write("};\n\n")
f.write("static const unsigned short indices[] = {\n")
for p in me.polygons:
f.write("\t%d, %d, %d,\n" % p.vertices[:])
f.write("};\n")
f.write("\n")
f.write("ManipulatorGeomInfo wm_manipulator_geom_data_%s = {\n" % ob.name)
f.write("\t.nverts = %d,\n" % len(me.vertices))
f.write("\t.ntris = %d,\n" % len(me.polygons))
f.write("\t.verts = verts,\n")
f.write("\t.normals = normals,\n")
f.write("\t.indices = indices,\n")
f.write("};\n")
f.close()
return {'FINISHED'}
def menu_func_export(self, context):
self.layout.operator(ExportWidget.bl_idname, text="Widget (.c)")
def register():
bpy.utils.register_module(__name__)
bpy.types.INFO_MT_file_export.append(menu_func_export)
def unregister():
bpy.utils.unregister_module(__name__)
bpy.types.INFO_MT_file_export.remove(menu_func_export)
if __name__ == "__main__":
register()

View File

@@ -19,10 +19,40 @@
# <pep8 compliant>
# bpy.type.KeyMap: (km.name, km.space_type, km.region_type, [...])
# Add (0, 0, 0, 0) as first element to skip adding "Foo (Global)" entry
# ('Script', 'EMPTY', 'WINDOW', []),
# would be good to have a more generic way of doing this...
KM_WIDGETS_HIERARCHY = [
# VIEW_3D
('Widgets', 'EMPTY', 'WINDOW', [
(0, 0, 0, 0), # avoid adding 'Widgets (Global)" entry
('Face Map Widgets', 'VIEW_3D', 'WINDOW', []),
('Lamp Widgets', 'VIEW_3D', 'WINDOW', []),
('Force Field Widgets', 'VIEW_3D', 'WINDOW', []),
('Camera Widgets', 'VIEW_3D', 'WINDOW', []),
('Manipulator Widgets', 'VIEW_3D', 'WINDOW', []),
]),
# GRAPH_EDITOR
('Widgets', 'EMPTY', 'WINDOW', [
(0, 0, 0, 0),
('Backdrop Transform Widgets', 'GRAPH_EDITOR', 'WINDOW', []),
]),
# NODE_EDITOR
('Widgets', 'EMPTY', 'WINDOW', [
(0, 0, 0, 0),
('Backdrop Transform Widgets', 'NODE_EDITOR', 'WINDOW', []),
]),
# SEQUENCE_EDITOR
('Widgets', 'EMPTY', 'WINDOW', [
(0, 0, 0, 0),
('Backdrop Transform Widgets', 'SEQUENCE_EDITOR', 'WINDOW', []),
# ('Image Transform Widgets', 'SEQUENCE_EDITOR', 'WINDOW', []),
]),
]
KM_HIERARCHY = [
('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit
('Screen', 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot
@@ -55,6 +85,8 @@ KM_HIERARCHY = [
('Particle', 'EMPTY', 'WINDOW', []),
KM_WIDGETS_HIERARCHY[0],
('Knife Tool Modal Map', 'EMPTY', 'WINDOW', []),
('Paint Stroke Modal', 'EMPTY', 'WINDOW', []),
('Paint Curve', 'EMPTY', 'WINDOW', []),
@@ -73,6 +105,7 @@ KM_HIERARCHY = [
('Graph Editor', 'GRAPH_EDITOR', 'WINDOW', [
('Graph Editor Generic', 'GRAPH_EDITOR', 'WINDOW', []),
KM_WIDGETS_HIERARCHY[1]
]),
('Dopesheet', 'DOPESHEET_EDITOR', 'WINDOW', [
('Dopesheet Generic', 'DOPESHEET_EDITOR', 'WINDOW', []),
@@ -94,10 +127,12 @@ KM_HIERARCHY = [
('Node Editor', 'NODE_EDITOR', 'WINDOW', [
('Node Generic', 'NODE_EDITOR', 'WINDOW', []),
KM_WIDGETS_HIERARCHY[2],
]),
('Sequencer', 'SEQUENCE_EDITOR', 'WINDOW', [
('SequencerCommon', 'SEQUENCE_EDITOR', 'WINDOW', []),
('SequencerPreview', 'SEQUENCE_EDITOR', 'WINDOW', []),
KM_WIDGETS_HIERARCHY[3],
]),
('Logic Editor', 'LOGIC_EDITOR', 'WINDOW', []),

View File

@@ -64,6 +64,7 @@ def draw_entry(display_keymaps, entry, col, level=0):
def draw_km(display_keymaps, kc, km, children, layout, level):
draw_global = children and children[0][0]; # first entry (0, 0, 0, 0) means we don't add "Global" entry
km = km.active()
layout.context_pointer_set("keymap", km)
@@ -85,7 +86,7 @@ def draw_km(display_keymaps, kc, km, children, layout, level):
del subrow
if km.show_expanded_children:
if children:
if draw_global:
# Put the Parent key map's entries in a 'global' sub-category
# equal in hierarchy to the other children categories
subcol = _indented_layout(col, level + 1)
@@ -101,13 +102,14 @@ def draw_km(display_keymaps, kc, km, children, layout, level):
for kmi in km.keymap_items:
draw_kmi(display_keymaps, kc, km, kmi, col, kmi_level)
# "Add New" at end of keymap item list
subcol = _indented_layout(col, kmi_level)
subcol = subcol.split(percentage=0.2).column()
subcol.operator("wm.keyitem_add", text="Add New", text_ctxt=i18n_contexts.id_windowmanager,
icon='ZOOMIN')
if draw_global:
# "Add New" at end of keymap item list
subcol = _indented_layout(col, kmi_level)
subcol = subcol.split(percentage=0.2).column()
subcol.operator("wm.keyitem_add", text="Add New", text_ctxt=i18n_contexts.id_windowmanager,
icon='ZOOMIN')
col.separator()
col.separator()
# Child key maps
if children: