Merge with trunk/2.5 at r25563
Most likely will not compile for others, I'd appreciate any build errors and missing files reports (I can never seem to get everything committed and all the build systems working without help). Porting over the sculpt/multires tools was a breeze, thanks goes to brecht for a design that didn't exclude ngons and was easy to port. Note that I've not tested externally-backed multires file support yet. Also, I still need to write version patch code for some cases. Some notes: * Like trunk, topological changes don't update multires right, so e.g. subdivide will duplicate multires data on the new faces, instead of subdividing it. * If you set the debug value (ctrl-alt-d) to 1 it'll turn on my experiments in speeding up sculpting on higher-res multires meshes (but note it makes partial redraw not completely accurate). * There's a bug where you have to go through editmode to get out of sculpt mode, not sure if I inherited or created this myself.
This commit is contained in:
@@ -8,6 +8,8 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
|
||||
incs += ' ../../gpu'
|
||||
incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern'
|
||||
|
||||
defs = ''
|
||||
|
||||
if env['OURPLATFORM'] == 'linux2':
|
||||
cflags='-pthread'
|
||||
incs += ' ../../../extern/binreloc/include'
|
||||
@@ -15,4 +17,9 @@ if env['OURPLATFORM'] == 'linux2':
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
incs += ' ' + env['BF_PTHREADS_INC']
|
||||
|
||||
env.BlenderLib ( 'bf_editors_physics', sources, Split(incs), [], libtype=['core'], priority=[45] )
|
||||
|
||||
if env['OURPLATFORM'] == 'darwin':
|
||||
if env['WITH_BF_OPENMP']:
|
||||
defs += ' PARALLEL=1'
|
||||
|
||||
env.BlenderLib ( 'bf_editors_physics', sources, Split(incs), Split(defs), libtype=['core'], priority=[45] )
|
||||
|
||||
@@ -362,7 +362,7 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
|
||||
PE_set_data(C, data);
|
||||
|
||||
view3d_set_viewcontext(C, &data->vc);
|
||||
view3d_get_transformation(&data->vc, data->ob, &data->mats);
|
||||
view3d_get_transformation(data->vc.ar, data->vc.rv3d, data->ob, &data->mats);
|
||||
|
||||
if((data->vc.v3d->drawtype>OB_WIRE) && (data->vc.v3d->flag & V3D_ZBUF_SELECT))
|
||||
view3d_validate_backbuf(&data->vc);
|
||||
@@ -373,7 +373,6 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
|
||||
static int key_test_depth(PEData *data, float co[3])
|
||||
{
|
||||
View3D *v3d= data->vc.v3d;
|
||||
RegionView3D *rv3d= data->vc.rv3d;
|
||||
double ux, uy, uz;
|
||||
float depth;
|
||||
short wco[3], x,y;
|
||||
@@ -393,26 +392,16 @@ static int key_test_depth(PEData *data, float co[3])
|
||||
x=wco[0];
|
||||
y=wco[1];
|
||||
|
||||
// XXX verify ..
|
||||
x+= (short)data->vc.ar->winrct.xmin;
|
||||
y+= (short)data->vc.ar->winrct.ymin;
|
||||
|
||||
if(rv3d->depths && x<rv3d->depths->w && y<rv3d->depths->h) {
|
||||
/* the 0.0001 is an experimental threshold to make selecting keys right next to a surface work better */
|
||||
if((float)uz - 0.0001 > rv3d->depths->depths[y*rv3d->depths->w+x])
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
x+= (short)data->vc.ar->winrct.xmin;
|
||||
y+= (short)data->vc.ar->winrct.ymin;
|
||||
view3d_validate_backbuf(&data->vc);
|
||||
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
|
||||
|
||||
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
|
||||
|
||||
if((float)uz - 0.0001 > depth)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
if((float)uz - 0.0001 > depth)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int key_inside_circle(PEData *data, float rad, float co[3], float *distance)
|
||||
@@ -1174,8 +1163,11 @@ static void update_velocities(Object *ob, PTCacheEdit *edit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PE_update_object(Scene *scene, Object *ob, int useflag)
|
||||
{
|
||||
/* use this to do partial particle updates, not usable when adding or
|
||||
removing, then a full redo is necessary and calling this may crash */
|
||||
ParticleEditSettings *pset= PE_settings(scene);
|
||||
PTCacheEdit *edit = PE_get_current(scene, ob);
|
||||
POINT_P;
|
||||
@@ -1261,29 +1253,51 @@ static void toggle_key_select(PEData *data, int point_index, int key_index)
|
||||
|
||||
/************************ de select all operator ************************/
|
||||
|
||||
static int de_select_all_exec(bContext *C, wmOperator *op)
|
||||
static int select_all_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
PTCacheEdit *edit= PE_get_current(scene, ob);
|
||||
POINT_P; KEY_K;
|
||||
int sel= 0;
|
||||
|
||||
LOOP_VISIBLE_POINTS {
|
||||
LOOP_SELECTED_KEYS {
|
||||
sel= 1;
|
||||
key->flag &= ~PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
int action = RNA_enum_get(op->ptr, "action");
|
||||
|
||||
if (action == SEL_TOGGLE) {
|
||||
action = SEL_SELECT;
|
||||
LOOP_VISIBLE_POINTS {
|
||||
LOOP_SELECTED_KEYS {
|
||||
action = SEL_DESELECT;
|
||||
break;
|
||||
}
|
||||
|
||||
if (action == SEL_DESELECT)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(sel==0) {
|
||||
LOOP_VISIBLE_POINTS {
|
||||
LOOP_KEYS {
|
||||
if(!(key->flag & PEK_SELECT)) {
|
||||
LOOP_VISIBLE_POINTS {
|
||||
LOOP_VISIBLE_KEYS {
|
||||
switch (action) {
|
||||
case SEL_SELECT:
|
||||
if ((key->flag & PEK_SELECT) == 0) {
|
||||
key->flag |= PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
}
|
||||
break;
|
||||
case SEL_DESELECT:
|
||||
if (key->flag & PEK_SELECT) {
|
||||
key->flag &= ~PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
}
|
||||
break;
|
||||
case SEL_INVERT:
|
||||
if ((key->flag & PEK_SELECT) == 0) {
|
||||
key->flag |= PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
} else {
|
||||
key->flag &= ~PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1294,18 +1308,20 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void PARTICLE_OT_select_all_toggle(wmOperatorType *ot)
|
||||
void PARTICLE_OT_select_all(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Select or Deselect All";
|
||||
ot->idname= "PARTICLE_OT_select_all_toggle";
|
||||
ot->name= "Selection of all particles";
|
||||
ot->idname= "PARTICLE_OT_select_all";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= de_select_all_exec;
|
||||
ot->exec= select_all_exec;
|
||||
ot->poll= PE_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
WM_operator_properties_select_all(ot);
|
||||
}
|
||||
|
||||
/************************ pick select operator ************************/
|
||||
@@ -1472,7 +1488,7 @@ void PARTICLE_OT_select_linked(wmOperatorType *ot)
|
||||
|
||||
/************************ border select operator ************************/
|
||||
|
||||
int PE_border_select(bContext *C, rcti *rect, int select)
|
||||
int PE_border_select(bContext *C, rcti *rect, int select, int extend)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
@@ -1482,6 +1498,17 @@ int PE_border_select(bContext *C, rcti *rect, int select)
|
||||
if(!PE_start_edit(edit))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
if (extend == 0 && select) {
|
||||
POINT_P; KEY_K;
|
||||
|
||||
LOOP_VISIBLE_POINTS {
|
||||
LOOP_SELECTED_KEYS {
|
||||
key->flag &= ~PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PE_set_view3d_data(C, &data);
|
||||
data.rect= rect;
|
||||
data.select= select;
|
||||
@@ -2029,6 +2056,12 @@ static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psy
|
||||
edit->mirror_cache= NULL;
|
||||
}
|
||||
|
||||
if(psys->child) {
|
||||
MEM_freeN(psys->child);
|
||||
psys->child= NULL;
|
||||
psys->totchild=0;
|
||||
}
|
||||
|
||||
edit->totpoint= psys->totpart= new_totpart;
|
||||
}
|
||||
|
||||
@@ -2295,7 +2328,6 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
|
||||
|
||||
BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles.", totremoved);
|
||||
|
||||
PE_update_object(scene, ob, 0);
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob);
|
||||
|
||||
@@ -2472,7 +2504,6 @@ static int delete_exec(bContext *C, wmOperator *op)
|
||||
recalc_lengths(data.edit);
|
||||
}
|
||||
|
||||
PE_update_object(data.scene, data.ob, 0);
|
||||
DAG_id_flush_update(&data.ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, data.ob);
|
||||
|
||||
@@ -3698,7 +3729,6 @@ void PE_undo_step(Scene *scene, int step)
|
||||
}
|
||||
}
|
||||
|
||||
PE_update_object(scene, OBACT, 0);
|
||||
DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
@@ -3983,6 +4013,7 @@ static int clear_edited_exec(bContext *C, wmOperator *op)
|
||||
psys->flag &= ~PSYS_EDITED;
|
||||
|
||||
psys_reset(psys, PSYS_RESET_DEPSGRAPH);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob);
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
}
|
||||
}
|
||||
@@ -4004,39 +4035,3 @@ void PARTICLE_OT_edited_clear(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/*********************** specials menu **************************/
|
||||
|
||||
static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
ParticleEditSettings *pset=PE_settings(scene);
|
||||
uiPopupMenu *pup;
|
||||
uiLayout *layout;
|
||||
|
||||
pup= uiPupMenuBegin(C, "Specials", 0);
|
||||
layout= uiPupMenuLayout(pup);
|
||||
|
||||
uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey");
|
||||
if(pset->selectmode & SCE_SELECT_POINT) {
|
||||
uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide");
|
||||
uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first");
|
||||
uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last");
|
||||
}
|
||||
uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles");
|
||||
|
||||
uiPupMenuEnd(C, pup);
|
||||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
void PARTICLE_OT_specials_menu(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Specials Menu";
|
||||
ot->idname= "PARTICLE_OT_specials_menu";
|
||||
|
||||
/* api callbacks */
|
||||
ot->invoke= specials_menu_invoke;
|
||||
ot->poll= PE_hair_poll;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "WM_types.h"
|
||||
|
||||
#include "ED_particle.h"
|
||||
#include "ED_screen.h"
|
||||
|
||||
#include "physics_intern.h"
|
||||
|
||||
@@ -69,7 +70,7 @@ static int particle_system_add_exec(bContext *C, wmOperator *op)
|
||||
if(!scene || !ob)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
object_add_particle_system(scene, ob);
|
||||
object_add_particle_system(scene, ob, NULL);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -83,8 +84,9 @@ void OBJECT_OT_particle_system_add(wmOperatorType *ot)
|
||||
ot->description="Add a particle system.";
|
||||
|
||||
/* api callbacks */
|
||||
ot->poll= ED_operator_object_active_editable;
|
||||
ot->exec= particle_system_add_exec;
|
||||
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
@@ -120,6 +122,7 @@ void OBJECT_OT_particle_system_remove(wmOperatorType *ot)
|
||||
ot->description="Remove the selected particle system.";
|
||||
|
||||
/* api callbacks */
|
||||
ot->poll= ED_operator_object_active_editable;
|
||||
ot->exec= particle_system_remove_exec;
|
||||
|
||||
/* flags */
|
||||
@@ -266,11 +269,11 @@ static int remove_particle_target_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void PARTICLE_OT_remove_target(wmOperatorType *ot)
|
||||
void PARTICLE_OT_target_remove(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Remove Particle Target";
|
||||
ot->idname= "PARTICLE_OT_remove_target";
|
||||
ot->idname= "PARTICLE_OT_target_remove";
|
||||
ot->description="Remove the selected particle target.";
|
||||
|
||||
/* api callbacks */
|
||||
|
||||
@@ -98,6 +98,14 @@
|
||||
/* enable/disable overall compilation */
|
||||
#ifndef DISABLE_ELBEEM
|
||||
|
||||
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
||||
/* ************** libgomp (Apple gcc 4.2.1) TLS bug workaround *************** */
|
||||
#include <pthread.h>
|
||||
extern pthread_key_t gomp_tls_key;
|
||||
static void *thread_tls_data;
|
||||
#endif
|
||||
|
||||
|
||||
/* XXX */
|
||||
/* from header info.c */
|
||||
static int start_progress_bar(void) {return 0;};
|
||||
@@ -320,6 +328,11 @@ static void *fluidsimSimulateThread(void *unused) { // *ptr) {
|
||||
//char* fnameCfgPath = (char*)(ptr);
|
||||
int ret=0;
|
||||
|
||||
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
||||
// Workaround for Apple gcc 4.2.1 omp vs background thread bug
|
||||
pthread_setspecific (gomp_tls_key, thread_tls_data);
|
||||
#endif
|
||||
|
||||
ret = elbeemSimulate();
|
||||
BLI_lock_thread(LOCK_CUSTOM1);
|
||||
if(globalBakeState==0) {
|
||||
@@ -1036,6 +1049,11 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob)
|
||||
// set to neutral, -1 means user abort, -2 means init error
|
||||
globalBakeState = 0;
|
||||
globalBakeFrame = 0;
|
||||
|
||||
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
||||
// Workaround for Apple gcc 4.2.1 omp vs background thread bug
|
||||
thread_tls_data = pthread_getspecific(gomp_tls_key);
|
||||
#endif
|
||||
BLI_init_threads(&threads, fluidsimSimulateThread, 1);
|
||||
BLI_insert_thread(&threads, targetFile);
|
||||
|
||||
@@ -1200,6 +1218,6 @@ void FLUID_OT_bake(wmOperatorType *ot)
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= fluid_bake_exec;
|
||||
ot->poll= ED_operator_object_active;
|
||||
ot->poll= ED_operator_object_active_editable;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
struct wmOperatorType;
|
||||
|
||||
/* particle_edit.c */
|
||||
void PARTICLE_OT_select_all_toggle(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_select_all(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_select_first(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_select_last(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_select_linked(struct wmOperatorType *ot);
|
||||
@@ -57,8 +57,6 @@ void PARTICLE_OT_brush_set(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_brush_edit(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_brush_radial_control(struct wmOperatorType *ot);
|
||||
|
||||
void PARTICLE_OT_specials_menu(struct wmOperatorType *ot);
|
||||
|
||||
void PARTICLE_OT_particle_edit_toggle(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_edited_clear(struct wmOperatorType *ot);
|
||||
|
||||
@@ -68,7 +66,7 @@ void OBJECT_OT_particle_system_remove(struct wmOperatorType *ot);
|
||||
|
||||
void PARTICLE_OT_new(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_new_target(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_remove_target(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_target_remove(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_target_move_up(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_target_move_down(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_connect_hair(struct wmOperatorType *ot);
|
||||
@@ -99,7 +97,7 @@ void PTCACHE_OT_free_bake_all(struct wmOperatorType *ot);
|
||||
void PTCACHE_OT_bake(struct wmOperatorType *ot);
|
||||
void PTCACHE_OT_free_bake(struct wmOperatorType *ot);
|
||||
void PTCACHE_OT_bake_from_cache(struct wmOperatorType *ot);
|
||||
void PTCACHE_OT_add_new(struct wmOperatorType *ot);
|
||||
void PTCACHE_OT_add(struct wmOperatorType *ot);
|
||||
void PTCACHE_OT_remove(struct wmOperatorType *ot);
|
||||
|
||||
#endif /* ED_PHYSICS_INTERN_H */
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
static void operatortypes_particle(void)
|
||||
{
|
||||
WM_operatortype_append(PARTICLE_OT_select_all_toggle);
|
||||
WM_operatortype_append(PARTICLE_OT_select_all);
|
||||
WM_operatortype_append(PARTICLE_OT_select_first);
|
||||
WM_operatortype_append(PARTICLE_OT_select_last);
|
||||
WM_operatortype_append(PARTICLE_OT_select_linked);
|
||||
@@ -64,8 +64,6 @@ static void operatortypes_particle(void)
|
||||
WM_operatortype_append(PARTICLE_OT_brush_edit);
|
||||
WM_operatortype_append(PARTICLE_OT_brush_radial_control);
|
||||
|
||||
WM_operatortype_append(PARTICLE_OT_specials_menu);
|
||||
|
||||
WM_operatortype_append(PARTICLE_OT_particle_edit_toggle);
|
||||
WM_operatortype_append(PARTICLE_OT_edited_clear);
|
||||
|
||||
@@ -75,7 +73,7 @@ static void operatortypes_particle(void)
|
||||
|
||||
WM_operatortype_append(PARTICLE_OT_new);
|
||||
WM_operatortype_append(PARTICLE_OT_new_target);
|
||||
WM_operatortype_append(PARTICLE_OT_remove_target);
|
||||
WM_operatortype_append(PARTICLE_OT_target_remove);
|
||||
WM_operatortype_append(PARTICLE_OT_target_move_up);
|
||||
WM_operatortype_append(PARTICLE_OT_target_move_down);
|
||||
WM_operatortype_append(PARTICLE_OT_connect_hair);
|
||||
@@ -94,7 +92,7 @@ static void keymap_particle(wmKeyConfig *keyconf)
|
||||
keymap= WM_keymap_find(keyconf, "Particle", 0, 0);
|
||||
keymap->poll= PE_poll;
|
||||
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
|
||||
@@ -113,7 +111,7 @@ static void keymap_particle(wmKeyConfig *keyconf)
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
||||
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_specials_menu", WKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_menu(keymap, "VIEW3D_MT_particle_specials", WKEY, KM_PRESS, 0, 0);
|
||||
|
||||
ED_object_generic_keymap(keyconf, keymap, 1);
|
||||
}
|
||||
@@ -149,7 +147,7 @@ static void operatortypes_pointcache(void)
|
||||
WM_operatortype_append(PTCACHE_OT_bake);
|
||||
WM_operatortype_append(PTCACHE_OT_free_bake);
|
||||
WM_operatortype_append(PTCACHE_OT_bake_from_cache);
|
||||
WM_operatortype_append(PTCACHE_OT_add_new);
|
||||
WM_operatortype_append(PTCACHE_OT_add);
|
||||
WM_operatortype_append(PTCACHE_OT_remove);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,9 +80,21 @@ static int ptcache_poll(bContext *C)
|
||||
return (ptr.data && ptr.id.data);
|
||||
}
|
||||
|
||||
void bake_console_progress(void *arg, int nr)
|
||||
{
|
||||
printf("\rbake: %3i%%", nr);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void bake_console_progress_end(void *arg)
|
||||
{
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
PTCacheBaker baker;
|
||||
|
||||
|
||||
@@ -94,8 +106,16 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
|
||||
baker.quick_step = 1;
|
||||
baker.break_test = cache_break_test;
|
||||
baker.break_data = NULL;
|
||||
baker.progressbar = (void (*)(void *, int))WM_timecursor;
|
||||
baker.progresscontext = CTX_wm_window(C);
|
||||
|
||||
if (win) {
|
||||
baker.progressbar = (void (*)(void *, int))WM_timecursor;
|
||||
baker.progressend = (void (*)(void *))WM_cursor_restore;
|
||||
baker.progresscontext = win;
|
||||
} else {
|
||||
baker.progressbar = bake_console_progress;
|
||||
baker.progressend = bake_console_progress_end;
|
||||
baker.progresscontext = NULL;
|
||||
}
|
||||
|
||||
BKE_ptcache_make_cache(&baker);
|
||||
|
||||
@@ -156,6 +176,7 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot)
|
||||
static int ptcache_bake_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
|
||||
Object *ob= ptr.id.data;
|
||||
PointCache *cache= ptr.data;
|
||||
@@ -178,8 +199,17 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op)
|
||||
baker.quick_step = 1;
|
||||
baker.break_test = cache_break_test;
|
||||
baker.break_data = NULL;
|
||||
baker.progressbar = (void (*)(void *, int))WM_timecursor;
|
||||
baker.progresscontext = CTX_wm_window(C);
|
||||
|
||||
if (win) {
|
||||
baker.progressbar = (void (*)(void *, int))WM_timecursor;
|
||||
baker.progressend = (void (*)(void *))WM_cursor_restore;
|
||||
baker.progresscontext = win;
|
||||
} else {
|
||||
printf("\n"); /* empty first line before console reports */
|
||||
baker.progressbar = bake_console_progress;
|
||||
baker.progressend = bake_console_progress_end;
|
||||
baker.progresscontext = NULL;
|
||||
}
|
||||
|
||||
BKE_ptcache_make_cache(&baker);
|
||||
|
||||
@@ -308,11 +338,11 @@ static int ptcache_remove_exec(bContext *C, wmOperator *op)
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
void PTCACHE_OT_add_new(wmOperatorType *ot)
|
||||
void PTCACHE_OT_add(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Add new cache";
|
||||
ot->idname= "PTCACHE_OT_add_new";
|
||||
ot->idname= "PTCACHE_OT_add";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= ptcache_add_new_exec;
|
||||
|
||||
Reference in New Issue
Block a user