Sergey Sharybin
b19c6f8f43
Remove null-check of argument which is attributed as non-null
...
This was logically incorrect and was causing warning and compilation
errors with strict compiler flags.
2016-09-19 10:18:10 +02:00
Julian Eisel
404a427dfd
Minor corrections for previous commit
...
Was using wrong argument name in doxygen comment. Also reduced scope of vars.
Sorry for the noise :/
2016-09-18 21:54:24 +02:00
Julian Eisel
572bc1364c
BLI_listbase: Add/use utility to move link (BLI_listbase_link_move)
...
We were calling BLI_remlink and then BLI_insertlinkbefore/after quite often. BLI_listbase_link_move simplifies code a bit and makes it easier to follow. It also returns if link position has changed which can be used to avoid unnecessary updates.
Added it to a number of list reorder operators for now and made use of return value. Behavior shouldn't be changed.
Also some minor cleanup.
2016-09-18 21:44:42 +02:00
Campbell Barton
867cd2048e
Replace linked-list insert-sort with merge-sort
...
Original code from eglib, modified for reuse with multiple linked-list implementations.
Adds sort functions: BLI_linklist_sort, BLI_linklist_sort_r
2015-06-11 21:54:06 +10:00
Campbell Barton
b8b57d2da9
BLI_listbase: match arg order with BLI_qsort_r
2015-06-11 21:54:06 +10:00
Campbell Barton
f01c6e185f
Cleanup: typos
2015-05-23 22:38:47 +10:00
Bastien Montagne
fca515838e
Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
...
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
Campbell Barton
c31f74de6b
Cleanup: use BLI_listbase_count_ex to avoid redundant looping
2014-11-16 14:23:37 +01:00
Campbell Barton
0e60accf2a
BLI_listbase: Add BLI_listbase_count_ex (sets a limit)
...
This can be used to avoid redundant looping when we only want to know if a list is smaller then some size.
also remove paranoid NULL check in list counting.
2014-11-16 14:06:03 +01:00
Campbell Barton
7d040d2a08
Cleanup: use BLI_listbase_*** prefix for count,sort,sort_r
2014-11-16 13:57:58 +01:00
Campbell Barton
282315d991
ListBase: use BLI_listbase_ for new api calls
2014-10-21 14:06:16 +02:00
Bastien Montagne
be4b2e42c6
BLI_listbase: add BLI_swaplinks which swaps given links' positions in given list.
...
Can be much simpler and quicker than using remlink/insert functions.
2014-10-21 12:07:24 +02:00
Campbell Barton
059e0dafb4
Cleanup: const correctness for BLI_sortlist
2014-09-24 14:55:02 +10:00
Nicholas Bishop
1c8ac33970
Fix incorrect comments in listbase, add unit test to verify change
...
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D708
2014-08-05 10:33:24 -04:00
Campbell Barton
b64e36d26d
BLI_listbase: consistent name prefix
2014-07-30 15:01:16 +10:00
Campbell Barton
0529766f32
Use api function for flipping button list & rename to BLI_listbase_reverse
2014-06-25 19:33:35 +10:00
Campbell Barton
193e77cc67
Fix T40201: Keyframe edits fail to update the viewport
2014-05-19 00:24:45 +10:00
Campbell Barton
f27acb5b56
ListBase: add BLI_sortlist_r api function, remove check for NULL callback
2014-02-13 13:21:16 +11:00
Campbell Barton
2e0422b17f
add function for rotating linked list so at item is last.
2013-09-05 11:40:38 +00:00
Campbell Barton
8ef934c73f
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.
2013-08-26 23:37:08 +00:00
Campbell Barton
d4ab6f3a9e
fix [ #36107 ] Moving origin of instanced objects doesn't work properly
...
now use the active object first if its selected, this means when multiple instances are selected, using the active object gives a predictable outcome.
2013-07-15 01:34:59 +00:00
Campbell Barton
c431df8f77
remove null checks for list functions, all hard asserts so we would have noticed problems already.
2013-05-30 19:05:46 +00:00
Campbell Barton
cfbf9c324b
style cleanup
2013-05-14 06:58:35 +00:00
Campbell Barton
7b707fff56
correct assert for driver evaluation,
...
also add asserts for listbase functions when the list is NULL, and use noreturn attribute for jpeg_error.
2013-05-12 05:54:33 +00:00
Campbell Barton
a19f7899fb
utility functions to reverse and rotate linklists.
2013-05-11 12:18:12 +00:00
Campbell Barton
fcf137dbd7
style cleanup
2013-04-08 04:39:09 +00:00
Campbell Barton
4df5b943ed
patch [ #34103 ] - listbase.patch, insertlinkbefore.patch
...
from Lawrence D'Oliveiro (ldo)
notes from tracker:
use bool for return type from BLI_remlink_safe, necessitating including BLI_utildefines.h in BLI_listbase.h
get rid of duplicate BLI_insertlink, use BLI_insertlinkafter instead.
A few places which were using BLI_insertlinkafter (actually BLI_insertlink), when it would be simpler to use BLI_insertlinkbefore instead.
2013-02-22 14:12:55 +00:00
Campbell Barton
865b547b44
add checks to style checker script for 'a . b' and 'a []'
...
also use BLI_findindex for modifiers_indexInObject
2012-12-15 04:44:10 +00:00
Campbell Barton
f3ece5a108
style cleanup: trailing tabs & expand some non prefix tabs into spaces.
2012-10-21 05:46:41 +00:00
Campbell Barton
27b4b45543
utility functions: BLI_findptr, BLI_rfindptr --- use for finding an item in a linked list by a pointer.
2012-08-18 16:16:13 +00:00
Campbell Barton
bddc7dfc20
style cleanup: remaining BLI files.
2012-05-12 15:13:06 +00:00
Campbell Barton
e701f9b670
style cleanup: whitespace / commas
2012-04-29 15:47:02 +00:00
Campbell Barton
b340f930ec
style cleanup: changes to brace placement / newlines - for/while/if/switch
2012-04-28 06:31:57 +00:00
Campbell Barton
4469ab9857
code cleanup:
...
- move lasso functions into BLI (were in 3D view but UV editor needs access)
- remove unused UV functions (ones that assumed 3-4 sized UVs only)
2012-04-27 07:26:28 +00:00
Campbell Barton
69e6894b15
style cleanup: follow style guide for formatting of if/for/while loops, and else if's
2012-03-24 06:18:31 +00:00
Campbell Barton
31d2ee9bf7
style cleanup, brackets in else/if, some indentation.
2012-03-06 18:40:15 +00:00
Campbell Barton
1531e3677a
bmesh py api
...
* add BLI_rfindlink for reverse index lookup (used so bm.select_history[-1] doesn't have to loop the entire list twice).
* add bm.select_history.active so you can get the last selected item or None without having to check seq length.
2012-03-03 22:07:58 +00:00
Campbell Barton
4a04f72069
remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n
2011-10-23 17:52:20 +00:00
Campbell Barton
08d8914b3d
reverse string lookup listbase function BLI_findstring counterparts, added BLI_rfindstring, BLI_rfindstring_ptr, these search from the end of the listbase (like pythons rfind).
2011-05-02 13:35:04 +00:00
Nathan Letwory
7900b5949f
doxygen: blender/blenlib tagged.
2011-02-27 20:37:56 +00:00
Campbell Barton
0955c664aa
fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
...
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
2011-02-13 10:52:18 +00:00
Campbell Barton
b0f87a1746
rename addlisttolist() to BLI_movelisttolist()
...
name was misleading because the list items were removed from the source list.
(no functional changes)
2010-12-21 14:49:34 +00:00
Campbell Barton
bf52b68dcd
minor changes to rna/python.
...
- raise an exception when python calls is_property_set(name) or is_property_hidden(name) and the property does not exist.
- added BLI_findstring_ptr(), which finds a named item in a listbase where that name is a pointer to a string.
- replaced inline for loops with calls to BLI_findstring_ptr() and IDP_GetPropertyFromGroup().
2010-08-13 06:30:04 +00:00
Campbell Barton
391cc2d004
merge own commits into render branch into trunk since 27560
...
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
Campbell Barton
081c1205a3
correct fsf address
2010-02-12 13:34:04 +00:00
Campbell Barton
95bfbd470e
vertex group sort operator, access from the vgroup panel, sintels mesh has 144 vertex groups which got quite tedious to look through.
2010-02-02 21:43:26 +00:00
Campbell Barton
1cfb5ffb5d
arg!, my secret testing keyword is exposed
2009-12-29 15:47:16 +00:00
Campbell Barton
5cd837a562
* speedup for animating bones, in one scene with sintel and a dragon animated its over 4x faster.
...
* utility function BLI_findstring to avoid listbase lookup loops everywhere.
eg:
ListBase *lb= objects= &CTX_data_main(C)->object;
Object *ob= BLI_findstring(lb, name, offsetof(ID, name) + 2);
* made some more math functions use const's, (fix warnings I made in previous commits)
2009-12-29 15:40:26 +00:00
Campbell Barton
d55ac4da2b
- added rna api function scene.update(), needed for rig generation to update driver deps
...
- removed some warnings
2009-11-24 09:24:32 +00:00
Joshua Leung
68f4465cdc
2.5 - Animation Utility Function
...
Added a utility function to check which transforms for an object or bone are animated, returning these as bitflags and/or optionally retrieving the relevant F-Curves too. Beware that this method may not be working correctly yet, but it shouldn't hurt anyone in the meantime :)
Also, split RNA-path building function up into a version which only creates the path up to the given struct, with the other parts being added later.
2009-09-17 10:14:56 +00:00