diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-17 23:06:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-17 23:06:34 +0300 |
commit | c7dfa96aeac0940b093efed9b818e0c0d3c9feba (patch) | |
tree | 23d24587f9c83a8d69315b44d47781cfcd5c7064 /source/blender/editors/object/object_transform.c | |
parent | 55756719fbebf4ffdf0485de58532c73f84ecaac (diff) |
bugfix [#20639] BF25_SVN_25888 and below - OBJ and 3DS import fails
blender supports type changing for textures in a way that python doesnt.
add a new general function.
Example usage:
tex = bpy.data.textures.new("Foo")
tex.type = 'IMAGE'
tex = tex.recast_type()
Macro to give the number of users accounting for fake user.
ID_REAL_USERS(id)
Use this so you can remove a datablock if it has a fake users as well as apply transformations to it in the 3D view.
Move api function bpy.data.add_texture() --> bpy.data.textures.new()/remove()
Diffstat (limited to 'source/blender/editors/object/object_transform.c')
-rw-r--r-- | source/blender/editors/object/object_transform.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 9e4cc012171..15ed20c783e 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -411,7 +411,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo if(ob->type==OB_MESH) { me= ob->data; - if(me->id.us>1) { + if(ID_REAL_USERS(me) > 1) { BKE_report(reports, RPT_ERROR, "Can't apply to a multi user mesh, doing nothing."); return OPERATOR_CANCELLED; } @@ -419,7 +419,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo else if(ob->type==OB_ARMATURE) { arm= ob->data; - if(arm->id.us>1) { + if(ID_REAL_USERS(arm) > 1) { BKE_report(reports, RPT_ERROR, "Can't apply to a multi user armature, doing nothing."); return OPERATOR_CANCELLED; } @@ -427,7 +427,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo else if(ELEM(ob->type, OB_CURVE, OB_SURF)) { cu= ob->data; - if(cu->id.us>1) { + if(ID_REAL_USERS(cu) > 1) { BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing."); return OPERATOR_CANCELLED; } @@ -984,7 +984,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (arm->id.lib) { tot_lib_error++; - } else if(arm->id.us>1) { + } else if(ID_REAL_USERS(arm) > 1) { /*BKE_report(op->reports, RPT_ERROR, "Can't apply to a multi user armature"); return;*/ tot_multiuser_arm_error++; |