Only search projects.blender.org
Log In
New Account
Home
My Page
Projects
Blender 2.x BF release
Summary
Activity
Tracker
SCM
Files
Blender 2.6 Bug Tracker: Browse
[#24742] materials.pop() doesn't decrement user count [patch]
Date:
2010-11-16 01:39
Priority:
3
State:
Closed
Submitted by:
Dan Eicher (
dna
)
Assigned to:
Campbell Barton (campbellbarton)
Category:
Python
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
Summary:
materials.pop() doesn't decrement user count [patch]
Detailed description
append() and pop() don't seem to fit in with the whole rna thing either but that's another subject altogether...
Index: source/blender/blenkernel/intern/material.c
===================================================================
--- source/blender/blenkernel/intern/material.c (revision 33087)
+++ source/blender/blenkernel/intern/material.c (working copy)
@@ -492,6 +492,7 @@
short *totcol= give_totcolp_id(id);
if(index >= 0 && index < (*totcol)) {
ret= (*matar)[index];
+ id_us_min((ID *)ret);
if(*totcol <= 1) {
*totcol= 0;
MEM_freeN(*matar);
Followup
Message
Date
: 2010-11-16 03:26
Sender
:
Campbell Barton
committed r33090.
reasoning for append/pop
- .add/remove() is for anonymous elements - like a vertex or a meta-ball.
- .new/remove() is for elements which can only exist in the collection, like bones, meshes, groups.
- .link/unlink() is for data which exists outside the collection but is being added where it is an unordered collection of unique items.
- .append/pop() is used for materials because the order matters and they can exist more then once in the same list.
Attached Files:
No Files Currently Attached
Changes:
Field
Old Value
Date
By
Resolution
Fixed
2010-11-16 05:44
campbellbarton
close_date
2010-11-16 05:44
2010-11-16 05:44
campbellbarton
Resolution
None
2010-11-16 03:26
campbellbarton
close_date
2010-11-16 03:26
2010-11-16 03:26
campbellbarton
assigned_to
none
2010-11-16 03:26
campbellbarton
status_id
Open
2010-11-16 03:26
campbellbarton