Commit Graph

49420 Commits

Author SHA1 Message Date
Sergey Sharybin
03dbae07d3 Mask primitives
Currently only circle and square, might be easily
extended in the future.

New primitives are creating at cursor location.
This also implied adding 2d cursor to space clip.

Also fix set 2D cursor location which didn't work
in image editor's mask mode since 2.67.

TODO: draw_image_cursor better be moved to some
      more generic file, but it's not so much
      important for now and might be solved later.

Thanks Campbell for the review!
2013-08-26 20:23:26 +00:00
Campbell Barton
11aa7a76fa quiet warnings when building as a python module 2013-08-26 19:32:03 +00:00
Bastien Montagne
c93750d893 RNA fixes regarding dynamic array properties in functions parameters (reviewed by Brecht, thanks!):
* It was not clear that RNA_parameter_length_get() & co only affected dynamic properties, renamed them to RNA_parameter_dynamic_length_get() and such.

* Fixed RNA_function_find_parameter(), we can't use BLI_findstring() here, need to call RNA_property_identifier()!

* Fixed RNA_parameter_get() and RNA_parameter_set(), which were completely wrong for dynamic properties.

* Fixed RNA_parameter_dynamic_length_get/set_data(), they did not check the property was actually a dynamic one and were using again ugly blackmagic casting intead of ParameterDynAlloc structure!

* makesrna was still using an ugly hackish (and perhaps not always working) code when handling dynamic parameters, now synchronized with RNA_parameter_dynamic_length_get_data and RNA_parameter_get code.
2013-08-26 16:08:03 +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
Antony Riakiotakis
1ff96dc6c9 Don't check for an object mode that is excluded as a prerequisite for
entering this branch of code.
2013-08-26 14:58:16 +00:00
Sergey Sharybin
52216889c0 Remove unused function NewBooleanMesh 2013-08-26 14:53:40 +00:00
Sergey Sharybin
4800d7fc34 Remove dirty normals assert from drawobject.c
Dirty normals already being checked in DerivedMesh.c,
and this things really rather be localized in one
single place than being checked all over the code.
2013-08-26 14:53:33 +00:00
Bastien Montagne
79835d53fb Cleanup: move defines into anon enums, as suggested by Joshua, thx.
Note I let a few as defines for now (esp. base options are not clear to me, how they should be aranged in groups).
2013-08-26 14:30:00 +00:00
Bastien Montagne
49ae48bc16 Cleanup (bitflags are *so much* easy to handle and clear as bit-shift operations than raw values!). 2013-08-26 13:50:25 +00:00
Campbell Barton
1dba986505 internal changes to ghash/edgehash, reorganize to split out resizing the hash from insertion. 2013-08-26 13:41:13 +00:00
Bastien Montagne
a26c048fde Fix uiList labels themed colors.
r57760 broke usual labels, and r59511 broke again uiList labels! :P Hopefully every one works as expected now!
2013-08-26 12:32:46 +00:00
Bastien Montagne
4b40ac92f1 Revert r59500, has too much drawbakcs in term of speed... This bug ([#36289]) is not really solvable for now, will mark it as todo. :/ 2013-08-26 12:22:15 +00:00
Bastien Montagne
e61c3beb48 Remove (comment out) auto-generating png form svg (r59382) in CMake, handy but gives nasty "false changes" in svn. Let's try not to forget to update PNGs when needed, then! 2013-08-26 12:16:23 +00:00
Ton Roosendaal
aa6eac3aad Bugfix #36324
Commit 57760, June this year, broke Theme colors for Label Buttons.
All labels, in every editor or region, now were using same color.

These colors have to be derived from the Editor settings. Code for
this was mistakingly removed.
2013-08-26 09:59:51 +00:00
Campbell Barton
762e7da976 add some safety checks in debug mode to ensure sets/hashes aren't confused. 2013-08-26 09:37:15 +00:00
Mitchell Stokes
f7388c1f2e BGE: Cleaning up the vsync code a little. 2013-08-26 08:14:52 +00:00
Campbell Barton
c0d67d26aa no remove double property lookups in ED_fileselect_set_params and redundant NULL check in file_main_area_draw. 2013-08-26 06:54:05 +00:00
Campbell Barton
d11e419792 another header edit needed 2013-08-25 21:29:33 +00:00
Campbell Barton
2889448b94 blenderplayer builds again 2013-08-25 21:24:16 +00:00
Campbell Barton
3b414b9859 minor changes to edgehassh/ghash
- no need to zero vars when freeing ghash
- de duplicate ghash remove code.
- edgehash clear now works more like ghash.
2013-08-25 21:02:31 +00:00
Campbell Barton
bbce51d116 replace hashes with sets where possible. 2013-08-25 20:03:45 +00:00
Campbell Barton
1d5eff36f5 BKI_gset and EdgeSet api, use when hash values aren't used (reuses ghash internally without allocating space for the value). 2013-08-25 20:00:19 +00:00
Bastien Montagne
74b770bc89 Fix [#36289] Not change children object on freez layer when change frame.
When hiding the layer of an object, switching to a different fram, and showing again that layer, things like object's parenting were not handled... Just set do_time option of DAG_on_visible_update() to True when updating layers.

Note: maybe we could re-enable layers animation... not sure though ;)
2013-08-25 18:45:04 +00:00
Campbell Barton
df01ad250e move doxy docs out of the ghash header into the C file. 2013-08-25 16:28:48 +00:00
Campbell Barton
e2bd3a4644 clearing the mempool can now keep more then a single element reserved. 2013-08-25 16:16:38 +00:00
Campbell Barton
28243b2e5f fix leak in BLI_ghash_clear(). was never freeing entries, add BLI_mempool_clear utility function. 2013-08-25 14:58:26 +00:00
Campbell Barton
e4d278668f code cleanup for mempool, refactor chunk initialization into a static function. 2013-08-25 14:50:40 +00:00
Campbell Barton
a476459c5e merge mempool allocs per chunk, include the data in the BLI_mempool_chunk alloc. 2013-08-25 13:15:22 +00:00
Campbell Barton
3a9eb9b497 doxygen docs for ghash/edgehash 2013-08-25 12:17:46 +00:00
Campbell Barton
150af65d9f For pointer hashing use the same method as python, it gives better distribution.
some tests with high poly mesh data in hashes.
- empty buckets before 4-5%, after 1-2%
- speedup for hash lookups, in my tests lookups take approx ~60% of the time they did before.
2013-08-24 20:30:08 +00:00
Campbell Barton
7c65015ab8 use ints for ghash/edgehash flags, since its allocated theres not much point to try save a few bytes here. 2013-08-24 20:16:14 +00:00
Tamito Kajiyama
4ece675781 Quiet annoying VC++ warning C4819: The file contains a character that cannot be represented in the current code page. 2013-08-24 17:36:45 +00:00
Campbell Barton
09a52f18b6 ghash: reserve size when its known or can be guessed close enough.
also avoid allocs per node in pbvh_bmesh_node_limit_ensure()
2013-08-24 17:33:47 +00:00
Sergey Sharybin
7bd422143e Fix bad draw of plane track when using Tiny display option 2013-08-24 17:25:12 +00:00
Sergey Sharybin
6caad3445e Add stdlib.h to solve compilation error caused by missing abort() prototype
Perhaps we'd better move this include to BLI_utildefines as we made with
with other includes needed for BLI_abort?
2013-08-24 17:15:59 +00:00
Campbell Barton
1e2ceabbe1 correct error in face walker (was inserting into the wrong ghash which was immediately freed after) 2013-08-24 16:43:09 +00:00
Campbell Barton
585272fbcf cloth was using edgehash not quite correctly:
- was ordering vertex args unnecessarily.
- was adding the same edges multiple times into the edgehash.
2013-08-24 16:06:18 +00:00
Campbell Barton
1ba29c3a4a cloth spring building: replace MIN2/MAX2 in assignments with a function which orders on assignment. 2013-08-24 15:55:56 +00:00
Campbell Barton
2c556c2ef7 avoid double ghash lookup in sculpt map_insert_vert 2013-08-24 15:31:47 +00:00
Campbell Barton
4b1fc0593e add versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a reserve argument. 2013-08-24 15:14:50 +00:00
Campbell Barton
aefe93d909 revert bucket size change (edgehash was this way for years, since r26206, ghash since r57657)
having 2 free buckets for each entry is faster but uses more memory.

use the original size, best case 3 entries per bucket.
2013-08-24 15:09:57 +00:00
Brecht Van Lommel
a31a85ac9c Fix #36541: blender internal raytrace render hangs with high ray depth. The code
here is not efficient for such cases, a ray depth can give up to 2^depth rays due
to the ray splitting in two at each depth. A proper solution requires a better
algorithm, for now I've ensured that you can at least cancel such renders. The
overhead from the extra test_break is negligible.
2013-08-24 15:02:12 +00:00
Campbell Barton
25ffb79a0b use reserve argument for more edgehashs 2013-08-24 14:40:15 +00:00
Campbell Barton
8811e521c0 fix for leak in cloth modifier
- any error in cloth_build_springs wasn't freeing the edge-hash.
- was checking BLI_edgehash_haskey on matching vertices.
- was looping over setting NULL for all elements of a calloc'd array.
2013-08-24 14:32:43 +00:00
Campbell Barton
0b88b4fad7 when the size of an edgehash is known or can be guessed,
pass in the argument to reserve the size.
2013-08-24 13:47:57 +00:00
Campbell Barton
f320c5ae9e fix for leak in make_edges_mdata() if there were no edges to create,
also reserve the total number of edges in the hash when its created.
2013-08-24 13:13:29 +00:00
Campbell Barton
f2acb10b6b edge hash: take an arg for the guarded-malloc string (as ghash does) 2013-08-24 13:08:55 +00:00
Campbell Barton
9c090cecfe ghash and edgehash api, allow newly defined hashes to take in the size of the hash as an arg (avoids resizing in simple cases when the hash is created and filled immediately). 2013-08-24 13:04:03 +00:00
Andrea Weikert
b187c1be4b == filebrowser ==
* fix old bug: wrong layout that could happen  when switching between thumbnail view and list view. This caused the layout to be recalculated sometimes and the items being moved. Reason was that the layout was wrongly initialized without the scroll bars, so calculated wrongly.
2013-08-24 12:53:47 +00:00
Campbell Barton
f3ceee51fa fix for GPU_update_bmesh_buffers not setting bmesh vertex index values as dirty (could cause errors later). 2013-08-24 11:46:08 +00:00