- Brought back code for particle edit and fluidsim
- Sanitized code from globals and bad level calls,
  so its ready to come back working.
- Fixed cirle selecting (Ckey now)
- Enabled undo for editmode curve, armature, particle
  and lattice

(another commit following)
This commit is contained in:
2009-01-24 13:45:24 +00:00
parent e71d531238
commit 0ac35ca7c1
26 changed files with 4707 additions and 100 deletions

View File

@@ -243,6 +243,7 @@ PULIB += $(OCGDIR)/blender/ed_curve/libed_curve.a
PULIB += $(OCGDIR)/blender/ed_armature/libed_armature.a
PULIB += $(OCGDIR)/blender/ed_mesh/libed_mesh.a
PULIB += $(OCGDIR)/blender/ed_sculpt/libed_sculpt.a
PULIB += $(OCGDIR)/blender/ed_physics/libed_physics.a
PULIB += $(OCGDIR)/blender/ed_animation/libed_animation.a
PULIB += $(OCGDIR)/blender/ed_transform/libed_transform.a
PULIB += $(OCGDIR)/blender/ed_util/libed_util.a

View File

@@ -301,6 +301,10 @@ void do_effectors(int pa_no, struct ParticleData *pa, struct ParticleKey *state,
void psys_calc_dmcache(struct Object *ob, struct DerivedMesh *dm, struct ParticleSystem *psys);
int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int index, float *fw, struct LinkNode *node);
void reset_particle(struct Scene *scene, struct ParticleData *pa, struct ParticleSystem *psys, struct ParticleSystemModifierData *psmd, struct Object *ob,
float dtime, float cfra, float *vg_vel, float *vg_tan, float *vg_rot);
/* psys_reset */
#define PSYS_RESET_ALL 1
#define PSYS_RESET_DEPSGRAPH 2

View File

@@ -427,8 +427,9 @@ void BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td, EditMesh *em) {
efa->f |= SELECT;
}
if(f->flag & ME_HIDE) efa->h= 1;
if((G.f & G_FACESELECT) && (efa->f & SELECT))
; //XXX EM_select_face(efa, 1); /* flush down */
// XXX flag depricated
// if((G.f & G_FACESELECT) && (efa->f & SELECT))
//XXX EM_select_face(efa, 1); /* flush down */
CustomData_em_copy_data(&bm->pdata, &em->fdata, f->data, &efa->data);
BME_loops_to_corners(bm, &em->fdata, efa->data, f,numCol,numTex);
}

View File

@@ -86,7 +86,6 @@
#ifndef DISABLE_ELBEEM
#include "DNA_object_fluidsim.h"
#include "LBM_fluidsim.h"
#include "elbeem.h"
#include <zlib.h>
#include <string.h>
#endif // DISABLE_ELBEEM

View File

@@ -52,7 +52,6 @@
// headers for fluidsim bobj meshes
#include <stdlib.h>
#include "LBM_fluidsim.h"
#include "elbeem.h"
#include <zlib.h>
#include <string.h>
#include <stdio.h>

View File

@@ -84,7 +84,6 @@
#ifndef DISABLE_ELBEEM
#include "DNA_object_fluidsim.h"
#include "LBM_fluidsim.h"
#include "elbeem.h"
#include <zlib.h>
#include <string.h>
@@ -1689,7 +1688,7 @@ static void initialize_all_particles(Object *ob, ParticleSystem *psys, ParticleS
}
}
/* sets particle to the emitter surface with initial velocity & rotation */
static void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, ParticleSystemModifierData *psmd, Object *ob,
void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, ParticleSystemModifierData *psmd, Object *ob,
float dtime, float cfra, float *vg_vel, float *vg_tan, float *vg_rot)
{
ParticleSettings *part;
@@ -4364,7 +4363,7 @@ static void particles_fluid_step(Scene *scene, Object *ob, ParticleSystem *psys,
gzf = gzopen(filename, "rb");
if (!gzf) {
snprintf(debugStrBuffer,256,"readFsPartData::error - Unable to open file for reading '%s' \n", filename);
//elbeemDebugOut(debugStrBuffer);
elbeemDebugOut(debugStrBuffer);
return;
}
@@ -4424,7 +4423,9 @@ static void particles_fluid_step(Scene *scene, Object *ob, ParticleSystem *psys,
totpart = psys->totpart = activeParts;
snprintf(debugStrBuffer,256,"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d \n", psys->totpart,activeParts,fileParts,readMask);
elbeemDebugOut(debugStrBuffer);
// bad level call
// XXX elbeemDebugOut(debugStrBuffer);
} // fluid sim particles done
}
#endif // DISABLE_ELBEEM

View File

@@ -12,7 +12,7 @@ SConscript(['datafiles/SConscript',
'object/SConscript',
'curve/SConscript',
'gpencil/SConscript',
#'physics/SConscript', enable this when there is actually code in physics/
'physics/SConscript',
'preview/SConscript',
'space_buttons/SConscript',
'space_file/SConscript',

View File

@@ -1984,11 +1984,21 @@ static void free_undoBones(void *lbv)
MEM_freeN(lb);
}
static void *get_armature_edit(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
if(obedit && obedit->type==OB_ARMATURE) {
bArmature *arm= obedit->data;
return arm->edbo;
}
return NULL;
}
/* and this is all the undo system needs to know */
void undo_push_armature(bContext *C, char *name)
{
// XXX solve getdata()
undo_editmode_push(C, name, NULL, free_undoBones, undoBones_to_editBones, editBones_to_undoBones, NULL);
undo_editmode_push(C, name, get_armature_edit, free_undoBones, undoBones_to_editBones, editBones_to_undoBones, NULL);
}

View File

@@ -104,6 +104,8 @@ void docenter_armature (struct Scene *scene, struct View3D *v3d, struct Object *
void auto_align_armature(struct Scene *scene, struct View3D *v3d, short mode);
void unique_editbone_name (ListBase *edbo, char *name);
void undo_push_armature(struct bContext *C, char *name);
/* poseobject.c */
void ED_armature_exit_posemode(struct Base *base);
void ED_armature_enter_posemode(struct Base *base);

View File

@@ -36,8 +36,8 @@ struct Base;
struct View3D;
/* curve_ops.c */
void ED_operatortypes_curve(void);
void ED_keymap_curve(struct wmWindowManager *wm);
void ED_operatortypes_curve(void);
void ED_keymap_curve (struct wmWindowManager *wm);
/* editcurve.c */
void undo_push_curve (struct bContext *C, char *name);
@@ -48,13 +48,14 @@ void make_editNurb (struct Object *obedit);
void remake_editNurb (struct Object *obedit);
void free_editNurb (struct Object *obedit);
void mouse_nurb(struct bContext *C, short mval[2], int extend);
void mouse_nurb (struct bContext *C, short mval[2], int extend);
/* editfont.h */
void make_editText (struct Object *obedit);
void load_editText (struct Object *obedit);
void remake_editText (struct Object *obedit);
void free_editText (struct Object *obedit);
void undo_push_font (struct bContext *C, char *name);
void make_editText (struct Object *obedit);
void load_editText (struct Object *obedit);
void remake_editText (struct Object *obedit);
void free_editText (struct Object *obedit);
#endif /* ED_CURVE_H */

View File

@@ -0,0 +1,96 @@
/*
* $Id: ED_editparticle.h $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2007 by Janne Karhu.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef ED_EDITPARTICLE_H
#define ED_EDITPARTICLE_H
struct Object;
struct ParticleSystem;
struct ParticleEditSettings;
struct RadialControl;
struct ViewContext;
struct rcti;
/* particle edit mode */
void PE_set_particle_edit(struct Scene *scene);
void PE_create_particle_edit(struct Object *ob, struct ParticleSystem *psys);
void PE_free_particle_edit(struct ParticleSystem *psys);
void PE_change_act(void *ob_v, void *act_v);
void PE_change_act_psys(struct Object *ob, struct ParticleSystem *psys);
int PE_can_edit(struct ParticleSystem *psys);
/* access */
struct ParticleSystem *PE_get_current(struct Object *ob);
short PE_get_current_num(struct Object *ob);
int PE_minmax(struct Scene *scene, float *min, float *max);
void PE_get_colors(char sel[4], char nosel[4]);
struct ParticleEditSettings *PE_settings(Scene *scene);
struct RadialControl **PE_radialcontrol(void);
/* update calls */
void PE_hide_keys_time(struct Scene *scene, struct ParticleSystem *psys, float cfra);
void PE_update_object(struct Scene *scene, struct Object *ob, int useflag);
void PE_update_selection(struct Scene *scene, struct Object *ob, int useflag);
void PE_recalc_world_cos(struct Object *ob, struct ParticleSystem *psys);
/* selection tools */
void PE_select_root(void);
void PE_select_tip(void);
void PE_deselectall(void);
void PE_select_linked(void);
void PE_select_less(void);
void PE_select_more(void);
void PE_mouse_particles(void);
void PE_borderselect(struct ViewContext *vc, struct rcti *rect, int select);
void PE_selectionCB(short selecting, struct Object *editobj, short *mval, float rad);
void PE_do_lasso_select(struct ViewContext *, short mcords[][2], short moves, short select);
/* tools */
void PE_hide(int mode);
void PE_rekey(void);
void PE_subdivide(Object *ob);
int PE_brush_particles(void);
void PE_delete_particle(void);
void PE_remove_doubles(void);
void PE_mirror_x(Scene *scene, int tagged);
void PE_selectbrush_menu(Scene *scene);
void PE_remove_doubles(void);
void PE_radialcontrol_start(const int mode);
/* undo */
void PE_undo_push(Scene *scene, char *str);
void PE_undo_step(Scene *scene, int step);
void PE_undo(Scene *scene);
void PE_redo(Scene *scene);
void PE_undo_menu(Scene *scene);
#endif /* ED_EDITPARTICLE_H */

View File

@@ -0,0 +1,52 @@
/**
* BKE_fluidsim.h
*
* $Id: LBM_fluidsim.h 17433 2008-11-12 21:16:53Z blendix $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef ED_FLUIDSIM_H
#define ED_FLUIDSIM_H
struct Object;
struct FluidsimSettings;
extern double fluidsimViscosityPreset[6];
extern char* fluidsimViscosityPresetString[6];
/* allocates and initializes fluidsim data */
struct FluidsimSettings* fluidsimSettingsNew(struct Object *srcob);
/* frees internal data itself */
void fluidsimSettingsFree(struct FluidsimSettings* sb);
/* duplicate internal data */
struct FluidsimSettings* fluidsimSettingsCopy(struct FluidsimSettings* sb);
#endif /* ED_FLUIDSIM_H */

View File

@@ -71,6 +71,7 @@ void add_constraint_to_object (struct bConstraint *con, struct Object *ob);
/* editlattice.c */
void mouse_lattice(struct bContext *C, short mval[2], int extend);
void undo_push_lattice(struct bContext *C, char *name);
/* editkey.c */
void insert_shapekey(struct Scene *scene, struct Object *ob);

View File

@@ -55,6 +55,14 @@ typedef struct ViewContext {
short mval[2];
} ViewContext;
typedef struct ViewDepths {
unsigned short w, h;
float *depths;
double depth_range[2];
char damaged;
} ViewDepths;
float *give_cursor(struct Scene *scene, struct View3D *v3d);
@@ -67,6 +75,7 @@ float read_cached_depth(struct ViewContext *vc, int x, int y);
void request_depth_update(struct ViewContext *vc);
/* Projection */
#define IS_CLIPPED 12000
void project_short(struct ARegion *ar, float *vec, short *adr);
void project_short_noclip(struct ARegion *ar, float *vec, short *adr);

View File

@@ -112,6 +112,7 @@
#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_editparticle.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen.h"
@@ -6131,8 +6132,10 @@ void texspace_edit(Scene *scene, View3D *v3d)
void mirrormenu(void)
{
Scene *scene= NULL; // XXX
if(G.f & G_PARTICLEEDIT) {
// XXX PE_mirror_x(0);
PE_mirror_x(scene, 0);
}
else {
// XXX initTransform(TFM_MIRROR, CTX_NO_PET);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
/* BIF_editparticle.h
*
*
* $Id: BIF_editparticle.h $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2007 by Janne Karhu.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef ED_PHYSICS_INTERN_H
#define ED_PHYSICS_INTERN_H
#endif /* ED_PHYSICS_INTERN_H */

View File

@@ -55,6 +55,7 @@
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_object_force.h"
#include "DNA_object_fluidsim.h"
#include "DNA_particle_types.h"
#include "DNA_space_types.h"
#include "DNA_scene_types.h"
@@ -62,8 +63,6 @@
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
// FSPARTICLE
#include "DNA_object_fluidsim.h"
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
@@ -99,6 +98,7 @@
#include "GPU_material.h"
#include "GPU_extensions.h"
#include "ED_editparticle.h"
#include "ED_mesh.h"
#include "ED_types.h"
#include "ED_util.h"
@@ -1114,14 +1114,12 @@ static void drawlattice__point(Lattice *lt, DispList *dl, int u, int v, int w, i
int index = ((w*lt->pntsv + v)*lt->pntsu) + u;
if(use_wcol) {
#if 0
XXX
float col[3];
MDeformWeight *mdw= get_defweight (lt->dvert+index, use_wcol-1);
weight_to_rgb(mdw?mdw->weight:0.0f, col, col+1, col+2);
glColor3fv(col);
#endif
}
if (dl) {
@@ -2364,7 +2362,7 @@ static void draw_mesh_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
static int draw_mesh_object(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt, int flag)
{
Object *ob= base->object;
Object *obedit= scene->obedit; // XXX hrumf, see below
Object *obedit= scene->obedit;
Mesh *me= ob->data;
EditMesh *em= me->edit_mesh;
int do_alpha_pass= 0, drawlinked= 0, retval= 0, glsl, check_alpha;
@@ -3508,7 +3506,7 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob
ParticleData *pa;
ParticleCacheKey **path;
ParticleEditKey *key;
ParticleEditSettings *pset = NULL; // XXX PE_settings();
ParticleEditSettings *pset = PE_settings(scene);
int i, k, totpart = psys->totpart, totchild=0, timed = pset->draw_timed;
char nosel[4], sel[4];
float sel_col[3];
@@ -3517,7 +3515,7 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob
/* create path and child path cache if it doesn't exist already */
if(psys->pathcache==0){
// XXX PE_hide_keys_time(psys,CFRA);
PE_hide_keys_time(scene, psys,CFRA);
psys_cache_paths(scene, ob, psys, CFRA,0);
}
if(psys->pathcache==0)
@@ -4594,7 +4592,6 @@ static void drawSolidSelect(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
{
// XXX scene->obedit warning
if(ob!=scene->obedit && (ob->flag & SELECT)) {
if(ob==OBACT) {
if(ob->flag & OB_FROMGROUP) UI_ThemeColor(TH_GROUP_ACTIVE);
@@ -4726,7 +4723,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
ob= base->object;
/* XXX ermfh... */
if (ob!=scene->obedit) {
if (ob->restrictflag & OB_RESTRICT_VIEW)
return;
@@ -5087,7 +5083,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
draw_new_particle_system(scene, v3d, rv3d, base, psys, dt);
if(G.f & G_PARTICLEEDIT && ob==OBACT) {
psys= NULL; // XXX PE_get_current(ob);
psys= PE_get_current(ob);
if(psys && !scene->obedit && psys_in_edit_mode(scene, psys))
draw_particle_edit(scene, v3d, rv3d, ob, psys, dt);
}

View File

@@ -70,6 +70,7 @@
#include "RNA_access.h"
#include "RNA_define.h"
#include "ED_editparticle.h"
#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_types.h"
@@ -966,7 +967,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
// XXX ok= minmax_tface(min, max);
}
else if (G.f & G_PARTICLEEDIT) {
// XXX ok= PE_minmax(min, max);
ok= PE_minmax(scene, min, max);
}
else {
Base *base= FIRSTBASE;

View File

@@ -63,6 +63,7 @@
#include "BKE_utildefines.h" /* for VECCOPY */
#include "ED_armature.h"
#include "ED_editparticle.h"
#include "ED_object.h"
#include "ED_mesh.h"
#include "ED_util.h"
@@ -144,7 +145,7 @@ void ED_view3d_exit_paint_modes(bContext *C)
// if(G.f & G_TEXTUREPAINT) set_texturepaint();
// if(G.f & G_SCULPTMODE) set_sculptmode();
// if(G.f & G_PARTICLEEDIT) PE_set_particle_edit();
if(G.f & G_PARTICLEEDIT) PE_set_particle_edit(CTX_data_scene(C));
G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_SCULPTMODE+G_PARTICLEEDIT);
}
@@ -4969,14 +4970,14 @@ static uiBlock *view3d_faceselmenu(bContext *C, uiMenuBlockHandle *handle, void
void do_view3d_select_particlemenu(bContext *C, void *arg, int event)
{
#if 0
/* events >= 6 are registered bpython scripts */
#ifndef DISABLE_PYTHON
if (event >= 6) BPY_menu_do_python(PYMENU_FACESELECT, event - 6);
// XXX if (event >= 6) BPY_menu_do_python(PYMENU_FACESELECT, event - 6);
#endif
switch(event) {
case 0:
PE_borderselect();
// XXX PE_borderselect();
break;
case 1:
PE_deselectall();
@@ -4997,8 +4998,6 @@ void do_view3d_select_particlemenu(bContext *C, void *arg, int event)
PE_select_linked();
break;
}
allqueue(REDRAWVIEW3D, 0);
#endif
}
static uiBlock *view3d_select_particlemenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
@@ -5047,7 +5046,7 @@ static uiBlock *view3d_select_particlemenu(bContext *C, uiMenuBlockHandle *handl
void do_view3d_particle_showhidemenu(bContext *C, void *arg, int event)
{
#if 0
switch(event) {
case 1: /* show hidden */
PE_hide(0);
@@ -5059,8 +5058,6 @@ void do_view3d_particle_showhidemenu(bContext *C, void *arg, int event)
PE_hide(1);
break;
}
allqueue(REDRAWVIEW3D, 0);
#endif
}
static uiBlock *view3d_particle_showhidemenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
@@ -5124,7 +5121,7 @@ uiBlock *view3d_particlemenu(bContext *C, uiMenuBlockHandle *handle, void *arg_u
{
Scene *scene= CTX_data_scene(C);
uiBlock *block;
// XXX ParticleEditSettings *pset= PE_settings();
ParticleEditSettings *pset= PE_settings(scene);
short yco= 0, menuwidth= 120;
block= uiBeginBlock(C, handle->region, "view3d_particlemenu", UI_EMBOSSP, UI_HELV);
@@ -5133,7 +5130,7 @@ uiBlock *view3d_particlemenu(bContext *C, uiMenuBlockHandle *handle, void *arg_u
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Particle Edit Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
// uiDefIconTextBut(block, BUTM, 1, (pset->flag & PE_X_MIRROR)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT, "X-Axis Mirror Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefIconTextBut(block, BUTM, 1, (pset->flag & PE_X_MIRROR)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT, "X-Axis Mirror Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@@ -5406,7 +5403,7 @@ static void do_view3d_buttons(bContext *C, void *arg, int event)
ED_view3d_exit_paint_modes(C);
if(obedit) ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
// XXX PE_set_particle_edit();
PE_set_particle_edit(scene);
}
}
allqueue(REDRAWVIEW3D, 1);

View File

@@ -43,14 +43,6 @@ struct wmWindowManager;
struct EditMesh;
struct ViewContext;
typedef struct ViewDepths {
unsigned short w, h;
float *depths;
double depth_range[2];
char damaged;
} ViewDepths;
/* drawing flags: */
#define DRAW_PICKING 1
#define DRAW_CONSTCOLOR 2
@@ -61,9 +53,6 @@ typedef struct ViewDepths {
#define V3D_SELECT_MOUSE 1
/* project short */
#define IS_CLIPPED 12000
/* view3d_header.c */
void view3d_header_buttons(const struct bContext *C, struct ARegion *ar);

View File

@@ -76,6 +76,7 @@
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_editparticle.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen.h"
@@ -596,7 +597,6 @@ static void do_lasso_select_armature(ViewContext *vc, short mcords[][2], short m
else ebone->flag &= ~(BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
}
}
// XXX countall(); /* abused for flushing selection!!!! */
}
static void do_lasso_select_facemode(ViewContext *vc, short mcords[][2], short moves, short select)
@@ -658,8 +658,8 @@ void view3d_lasso_select(ViewContext *vc, short mcords[][2], short moves, short
do_lasso_select_facemode(vc, mcords, moves, select);
else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))
;
// XX else if(G.f & G_PARTICLEEDIT)
// PE_do_lasso_select(mcords, moves, select);
else if(G.f & G_PARTICLEEDIT)
PE_do_lasso_select(vc, mcords, moves, select);
else
do_lasso_select_objects(vc, mcords, moves, select);
}
@@ -1306,7 +1306,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
else if(obedit==NULL && (G.f & G_PARTICLEEDIT)) {
// XXX PE_borderselect();
PE_borderselect(&vc, &rect, (val==LEFTMOUSE));
return OPERATOR_FINISHED;
}
@@ -1321,7 +1321,6 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
}
else if(ELEM(obedit->type, OB_CURVE, OB_SURF)) {
do_nurbs_box_select(&vc, &rect, val==LEFTMOUSE);
// allqueue(REDRAWVIEW3D, 0);
}
else if(obedit->type==OB_MBALL) {
hits= view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect);
@@ -1568,7 +1567,7 @@ void VIEW3D_OT_select(wmOperatorType *ot)
static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y, int index)
{
struct { short select, mval[2]; float radius; } *data = userData;
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my);
@@ -1578,7 +1577,7 @@ static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y
}
static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
{
struct { short select, mval[2]; float radius; } *data = userData;
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
if (edge_inside_circle(data->mval[0], data->mval[1], (short) data->radius, x0, y0, x1, y1)) {
EM_select_edge(eed, data->select);
@@ -1586,13 +1585,12 @@ static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int
}
static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y, int index)
{
struct { short select, mval[2]; float radius; } *data = userData;
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my);
EditMesh *em= NULL; // XXX
if (r<=data->radius) {
EM_select_face_fgon(em, efa, data->select);
EM_select_face_fgon(data->vc->em, efa, data->select);
}
}
@@ -1615,7 +1613,7 @@ static void mesh_circle_select(ViewContext *vc, int selecting, short *mval, floa
}
}
else {
struct { short select, mval[2]; float radius; } data;
struct {ViewContext *vc; short select, mval[2]; float radius; } data;
bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0));
vc->em= ((Mesh *)vc->obedit->data)->edit_mesh;
@@ -1657,7 +1655,7 @@ static void mesh_circle_select(ViewContext *vc, int selecting, short *mval, floa
static void nurbscurve_circle_doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
{
struct { short select, mval[2]; float radius; } *data = userData;
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my);
@@ -1677,7 +1675,7 @@ static void nurbscurve_circle_doSelect(void *userData, Nurb *nu, BPoint *bp, Bez
}
static void nurbscurve_circle_select(ViewContext *vc, int selecting, short *mval, float rad)
{
struct { short select, mval[2]; float radius; } data;
struct {ViewContext *vc; short select, mval[2]; float radius; } data;
/* set vc-> edit data */
@@ -1692,7 +1690,7 @@ static void nurbscurve_circle_select(ViewContext *vc, int selecting, short *mval
static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int y)
{
struct { short select, mval[2]; float radius; } *data = userData;
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my);
@@ -1702,7 +1700,7 @@ static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int
}
static void lattice_circle_select(ViewContext *vc, int selecting, short *mval, float rad)
{
struct { short select, mval[2]; float radius; } data;
struct {ViewContext *vc; short select, mval[2]; float radius; } data;
/* set vc-> edit data */

View File

@@ -119,13 +119,14 @@
//#include "BIF_space.h"
//#include "BIF_toolbox.h"
#include "ED_armature.h"
#include "ED_types.h"
#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_editparticle.h"
#include "ED_keyframing.h"
#include "ED_keyframes_edit.h"
#include "ED_view3d.h"
#include "ED_mesh.h"
#include "ED_types.h"
#include "ED_view3d.h"
#include "UI_view2d.h"
@@ -1617,7 +1618,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
Object *ob = OBACT;
ParticleSystem *psys = PE_get_current(ob);
ParticleSystemModifierData *psmd = NULL;
ParticleEditSettings *pset = PE_settings();
ParticleEditSettings *pset = PE_settings(t->scene);
ParticleData *pa = NULL;
ParticleEdit *edit;
ParticleEditKey *key;
@@ -1762,7 +1763,7 @@ void flushTransParticles(TransInfo *t)
}
}
PE_update_object(OBACT, 1);
PE_update_object(scene, OBACT, 1);
#endif
}
@@ -3535,7 +3536,6 @@ static void createTransSeqData(bContext *C, TransInfo *t)
Sequence *seq;
int count=0;
float cfra;
@@ -4133,10 +4133,10 @@ void special_aftertrans_update(TransInfo *t)
}
}
else if (ac.datatype == ANIMCONT_SHAPEKEY) {
#if 0 // XXX old animation system
/* fix up the Ipocurves and redraw stuff */
Key *key= (Key *)ac.data;
#if 0 // XXX old animation system
if (key->ipo) {
if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
((cancelled == 0) || (duplicate)) )
@@ -4314,9 +4314,6 @@ void special_aftertrans_update(TransInfo *t)
static void createTransObject(bContext *C, TransInfo *t)
{
Scene *sce = CTX_data_scene(C);
View3D *v3d = t->view;
TransData *td = NULL;
TransDataExtension *tx;
// IpoKey *ik;

View File

@@ -54,7 +54,11 @@
#include "BKE_utildefines.h"
#include "ED_armature.h"
#include "ED_editparticle.h"
#include "ED_curve.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_util.h"
@@ -67,15 +71,7 @@
/* ***************** generic undo system ********************* */
/* ********* XXX **************** */
static void undo_push_curve() {}
static void undo_push_font() {}
static void undo_push_mball() {}
static void undo_push_lattice() {}
static void undo_push_armature() {}
static void PE_undo_push() {}
static void PE_undo() {}
static void PE_redo() {}
static void PE_undo_menu() {}
static void undo_imagepaint_step() {}
static void sound_initialize_sounds() {}
/* ********* XXX **************** */
@@ -90,20 +86,20 @@ void ED_undo_push(bContext *C, char *str)
if(obedit->type==OB_MESH)
undo_push_mesh(C, str);
else if ELEM(obedit->type, OB_CURVE, OB_SURF)
undo_push_curve(str);
undo_push_curve(C, str);
else if (obedit->type==OB_FONT)
undo_push_font(str);
undo_push_font(C, str);
else if (obedit->type==OB_MBALL)
undo_push_mball(str);
else if (obedit->type==OB_LATTICE)
undo_push_lattice(str);
undo_push_lattice(C, str);
else if (obedit->type==OB_ARMATURE)
undo_push_armature(str);
undo_push_armature(C, str);
}
else if(G.f & G_PARTICLEEDIT) {
if (U.undosteps == 0) return;
PE_undo_push(str);
PE_undo_push(CTX_data_scene(C), str);
}
else {
if(U.uiflag & USER_GLOBALUNDO)
@@ -134,9 +130,9 @@ static int ed_undo_step(bContext *C, wmOperator *op, int step)
}
else if(G.f & G_PARTICLEEDIT) {
if(step==1)
PE_undo();
PE_undo(CTX_data_scene(C));
else
PE_redo();
PE_redo(CTX_data_scene(C));
}
else {
do_glob_undo= 1;
@@ -178,7 +174,7 @@ void ED_undo_menu(bContext *C)
}
else {
if(G.f & G_PARTICLEEDIT)
PE_undo_menu();
PE_undo_menu(CTX_data_scene(C));
else if(U.uiflag & USER_GLOBALUNDO) {
char *menu= BKE_undo_menu_string();
if(menu) {

View File

@@ -594,7 +594,7 @@ int WM_gesture_circle_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
static void gesture_circle_apply(bContext *C, wmOperator *op, int event_type)
static void gesture_circle_apply(bContext *C, wmOperator *op)
{
wmGesture *gesture= op->customdata;
rcti *rect= gesture->customdata;
@@ -603,8 +603,6 @@ static void gesture_circle_apply(bContext *C, wmOperator *op, int event_type)
RNA_int_set(op->ptr, "x", rect->xmin);
RNA_int_set(op->ptr, "y", rect->ymin);
RNA_int_set(op->ptr, "radius", rect->xmax);
if( RNA_struct_find_property(op->ptr, "event_type") )
RNA_int_set(op->ptr, "event_type", event_type);
if(op->type->exec)
op->type->exec(C, op);
@@ -627,7 +625,7 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, wmEvent *event)
wm_gesture_tag_redraw(C);
if(gesture->mode)
gesture_circle_apply(C, op, event->type);
gesture_circle_apply(C, op);
break;
case WHEELUPMOUSE:
@@ -646,9 +644,14 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, wmEvent *event)
wm_gesture_end(C, op);
return OPERATOR_FINISHED;
}
else
else {
if( RNA_struct_find_property(op->ptr, "event_type") )
RNA_int_set(op->ptr, "event_type", event->type);
/* apply first click */
gesture_circle_apply(C, op);
gesture->mode= 1;
}
break;
case ESCKEY:
wm_gesture_end(C, op);