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>2010-01-26 14:15:45 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-01-26 14:15:45 +0300
commit5fe3524ab162cf6f9080653fc5f2c1a1384f2c64 (patch)
tree87c1f40845bbd8c4818df5a99d080bee036a16a2 /source/blender/editors/object
parent50e324c5d0f55f92615d083d8f0d999b191f2a75 (diff)
Fix #20803: convert button in particle modifier didn't work
for creating duplis yet.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_add.c1
-rw-r--r--source/blender/editors/object/object_modifier.c121
2 files changed, 58 insertions, 64 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 23bd7034cfe..fede69c10cb 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1152,7 +1152,6 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
ot->idname= "OBJECT_OT_duplicates_make_real";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
ot->exec= object_duplicates_make_real_exec;
ot->poll= ED_operator_scene_editable;
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index eec8104f29b..155e0043132 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -265,78 +265,73 @@ int ED_object_modifier_convert(ReportList *reports, Scene *scene, Object *ob, Mo
psys=((ParticleSystemModifierData *)md)->psys;
part= psys->part;
- if(part->ren_as == PART_DRAW_GR || part->ren_as == PART_DRAW_OB) {
- ; // XXX make_object_duplilist_real(NULL);
- }
- else {
- if(part->ren_as != PART_DRAW_PATH || psys->pathcache == 0)
- return 0;
+ if(part->ren_as != PART_DRAW_PATH || psys->pathcache == 0)
+ return 0;
- totpart= psys->totcached;
- totchild= psys->totchildcache;
+ totpart= psys->totcached;
+ totchild= psys->totchildcache;
- if(totchild && (part->draw&PART_DRAW_PARENT)==0)
- totpart= 0;
+ if(totchild && (part->draw&PART_DRAW_PARENT)==0)
+ totpart= 0;
- /* count */
- cache= psys->pathcache;
- for(a=0; a<totpart; a++) {
- key= cache[a];
- totvert+= key->steps+1;
- totedge+= key->steps;
- }
+ /* count */
+ cache= psys->pathcache;
+ for(a=0; a<totpart; a++) {
+ key= cache[a];
+ totvert+= key->steps+1;
+ totedge+= key->steps;
+ }
- cache= psys->childcache;
- for(a=0; a<totchild; a++) {
- key= cache[a];
- totvert+= key->steps+1;
- totedge+= key->steps;
- }
+ cache= psys->childcache;
+ for(a=0; a<totchild; a++) {
+ key= cache[a];
+ totvert+= key->steps+1;
+ totedge+= key->steps;
+ }
- if(totvert==0) return 0;
+ if(totvert==0) return 0;
- /* add new mesh */
- obn= add_object(scene, OB_MESH);
- me= obn->data;
-
- me->totvert= totvert;
- me->totedge= totedge;
-
- me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
- me->medge= CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
- me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, 0);
-
- mvert= me->mvert;
- medge= me->medge;
-
- /* copy coordinates */
- cache= psys->pathcache;
- for(a=0; a<totpart; a++) {
- key= cache[a];
- kmax= key->steps;
- for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
- VECCOPY(mvert->co,key->co);
- if(k) {
- medge->v1= cvert-1;
- medge->v2= cvert;
- medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
- medge++;
- }
+ /* add new mesh */
+ obn= add_object(scene, OB_MESH);
+ me= obn->data;
+
+ me->totvert= totvert;
+ me->totedge= totedge;
+
+ me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
+ me->medge= CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
+ me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, 0);
+
+ mvert= me->mvert;
+ medge= me->medge;
+
+ /* copy coordinates */
+ cache= psys->pathcache;
+ for(a=0; a<totpart; a++) {
+ key= cache[a];
+ kmax= key->steps;
+ for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
+ VECCOPY(mvert->co,key->co);
+ if(k) {
+ medge->v1= cvert-1;
+ medge->v2= cvert;
+ medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
+ medge++;
}
}
+ }
- cache=psys->childcache;
- for(a=0; a<totchild; a++) {
- key=cache[a];
- kmax=key->steps;
- for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
- VECCOPY(mvert->co,key->co);
- if(k) {
- medge->v1=cvert-1;
- medge->v2=cvert;
- medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
- medge++;
- }
+ cache=psys->childcache;
+ for(a=0; a<totchild; a++) {
+ key=cache[a];
+ kmax=key->steps;
+ for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
+ VECCOPY(mvert->co,key->co);
+ if(k) {
+ medge->v1=cvert-1;
+ medge->v2=cvert;
+ medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
+ medge++;
}
}
}