8 years agoLast uiList patch (for now!): filtering and reordering of shown elements.
Bastien Montagne [Thu, 29 Aug 2013 12:55:31 +0000 (12:55 +0000)]
Last uiList patch (for now!): filtering and reordering of shown elements.

Thanks to Brecht for the reviews. :)

This commit adds a show/hide extension below each uiList, containing by default an option to filter and/or reorder items by name (and to reverse those filtering and reordering).

Each derived uiList class in Python can define more specific filtering by implementing callbacks: the draw_filter() function to draw options in UI, and the filter_items() function to effectively filter/reorder items.

Note: the advanced options for vgroups shown as "proof od concept" in patches do not go in trunk for now, we have to find a better way to get those vgroups info for UI code, we can't afford to loop over each vertex here!

And doc (release notes and uiList example) is still to be updated, will do this in next days.

8 years agoUse static odifier for non-public functions in new sky model.
Sergey Sharybin [Thu, 29 Aug 2013 12:36:02 +0000 (12:36 +0000)]
Use static odifier for non-public functions in new sky model.

8 years agofollow up on r59628, setting modes now ensures that other modes exit first,
Campbell Barton [Thu, 29 Aug 2013 10:34:09 +0000 (10:34 +0000)]
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)

8 years agofix [#34462] Crash when switching modes via mix of TAB and spacebar menu
Campbell Barton [Thu, 29 Aug 2013 08:57:12 +0000 (08:57 +0000)]
fix [#34462] Crash when switching modes via mix of TAB and spacebar menu

8 years agofix for glitch where the text editor could be clamped to scroll above line 1 (would...
Campbell Barton [Thu, 29 Aug 2013 08:13:32 +0000 (08:13 +0000)]
fix for glitch where the text editor could be clamped to scroll above line 1 (would flicker on scroll).

8 years agouse os.remove rather then unlink (the same but all other areas use 'remove')
Campbell Barton [Thu, 29 Aug 2013 06:02:19 +0000 (06:02 +0000)]
use os.remove rather then unlink (the same but all other areas use 'remove')

8 years agodefault blend file name setting (untitled.blend) length check wasn't correct, move...
Campbell Barton [Thu, 29 Aug 2013 05:34:58 +0000 (05:34 +0000)]
default blend file name setting (untitled.blend) length check wasn't correct, move to generic function BLI_ensure_filename().

8 years agoBGE: The WM_OT_blenderplayer_start addon now saves a copy of the current blendfile...
Mitchell Stokes [Thu, 29 Aug 2013 04:31:55 +0000 (04:31 +0000)]
BGE: The WM_OT_blenderplayer_start addon now saves a copy of the current blendfile with a trailing '~' to keep paths intact. An unsaved file will still go to the tmp directory. This file is deleted when the blenderplayer process exits.

8 years agodon't replace the extension with '.blend' in save code since the file selector alread...
Campbell Barton [Thu, 29 Aug 2013 04:26:40 +0000 (04:26 +0000)]
don't replace the extension with '.blend' in save code since the file selector already ensures this,
needed so python scripts can save as temp filenames.

8 years agofix [#36570] Changing the filename of a image strip doesnt refresh sequencer
Campbell Barton [Thu, 29 Aug 2013 04:08:44 +0000 (04:08 +0000)]
fix [#36570] Changing the filename of a image strip doesnt refresh sequencer

was casting a StripElem as a Sequencer struct.

8 years agoedits to curve operator
Campbell Barton [Thu, 29 Aug 2013 03:14:36 +0000 (03:14 +0000)]
edits to curve operator
- remove delete-all option (users can just select all and delete as with all other modes).
- remove CALLOC_STRUCT_N macro.
- CURVE_OT_delete define a dynamic enum rather then a custom invoke menu function.

8 years agocode cleanup: curves, replace magic numbers for enums.
Campbell Barton [Thu, 29 Aug 2013 03:00:04 +0000 (03:00 +0000)]
code cleanup: curves, replace magic numbers for enums.

8 years agopatch [#36336] Split operator for curves and surfaces
Campbell Barton [Thu, 29 Aug 2013 02:32:51 +0000 (02:32 +0000)]
patch [#36336] Split operator for curves and surfaces
by Kevin Mackay (yakca)

The operator follows roughly the same behaviour as the split operator for a mesh (Ykey).

8 years agoFix #36598: blender render crash baking and then doing a full sample render.
Brecht Van Lommel [Thu, 29 Aug 2013 00:14:57 +0000 (00:14 +0000)]
Fix #36598: blender render crash baking and then doing a full sample render.

8 years agomicro-optimization, avoid checking is_power_of_2_i once in power_of_2_max_i
Campbell Barton [Wed, 28 Aug 2013 23:49:22 +0000 (23:49 +0000)]
micro-optimization, avoid checking is_power_of_2_i once in power_of_2_max_i
also whitespace edit.

8 years agocorrect own recent commit, malloc_usable_size() isn't valid for mmap()'d memory.
Campbell Barton [Wed, 28 Aug 2013 22:12:40 +0000 (22:12 +0000)]
correct own recent commit, malloc_usable_size() isn't valid for mmap()'d memory.

8 years agoFix #36595: file browser sorting with link/append would mix together .blend files
Brecht Van Lommel [Wed, 28 Aug 2013 21:50:13 +0000 (21:50 +0000)]
Fix #36595: file browser sorting with link/append would mix together .blend files
and directories instead of keeping them separate like regular file browse.

8 years agoSome tweaking to uiList dragsize, to make it more reactive to very quick moves.
Bastien Montagne [Wed, 28 Aug 2013 19:23:15 +0000 (19:23 +0000)]
Some tweaking to uiList dragsize, to make it more reactive to very quick moves.

Note that, even though not officialy supporting non-UI_UNIT_Y height items (other point like scrollbar size would faill too), we try to maintain a not-that-bad behavior in this case, which implies a bit of black magic (esp. as our ref point is the bottom of the list, which moves when it is resized :/)...

8 years agoFix #36555: preview render in properties editor did not get cancelled and
Brecht Van Lommel [Wed, 28 Aug 2013 19:22:48 +0000 (19:22 +0000)]
Fix #36555: preview render in properties editor did not get cancelled and
restarted fast enough on resizing the editor, especially noticeable with
e.g. luxrender which does a progressive refining render.

8 years agoCycles: change Gaussian subsurface scattering falloff to be more similar to
Brecht Van Lommel [Wed, 28 Aug 2013 19:22:46 +0000 (19:22 +0000)]
Cycles: change Gaussian subsurface scattering falloff to be more similar to
the Cubic falloff, see here for details.

8 years agoCycles / OpenCL:
Thomas Dinges [Wed, 28 Aug 2013 14:36:47 +0000 (14:36 +0000)]
Cycles / OpenCL:
* Some fixes for OpenCL, was broken after recent changes.

8 years agoCycles / Sky Texture:
Thomas Dinges [Wed, 28 Aug 2013 14:11:28 +0000 (14:11 +0000)]
Cycles / Sky Texture:
* Added a new sky model by Hosek and Wilkie: "An Analytic Model for Full Spectral Sky-Dome Radiance"

Example render:

* User can choose between the older Preetham and the new Hosek / Wilkie model via a dropdown. For older files, backwards compatibility is preserved. When we add a new Sky texture, it defaults to the new model though.
* For the new model, you can specify the ground albedo (see documentation for details).
* Turbidity now has a UI soft range between 1 and 10, higher values (up to 30) are still possible, but can result in weird colors or black.
* Removed the limitation of 1 sky texture per SVM stack. (Patch by Lukas Tönne, thanks!)

Thanks to Brecht for code review and some help!

This is part of my GSoC 2013 project, SVN merge of r59214, r59220, r59251 and r59601.

8 years agoshould fix builds for osx
Campbell Barton [Wed, 28 Aug 2013 11:22:29 +0000 (11:22 +0000)]
should fix builds for osx

8 years agoinclude slop-space in debug statistics (gcc/clang only)
Campbell Barton [Wed, 28 Aug 2013 10:17:26 +0000 (10:17 +0000)]
include slop-space in debug statistics (gcc/clang only)

8 years agoFix for #36589 Node Editor displays incorrect Material name when Pinning.
Lukas Toenne [Wed, 28 Aug 2013 09:05:09 +0000 (09:05 +0000)]
Fix for #36589 Node Editor displays incorrect Material name when Pinning.
The material button displayed in the node editor header is the "active_material" of the active object. When pinning the node tree this should ideally be the pinned node tree's material slot, but this
would require adding even more confusing info in SpaceNode to find the correct slot in addition to the id_from datablock. Solution for now is to just disable these buttons when pinning to communicate

8 years agoFix #36584, in python inputs/outputs of created node group not accessable by their...
Lukas Toenne [Wed, 28 Aug 2013 07:09:36 +0000 (07:09 +0000)]
Fix #36584, in python inputs/outputs of created node group not accessable by their names.
The lookupstring function for node sockets and node tree interface items was using the identifier strings of bNodeSocket. This would ensure uniqueness, but doesn't work nicely because the identifier is
not the RNA name property and differs for node groups (with regular nodes it only differs if socket names are duplicate).

Now removed the specialized callbacks, so that inputs/outputs collections simply use the name property. In cases where socket names are duplicate (e.g. math node "Value" + "Value") only the first socket
is returned, but in such cases access by index is the preferred method anyway.

8 years agoFix for #36387, User Preferences "Addons" panel bogs down the whole interface.
Lukas Toenne [Wed, 28 Aug 2013 06:36:54 +0000 (06:36 +0000)]
Fix for #36387, User Preferences "Addons" panel bogs down the whole interface.
The addons panel draw function calls addon_utils.modules() which in turn retrieves a list of fake modules from the script paths every time. This can become costly when network paths are included for
addons. Solution is to put the scanning process into a dedicated "refresh" function and disable it in frequently called draw and filter functions, i.e. in these cases the cached addons_fake_modules list
will be used instead.

Note that this may lead to invalid addon lists if script paths are changed (which is not working 100% without restart anyway according to Campbell). For this there is now a "Refresh" operator button in
the addons preferences. If necessary and feasible such forced refreshes can be added later too.

8 years agocmake: set python, llvm and osl libs as advanced.
Campbell Barton [Wed, 28 Aug 2013 04:32:39 +0000 (04:32 +0000)]
cmake: set python, llvm and osl libs as advanced.

8 years agowarn when applying transformation does nothing, confusion pointed out in [#36583]
Campbell Barton [Wed, 28 Aug 2013 04:17:48 +0000 (04:17 +0000)]
warn when applying transformation does nothing, confusion pointed out in [#36583]

8 years agoremove callback BLI_localErrorCallBack from scanfill, was here for years and only...
Campbell Barton [Wed, 28 Aug 2013 02:14:24 +0000 (02:14 +0000)]
remove callback BLI_localErrorCallBack from scanfill, was here for years and only ever wrapped printf.

8 years agoscanfill curves, ngons, masks had their own memarena code and would allocate a new...
Campbell Barton [Wed, 28 Aug 2013 02:07:54 +0000 (02:07 +0000)]
scanfill curves, ngons, masks had their own memarena code and would allocate a new one for every fill.
now use BLI_memarena and support passing the arena into the fill function, so the arena is re-used, when scanfill is called in a loop.

8 years agoremove unused function. also typo
Campbell Barton [Tue, 27 Aug 2013 23:34:16 +0000 (23:34 +0000)]
remove unused function. also typo

8 years agoarray modifier was adding vertices to the 'targetmap' multiple times.
Campbell Barton [Tue, 27 Aug 2013 23:32:11 +0000 (23:32 +0000)]
array modifier was adding vertices to the 'targetmap' multiple times.

this is supported by weldop but would prefer not to allow multiple keys in the map.

8 years agoremove doubles: source/target can be swapped, check both flags.
Campbell Barton [Tue, 27 Aug 2013 23:23:19 +0000 (23:23 +0000)]
remove doubles: source/target can be swapped, check both flags.

8 years agomesh remove doubles was adding verts into the weld_verts.targetmap multiple times...
Campbell Barton [Tue, 27 Aug 2013 22:38:55 +0000 (22:38 +0000)]
mesh remove doubles was adding verts into the weld_verts.targetmap multiple times (new paranoid asserts find this stuff).

8 years agointernal bmesh operator change, always initialize ghash for mapping slots, save havin...
Campbell Barton [Tue, 27 Aug 2013 22:13:11 +0000 (22:13 +0000)]
internal bmesh operator change, always initialize ghash for mapping slots, save having many checks.

8 years agostyle cleanup
Campbell Barton [Tue, 27 Aug 2013 21:30:33 +0000 (21:30 +0000)]
style cleanup

8 years agotweak to dragging the ui-list, would lag behind the mouse noticeably.
Campbell Barton [Tue, 27 Aug 2013 20:58:37 +0000 (20:58 +0000)]
tweak to dragging the ui-list, would lag behind the mouse noticeably.

8 years agoavoid calling CustomData_bmesh_get to get CD_PAINT_MASK per vertex while sculpting...
Campbell Barton [Tue, 27 Aug 2013 20:39:08 +0000 (20:39 +0000)]
avoid calling CustomData_bmesh_get to get CD_PAINT_MASK per vertex while sculpting, store offset directly.

8 years agoSmall enhancement to grab-resize of uiLists, suggested by plasmasolutions: do not...
Bastien Montagne [Tue, 27 Aug 2013 18:56:04 +0000 (18:56 +0000)]
Small enhancement to grab-resize of uiLists, suggested by plasmasolutions: do not effectively apply auto-size until we stop grabbing, avoid size of uiLists to switch between rows and maxrows while dragging.

8 years agoGet rid of madness about fnmatch: BLI_fnmatch did not do the OS checks, they had...
Bastien Montagne [Tue, 27 Aug 2013 18:29:30 +0000 (18:29 +0000)]
Get rid of madness about fnmatch: BLI_fnmatch did not do the OS checks, they had to be done in every file using fnmatch (autoexec.c did not, wonder how it could work under unix???).

Thanks to Brecht for noting this!

8 years agouiLists enhacements: dragresize and better GRID layout.
Bastien Montagne [Tue, 27 Aug 2013 15:27:41 +0000 (15:27 +0000)]
uiLists enhacements: dragresize and better GRID layout.

Many thanks to Brecht for the review!

* You can now drag-resize uiLists (in default or grid layouts).
** Note about "default" size: when you drag below minimal size of the uiList, it will automatically reset to automatic sizing (i.e. size between rows and maxrows, depending on the number of items to show). This often means (e.g. in Materials list with many mat slots) that the list will grow again to maxrows!

* Grid uiLists now have a customizable number of columns (previously it was a fixed value of 9), and they will respect the rows/maxrows settings as well (i.e. show a scrollbar when needed), instead of growing indefinitly!

8 years agoIcons: add a "grip" one.
Bastien Montagne [Tue, 27 Aug 2013 15:21:58 +0000 (15:21 +0000)]
Icons: add a "grip" one.

8 years agoadd icons utility make target.
Campbell Barton [Tue, 27 Aug 2013 10:03:37 +0000 (10:03 +0000)]
add icons utility make target.

8 years agoCycles / Standalone:
Thomas Dinges [Tue, 27 Aug 2013 02:37:48 +0000 (02:37 +0000)]
Cycles / Standalone:
* Rename test to standalone.


8 years agofix [#36301] Mirror modifier does not mirror vertex normals when there are no faces.
Campbell Barton [Tue, 27 Aug 2013 02:25:15 +0000 (02:25 +0000)]
fix [#36301] Mirror modifier does not mirror vertex normals when there are no faces.

8 years agofix [#36409] Continuous Grab problem with arrow keys.
Campbell Barton [Tue, 27 Aug 2013 01:30:09 +0000 (01:30 +0000)]
fix [#36409] Continuous Grab problem with arrow keys.

8 years agofix [#36528] crash when reinitializing bmesh from mesh
Campbell Barton [Tue, 27 Aug 2013 00:39:51 +0000 (00:39 +0000)]
fix [#36528] crash when reinitializing bmesh from mesh

8 years agoghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it takes...
Campbell Barton [Mon, 26 Aug 2013 23:37:08 +0000 (23:37 +0000)]
ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it takes a key as an arg and isnt popping any element from the hash as you might expect).
add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.

8 years agofix for error reading from freed memory when deleting a screen, would free then notif...
Campbell Barton [Mon, 26 Aug 2013 22:48:14 +0000 (22:48 +0000)]
fix for error reading from freed memory when deleting a screen, would free then notifier then check its contents in the notifier queue loop.

8 years agoFollowup to r59536: make "is_argument_optional" available to py, and use it in API...
Bastien Montagne [Mon, 26 Aug 2013 21:39:06 +0000 (21:39 +0000)]
Followup to r59536: make "is_argument_optional" available to py, and use it in API doc generation.

Thanks Campbell for the much better name suggestion!

8 years agoThis commit adds optional parameters for pyfunc implementations of RNA API (i.e....
Bastien Montagne [Mon, 26 Aug 2013 21:11:52 +0000 (21:11 +0000)]
This commit adds optional parameters for pyfunc implementations of RNA API (i.e. callbacks, e.g. draw functions of panels, uiLists, or exec/poll/etc. of operators). Thanks to Brecht for he review!

Any parameter after the first flagged with PROP_PYFUNC_OPTIONAL will be considered as optional, hence the python code does not have to define/use it. This will ease API evolutions by avoiding to break existing code when adding non-essential new parameters.

Note: this will need some update to API doc generation, patch is ready, will have it reviewed by Campbell asap.

8 years agoMask primitives
Sergey Sharybin [Mon, 26 Aug 2013 20:23:26 +0000 (20:23 +0000)]
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!

8 years agoquiet warnings when building as a python module
Campbell Barton [Mon, 26 Aug 2013 19:32:03 +0000 (19:32 +0000)]
quiet warnings when building as a python module

8 years agoRNA fixes regarding dynamic array properties in functions parameters (reviewed by...
Bastien Montagne [Mon, 26 Aug 2013 16:08:03 +0000 (16:08 +0000)]
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.

8 years agoFix [#36308] Custom hotkey "Set Object Mode" - "Object Mode" doesn't work properly
Bastien Montagne [Mon, 26 Aug 2013 15:43:34 +0000 (15:43 +0000)]
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 ;) ).

8 years agoDon't check for an object mode that is excluded as a prerequisite for
Antony Riakiotakis [Mon, 26 Aug 2013 14:58:16 +0000 (14:58 +0000)]
Don't check for an object mode that is excluded as a prerequisite for
entering this branch of code.

8 years agoRemove unused function NewBooleanMesh
Sergey Sharybin [Mon, 26 Aug 2013 14:53:40 +0000 (14:53 +0000)]
Remove unused function NewBooleanMesh

8 years agoRemove dirty normals assert from drawobject.c
Sergey Sharybin [Mon, 26 Aug 2013 14:53:33 +0000 (14:53 +0000)]
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.

8 years agoCleanup: move defines into anon enums, as suggested by Joshua, thx.
Bastien Montagne [Mon, 26 Aug 2013 14:30:00 +0000 (14:30 +0000)]
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).

8 years agoFix cmake Inkscape auto generate of SVG on OS X giving an error popup, the binary
Brecht Van Lommel [Mon, 26 Aug 2013 14:13:04 +0000 (14:13 +0000)]
Fix cmake Inkscape auto generate of SVG on OS X giving an error popup, the binary
that is found by find_program is a shim that doesn't take command line arguments.

8 years agoCleanup (bitflags are *so much* easy to handle and clear as bit-shift operations...
Bastien Montagne [Mon, 26 Aug 2013 13:50:25 +0000 (13:50 +0000)]
Cleanup (bitflags are *so much* easy to handle and clear as bit-shift operations than raw values!).

8 years agointernal changes to ghash/edgehash, reorganize to split out resizing the hash from...
Campbell Barton [Mon, 26 Aug 2013 13:41:13 +0000 (13:41 +0000)]
internal changes to ghash/edgehash, reorganize to split out resizing the hash from insertion.

8 years agoFix uiList labels themed colors.
Bastien Montagne [Mon, 26 Aug 2013 12:32:46 +0000 (12:32 +0000)]
Fix uiList labels themed colors.
r57760 broke usual labels, and r59511 broke again uiList labels! :P Hopefully every one works as expected now!

8 years agoRevert r59500, has too much drawbakcs in term of speed... This bug ([#36289]) is...
Bastien Montagne [Mon, 26 Aug 2013 12:22:15 +0000 (12:22 +0000)]
Revert r59500, has too much drawbakcs in term of speed... This bug ([#36289]) is not really solvable for now, will mark it as todo. :/

8 years agoRemove (comment out) auto-generating png form svg (r59382) in CMake, handy but gives...
Bastien Montagne [Mon, 26 Aug 2013 12:16:23 +0000 (12:16 +0000)]
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!

8 years agoBugfix #36324
Ton Roosendaal [Mon, 26 Aug 2013 09:59:51 +0000 (09:59 +0000)]
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.

8 years agoadd some safety checks in debug mode to ensure sets/hashes aren't confused.
Campbell Barton [Mon, 26 Aug 2013 09:37:15 +0000 (09:37 +0000)]
add some safety checks in debug mode to ensure sets/hashes aren't confused.

8 years agoBGE: Cleaning up the vsync code a little.
Mitchell Stokes [Mon, 26 Aug 2013 08:14:52 +0000 (08:14 +0000)]
BGE: Cleaning up the vsync code a little.

8 years agono remove double property lookups in ED_fileselect_set_params and redundant NULL...
Campbell Barton [Mon, 26 Aug 2013 06:54:05 +0000 (06:54 +0000)]
no remove double property lookups in ED_fileselect_set_params and redundant NULL check in file_main_area_draw.

8 years agoanother header edit needed
Campbell Barton [Sun, 25 Aug 2013 21:29:33 +0000 (21:29 +0000)]
another header edit needed

8 years agoblenderplayer builds again
Campbell Barton [Sun, 25 Aug 2013 21:24:16 +0000 (21:24 +0000)]
blenderplayer builds again

8 years agominor changes to edgehassh/ghash
Campbell Barton [Sun, 25 Aug 2013 21:02:31 +0000 (21:02 +0000)]
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.

8 years agoreplace hashes with sets where possible.
Campbell Barton [Sun, 25 Aug 2013 20:03:45 +0000 (20:03 +0000)]
replace hashes with sets where possible.

8 years agoBKI_gset and EdgeSet api, use when hash values aren't used (reuses ghash internally...
Campbell Barton [Sun, 25 Aug 2013 20:00:19 +0000 (20:00 +0000)]
BKI_gset and EdgeSet api, use when hash values aren't used (reuses ghash internally without allocating space for the value).

8 years agoFix [#36289] Not change children object on freez layer when change frame.
Bastien Montagne [Sun, 25 Aug 2013 18:45:04 +0000 (18:45 +0000)]
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 ;)

8 years agoPartial revert of UI appearance changes in r52778 in the Strokes tab of the Freestyle...
Tamito Kajiyama [Sun, 25 Aug 2013 16:29:10 +0000 (16:29 +0000)]
Partial revert of UI appearance changes in r52778 in the Strokes tab of the Freestyle Line Style panel.

8 years agomove doxy docs out of the ghash header into the C file.
Campbell Barton [Sun, 25 Aug 2013 16:28:48 +0000 (16:28 +0000)]
move doxy docs out of the ghash header into the C file.

8 years agoclearing the mempool can now keep more then a single element reserved.
Campbell Barton [Sun, 25 Aug 2013 16:16:38 +0000 (16:16 +0000)]
clearing the mempool can now keep more then a single element reserved.

8 years agofix leak in BLI_ghash_clear(). was never freeing entries, add BLI_mempool_clear utili...
Campbell Barton [Sun, 25 Aug 2013 14:58:26 +0000 (14:58 +0000)]
fix leak in BLI_ghash_clear(). was never freeing entries, add BLI_mempool_clear utility function.

8 years agocode cleanup for mempool, refactor chunk initialization into a static function.
Campbell Barton [Sun, 25 Aug 2013 14:50:40 +0000 (14:50 +0000)]
code cleanup for mempool, refactor chunk initialization into a static function.

8 years agomerge mempool allocs per chunk, include the data in the BLI_mempool_chunk alloc.
Campbell Barton [Sun, 25 Aug 2013 13:15:22 +0000 (13:15 +0000)]
merge mempool allocs per chunk, include the data in the BLI_mempool_chunk alloc.

8 years agodoxygen docs for ghash/edgehash
Campbell Barton [Sun, 25 Aug 2013 12:17:46 +0000 (12:17 +0000)]
doxygen docs for ghash/edgehash

8 years agoFor pointer hashing use the same method as python, it gives better distribution.
Campbell Barton [Sat, 24 Aug 2013 20:30:08 +0000 (20:30 +0000)]
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.

8 years agouse ints for ghash/edgehash flags, since its allocated theres not much point to try...
Campbell Barton [Sat, 24 Aug 2013 20:16:14 +0000 (20:16 +0000)]
use ints for ghash/edgehash flags, since its allocated theres not much point to try save a few bytes here.

8 years agoQuiet annoying VC++ warning C4819: The file contains a character that cannot be repre...
Tamito Kajiyama [Sat, 24 Aug 2013 17:36:45 +0000 (17:36 +0000)]
Quiet annoying VC++ warning C4819: The file contains a character that cannot be represented in the current code page.

8 years agoghash: reserve size when its known or can be guessed close enough.
Campbell Barton [Sat, 24 Aug 2013 17:33:47 +0000 (17:33 +0000)]
ghash: reserve size when its known or can be guessed close enough.
also avoid allocs per node in pbvh_bmesh_node_limit_ensure()

8 years agoFix bad draw of plane track when using Tiny display option
Sergey Sharybin [Sat, 24 Aug 2013 17:25:12 +0000 (17:25 +0000)]
Fix bad draw of plane track when using Tiny display option

8 years agoAdd stdlib.h to solve compilation error caused by missing abort() prototype
Sergey Sharybin [Sat, 24 Aug 2013 17:15:59 +0000 (17:15 +0000)]
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?

8 years agocorrect error in face walker (was inserting into the wrong ghash which was immediatel...
Campbell Barton [Sat, 24 Aug 2013 16:43:09 +0000 (16:43 +0000)]
correct error in face walker (was inserting into the wrong ghash which was immediately freed after)

8 years agocloth was using edgehash not quite correctly:
Campbell Barton [Sat, 24 Aug 2013 16:06:18 +0000 (16:06 +0000)]
cloth was using edgehash not quite correctly:
- was ordering vertex args unnecessarily.
- was adding the same edges multiple times into the edgehash.

8 years agocloth spring building: replace MIN2/MAX2 in assignments with a function which orders...
Campbell Barton [Sat, 24 Aug 2013 15:55:56 +0000 (15:55 +0000)]
cloth spring building: replace MIN2/MAX2 in assignments with a function which orders on assignment.

8 years agoFix issue in last subsurface commit with branched path tracing, was rendering too...
Brecht Van Lommel [Sat, 24 Aug 2013 15:36:14 +0000 (15:36 +0000)]
Fix issue in last subsurface commit with branched path tracing, was rendering too bright.

8 years agoavoid double ghash lookup in sculpt map_insert_vert
Campbell Barton [Sat, 24 Aug 2013 15:31:47 +0000 (15:31 +0000)]
avoid double ghash lookup in sculpt map_insert_vert

8 years agoadd versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a reserve argument.
Campbell Barton [Sat, 24 Aug 2013 15:14:50 +0000 (15:14 +0000)]
add versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a reserve argument.

8 years agorevert bucket size change (edgehash was this way for years, since r26206, ghash since...
Campbell Barton [Sat, 24 Aug 2013 15:09:57 +0000 (15:09 +0000)]
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.

8 years agoFix #36541: blender internal raytrace render hangs with high ray depth. The code
Brecht Van Lommel [Sat, 24 Aug 2013 15:02:12 +0000 (15:02 +0000)]
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.

8 years agoCycles: reduce noise using regular path tracing + subsurface scattering with
Brecht Van Lommel [Sat, 24 Aug 2013 15:02:08 +0000 (15:02 +0000)]
Cycles: reduce noise using regular path tracing + subsurface scattering with
new cubic and gaussian falloff. Like the branched path tracer, this will now
shade all intersection points instead of using one at random.

8 years agouse reserve argument for more edgehashs
Campbell Barton [Sat, 24 Aug 2013 14:40:15 +0000 (14:40 +0000)]
use reserve argument for more edgehashs

8 years agofix for leak in cloth modifier
Campbell Barton [Sat, 24 Aug 2013 14:32:43 +0000 (14:32 +0000)]
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.