Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-21 19:34:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-21 19:34:09 +0400
commit94902dac977cfc089e9740782a19c6ab370cdc03 (patch)
treebf715f3e99859913a741dd37e3338a6f5cfe7eb6 /source/blender/blenkernel
parent65143c50e0cbbd111c5fa01f54d0177d1a50704f (diff)
2.5 UI: Modifier Template
* template_modifier creates the modifier box, and returns a layout to put the buttons in. * Only the armature modifier is now done with python code, all other modifiers use C code. To convert a modifier to python, remove the corresponding C code and create a function in DATA_PT_modifiers. * Some modifiers still require some RNA work to get it working well, especially to make pointers editable. Mostly that is a matter of defining an own _set callback and put some of the modifier C code into it. * Still various buttons that don't work, like for hooks or mesh deform binding. * Fix for crashing decimate modifier (still disabled). * Removed UI_BUT_NO_HILITE, HMENU. * Make uiLayoutBox work with align.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_object.h1
-rw-r--r--source/blender/blenkernel/intern/modifier.c15
-rw-r--r--source/blender/blenkernel/intern/object.c12
3 files changed, 22 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 2af72d98701..3d71193f37a 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -85,6 +85,7 @@ struct Object *add_object(struct Scene *scene, int type);
struct Object *copy_object(struct Object *ob);
void expand_local_object(struct Object *ob);
void make_local_object(struct Object *ob);
+int object_data_is_libdata(struct Object *ob);
void set_mblur_offs(float blur);
void set_field_offs(float field);
void disable_speed_curve(int val);
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 6578feeeed1..d02b660d992 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -4058,17 +4058,15 @@ static void decimateModifier_copyData(ModifierData *md, ModifierData *target)
tdmd->percent = dmd->percent;
}
-//XXX
-#if 0
static DerivedMesh *decimateModifier_applyModifier(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
int useRenderParams, int isFinalCalc)
{
- DecimateModifierData *dmd = (DecimateModifierData*) md;
+ // DecimateModifierData *dmd = (DecimateModifierData*) md;
DerivedMesh *dm = derivedData, *result = NULL;
MVert *mvert;
MFace *mface;
- LOD_Decimation_Info lod;
+ // LOD_Decimation_Info lod;
int totvert, totface;
int a, numTris;
@@ -4090,6 +4088,8 @@ static DerivedMesh *decimateModifier_applyModifier(
goto exit;
}
+ // XXX
+#if 0
lod.vertex_buffer= MEM_mallocN(3*sizeof(float)*totvert, "vertices");
lod.vertex_normal_buffer= MEM_mallocN(3*sizeof(float)*totvert, "normals");
lod.triangle_index_buffer= MEM_mallocN(3*sizeof(int)*numTris, "trias");
@@ -4174,11 +4174,14 @@ static DerivedMesh *decimateModifier_applyModifier(
MEM_freeN(lod.vertex_buffer);
MEM_freeN(lod.vertex_normal_buffer);
MEM_freeN(lod.triangle_index_buffer);
+#else
+ modifier_setError(md, "Modifier not working yet in 2.5.");
+ goto exit;
+#endif
exit:
return result;
}
-#endif
/* Smooth */
@@ -8271,7 +8274,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
mti->flags = eModifierTypeFlag_AcceptsMesh;
mti->initData = decimateModifier_initData;
mti->copyData = decimateModifier_copyData;
- //XXX mti->applyModifier = decimateModifier_applyModifier;
+ mti->applyModifier = decimateModifier_applyModifier;
mti = INIT_TYPE(Smooth);
mti->type = eModifierTypeType_OnlyDeform;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index b913651d856..d7619010808 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1320,6 +1320,18 @@ void make_local_object(Object *ob)
expand_local_object(ob);
}
+/* returns true if the Object data is a from an external blend file (libdata) */
+int object_data_is_libdata(Object *ob)
+{
+ if(!ob) return 0;
+ if(ob->proxy) return 0;
+ if(ob->id.lib) return 1;
+ if(!ob->data) return 0;
+ if(((ID *)ob->data)->lib) return 1;
+
+ return 0;
+}
+
/* *************** PROXY **************** */
/* when you make proxy, ensure the exposed layers are extern */