forked from bartvdbraak/blender
code cleanup: rename G.rt to G.debug_value
This commit is contained in:
parent
5019cd179f
commit
0b5a995cfd
@ -60,20 +60,26 @@ typedef struct Global {
|
||||
|
||||
/* strings of recent opened files */
|
||||
struct ListBase recent_files;
|
||||
|
||||
|
||||
short afbreek, moving, file_loaded;
|
||||
char background;
|
||||
char factory_startup;
|
||||
short winpos, displaymode; /* used to be in Render */
|
||||
short rendering; /* to indicate render is busy, prevent renderwindow events etc */
|
||||
|
||||
short rt;
|
||||
/* debug value, can be set from the UI and python, used for testing nonstandard features */
|
||||
short debug_value;
|
||||
|
||||
/* saved to the blend file as FileGlobal.globalf,
|
||||
* however this is now only used for runtime options */
|
||||
int f;
|
||||
|
||||
/* debug flag, G_DEBUG, G_DEBUG_PYTHON & friends, set python or command line args */
|
||||
int debug;
|
||||
|
||||
/* Used for BMesh transformations */
|
||||
struct BME_Glob *editBMesh;
|
||||
|
||||
|
||||
/* Frank's variables */
|
||||
int save_over;
|
||||
|
||||
@ -88,7 +94,7 @@ typedef struct Global {
|
||||
|
||||
/* this variable is written to / read from FileGlobal->fileflags */
|
||||
int fileflags;
|
||||
|
||||
|
||||
/* save the allowed windowstate of blender when using -W or -w */
|
||||
int windowstate;
|
||||
} Global;
|
||||
|
@ -662,7 +662,7 @@ void cloth_free_modifier(ClothModifierData *clmd )
|
||||
void cloth_free_modifier_extern(ClothModifierData *clmd )
|
||||
{
|
||||
Cloth *cloth = NULL;
|
||||
if (G.rt > 0)
|
||||
if (G.debug_value > 0)
|
||||
printf("cloth_free_modifier_extern\n");
|
||||
|
||||
if ( !clmd )
|
||||
@ -671,7 +671,7 @@ void cloth_free_modifier_extern(ClothModifierData *clmd )
|
||||
cloth = clmd->clothObject;
|
||||
|
||||
if ( cloth ) {
|
||||
if (G.rt > 0)
|
||||
if (G.debug_value > 0)
|
||||
printf("cloth_free_modifier_extern in\n");
|
||||
|
||||
// If our solver provides a free function, call it
|
||||
@ -852,7 +852,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
|
||||
// If we have a clothObject, free it.
|
||||
if ( clmd->clothObject != NULL ) {
|
||||
cloth_free_modifier ( clmd );
|
||||
if (G.rt > 0)
|
||||
if (G.debug_value > 0)
|
||||
printf("cloth_free_modifier cloth_from_object\n");
|
||||
}
|
||||
|
||||
@ -1278,7 +1278,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
|
||||
cloth->edgehash = edgehash;
|
||||
|
||||
if (G.rt > 0)
|
||||
if (G.debug_value > 0)
|
||||
printf("avg_len: %f\n", clmd->sim_parms->avg_spring_len);
|
||||
|
||||
return 1;
|
||||
|
@ -710,7 +710,7 @@ int implicit_init(Object *UNUSED(ob), ClothModifierData *clmd)
|
||||
Implicit_Data *id = NULL;
|
||||
LinkNode *search = NULL;
|
||||
|
||||
if (G.rt > 0)
|
||||
if (G.debug_value > 0)
|
||||
printf("implicit_init\n");
|
||||
|
||||
// init memory guard
|
||||
@ -1918,7 +1918,7 @@ void implicit_set_positions(ClothModifierData *clmd)
|
||||
copy_v3_v3(id->X[i], verts[i].x);
|
||||
copy_v3_v3(id->V[i], verts[i].v);
|
||||
}
|
||||
if (G.rt > 0)
|
||||
if (G.debug_value > 0)
|
||||
printf("implicit_set_positions\n");
|
||||
}
|
||||
|
||||
|
@ -1941,7 +1941,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
|
||||
}
|
||||
|
||||
}
|
||||
if ((deflected < 2)&& (G.rt != 444)) { /* we did not hit a face until now */
|
||||
if ((deflected < 2)&& (G.debug_value != 444)) { /* we did not hit a face until now */
|
||||
/* see if 'outer' hits an edge */
|
||||
float dist;
|
||||
|
||||
@ -2493,7 +2493,7 @@ static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, fl
|
||||
static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, float timenow, int nl_flags)
|
||||
{
|
||||
/* redirection to the new threaded Version */
|
||||
if (!(G.rt & 0x10)) { // 16
|
||||
if (!(G.debug_value & 0x10)) { // 16
|
||||
softbody_calc_forcesEx(scene, ob, forcetime, timenow, nl_flags);
|
||||
return;
|
||||
}
|
||||
@ -2504,7 +2504,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
|
||||
/*backward compatibility note:
|
||||
fixing bug [17428] which forces adaptive step size to tiny steps
|
||||
in some situations
|
||||
.. keeping G.rt==17 0x11 option for old files 'needing' the bug*/
|
||||
.. keeping G.debug_value==17 0x11 option for old files 'needing' the bug*/
|
||||
|
||||
/* rule we never alter free variables :bp->vec bp->pos in here !
|
||||
* this will ruin adaptive stepsize AKA heun! (BM)
|
||||
@ -2756,9 +2756,9 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
|
||||
|
||||
if (sb_deflect_face(ob, bp->pos, facenormal, defforce, &cf, timenow, vel, &intrusion)) {
|
||||
if ((!nl_flags)&&(intrusion < 0.0f)) {
|
||||
if (G.rt & 0x01) { // 17 we did check for bit 0x10 before
|
||||
if (G.debug_value & 0x01) { // 17 we did check for bit 0x10 before
|
||||
/*fixing bug [17428] this forces adaptive step size to tiny steps
|
||||
in some situations .. keeping G.rt==17 option for old files 'needing' the bug
|
||||
in some situations .. keeping G.debug_value==17 option for old files 'needing' the bug
|
||||
*/
|
||||
/*bjornmose: uugh.. what an evil hack
|
||||
violation of the 'don't touch bp->pos in here' rule
|
||||
@ -2837,7 +2837,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
|
||||
nlEnd(NL_MATRIX);
|
||||
nlEnd(NL_SYSTEM);
|
||||
|
||||
if ((G.rt == 32) && (nl_flags & NLF_BUILD)) {
|
||||
if ((G.debug_value == 32) && (nl_flags & NLF_BUILD)) {
|
||||
printf("####MEE#####\n");
|
||||
nlPrintMatrix();
|
||||
}
|
||||
@ -2849,7 +2849,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
|
||||
float f;
|
||||
int index =0;
|
||||
/* for debug purpose .. anyhow cropping B vector looks like working */
|
||||
if (G.rt ==32)
|
||||
if (G.debug_value ==32)
|
||||
for (a=2*sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
|
||||
f=nlGetVariable(0, index);
|
||||
printf("(%f ", f);index++;
|
||||
|
@ -9430,7 +9430,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
|
||||
fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
|
||||
|
||||
/* allow typing in a new lib path */
|
||||
if (G.rt == -666) {
|
||||
if (G.debug_value == -666) {
|
||||
while (fd == NULL) {
|
||||
char newlib_path[FILE_MAX] = {0};
|
||||
printf("Missing library...'\n");
|
||||
|
@ -502,7 +502,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
|
||||
BLI_edgehash_free(ehash2, NULL);
|
||||
}
|
||||
|
||||
// XXX if (G.rt == 8)
|
||||
// XXX if (G.debug_value == 8)
|
||||
// unwrap_lscm(1);
|
||||
|
||||
me->drawflag |= ME_DRAWSEAMS;
|
||||
|
@ -505,7 +505,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
WM_jobs_stop_all(CTX_wm_manager(C));
|
||||
|
||||
/* get main */
|
||||
if (G.rt == 101) {
|
||||
if (G.debug_value == 101) {
|
||||
/* thread-safety experiment, copy main from the undo buffer */
|
||||
mainp = BKE_undo_get_main(&scene);
|
||||
}
|
||||
|
@ -372,11 +372,11 @@ void ED_area_overdraw(bContext *C)
|
||||
if (az->ar) {
|
||||
/* only display tab or icons when the region is hidden */
|
||||
if (az->ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) {
|
||||
if (G.rt == 3)
|
||||
if (G.debug_value == 3)
|
||||
region_draw_azone_icon(az);
|
||||
else if (G.rt == 2)
|
||||
else if (G.debug_value == 2)
|
||||
region_draw_azone_tria(az);
|
||||
else if (G.rt == 1)
|
||||
else if (G.debug_value == 1)
|
||||
region_draw_azone_tab(az);
|
||||
else
|
||||
region_draw_azone_tab_plus(az);
|
||||
@ -858,11 +858,11 @@ static void region_azone_initialize(ScrArea *sa, ARegion *ar, AZEdge edge)
|
||||
az->edge = edge;
|
||||
|
||||
if (ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) {
|
||||
if (G.rt == 3)
|
||||
if (G.debug_value == 3)
|
||||
region_azone_icon(sa, az, ar);
|
||||
else if (G.rt == 2)
|
||||
else if (G.debug_value == 2)
|
||||
region_azone_tria(sa, az, ar);
|
||||
else if (G.rt == 1)
|
||||
else if (G.debug_value == 1)
|
||||
region_azone_tab(sa, az, ar);
|
||||
else
|
||||
region_azone_tab_plus(sa, az, ar);
|
||||
@ -1113,7 +1113,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
|
||||
|
||||
static void area_calc_totrct(ScrArea *sa, int sizex, int sizey)
|
||||
{
|
||||
short rt = 0; // CLAMPIS(G.rt, 0, 16);
|
||||
short rt = 0; // CLAMPIS(G.debug_value, 0, 16);
|
||||
|
||||
if (sa->v1->vec.x > 0) sa->totrct.xmin = sa->v1->vec.x + 1 + rt;
|
||||
else sa->totrct.xmin = sa->v1->vec.x;
|
||||
|
@ -913,7 +913,7 @@ static void drawscredge_area(ScrArea *sa, int sizex, int sizey, int center)
|
||||
short y2 = sa->v3->vec.y;
|
||||
short a, rt;
|
||||
|
||||
rt = 0; // CLAMPIS(G.rt, 0, 16);
|
||||
rt = 0; // CLAMPIS(G.debug_value, 0, 16);
|
||||
|
||||
if (center == 0) {
|
||||
cpack(0x505050);
|
||||
|
@ -4783,7 +4783,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
||||
* pin so changing states dosnt hide the logic brick */
|
||||
char pin;
|
||||
|
||||
if (G.rt == 0) {
|
||||
if (G.debug_value == 0) {
|
||||
logic_buttons_new(C, ar);
|
||||
return;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ static int node_sockets_poll(const bContext *C, PanelType *UNUSED(pt))
|
||||
{
|
||||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
|
||||
return (snode && snode->nodetree && G.rt == 777);
|
||||
return (snode && snode->nodetree && G.debug_value == 777);
|
||||
}
|
||||
|
||||
static void node_sockets_panel(const bContext *C, Panel *pa)
|
||||
|
@ -1532,7 +1532,7 @@ exit:
|
||||
/* ************************************************************* */
|
||||
|
||||
static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
|
||||
const short do_forground, const short do_camera_frame)
|
||||
const short do_foreground, const short do_camera_frame)
|
||||
{
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
BGpic *bgpic;
|
||||
@ -1541,7 +1541,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
|
||||
ImBuf *ibuf = NULL, *freeibuf;
|
||||
float vec[4], fac, asp, zoomx, zoomy;
|
||||
float x1, y1, x2, y2, cx, cy;
|
||||
int fg_flag = do_forground ? V3D_BGPIC_FOREGROUND : 0;
|
||||
int fg_flag = do_foreground ? V3D_BGPIC_FOREGROUND : 0;
|
||||
|
||||
for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) {
|
||||
|
||||
@ -1772,7 +1772,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
|
||||
}
|
||||
|
||||
static void view3d_draw_bgpic_test(Scene *scene, ARegion *ar, View3D *v3d,
|
||||
const short do_forground, const short do_camera_frame)
|
||||
const short do_foreground, const short do_camera_frame)
|
||||
{
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
|
||||
@ -1788,11 +1788,11 @@ static void view3d_draw_bgpic_test(Scene *scene, ARegion *ar, View3D *v3d,
|
||||
|
||||
if ((rv3d->view == RV3D_VIEW_USER) || (rv3d->persp != RV3D_ORTHO)) {
|
||||
if (rv3d->persp == RV3D_CAMOB) {
|
||||
view3d_draw_bgpic(scene, ar, v3d, do_forground, do_camera_frame);
|
||||
view3d_draw_bgpic(scene, ar, v3d, do_foreground, do_camera_frame);
|
||||
}
|
||||
}
|
||||
else {
|
||||
view3d_draw_bgpic(scene, ar, v3d, do_forground, do_camera_frame);
|
||||
view3d_draw_bgpic(scene, ar, v3d, do_foreground, do_camera_frame);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -855,7 +855,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
|
||||
float size, unitmat[4][4];
|
||||
float cywid = 0.33f * 0.01f * (float)U.tw_handlesize;
|
||||
float cusize = cywid * 0.65f;
|
||||
int arcs = (G.rt != 2);
|
||||
int arcs = (G.debug_value != 2);
|
||||
int colcode;
|
||||
int ortho;
|
||||
|
||||
@ -1517,7 +1517,7 @@ void BIF_draw_manipulator(const bContext *C)
|
||||
glEnable(GL_BLEND);
|
||||
if (v3d->twtype & V3D_MANIP_ROTATE) {
|
||||
|
||||
if (G.rt == 3) {
|
||||
if (G.debug_value == 3) {
|
||||
if (G.moving) draw_manipulator_rotate_cyl(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL);
|
||||
else draw_manipulator_rotate_cyl(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB);
|
||||
}
|
||||
@ -1561,7 +1561,7 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl
|
||||
|
||||
/* do the drawing */
|
||||
if (v3d->twtype & V3D_MANIP_ROTATE) {
|
||||
if (G.rt == 3) draw_manipulator_rotate_cyl(v3d, rv3d, 0, MAN_ROT_C & rv3d->twdrawflag, v3d->twtype, MAN_RGB);
|
||||
if (G.debug_value == 3) draw_manipulator_rotate_cyl(v3d, rv3d, 0, MAN_ROT_C & rv3d->twdrawflag, v3d->twtype, MAN_RGB);
|
||||
else draw_manipulator_rotate(v3d, rv3d, 0, MAN_ROT_C & rv3d->twdrawflag, v3d->twtype);
|
||||
}
|
||||
if (v3d->twtype & V3D_MANIP_SCALE)
|
||||
|
@ -169,7 +169,7 @@ static void freeData(ModifierData *md)
|
||||
ClothModifierData *clmd = (ClothModifierData *) md;
|
||||
|
||||
if (clmd) {
|
||||
if (G.rt > 0)
|
||||
if (G.debug_value > 0)
|
||||
printf("clothModifier_freeData\n");
|
||||
|
||||
cloth_free_modifier_extern(clmd);
|
||||
|
@ -132,7 +132,7 @@ static void deformVerts(ModifierData *md, Object *ob,
|
||||
|
||||
current_time = BKE_scene_frame_get(md->scene);
|
||||
|
||||
if (G.rt > 0)
|
||||
if (G.debug_value > 0)
|
||||
printf("current_time %f, collmd->time_xnew %f\n", current_time, collmd->time_xnew);
|
||||
|
||||
numverts = dm->getNumVerts(dm);
|
||||
|
@ -274,7 +274,7 @@ static void meshdeformModifier_do(
|
||||
/* get cage vertex in world space with binding transform */
|
||||
copy_v3_v3(co, cagecos[a]);
|
||||
|
||||
if (G.rt != 527) {
|
||||
if (G.debug_value != 527) {
|
||||
mul_m4_v3(mmd->bindmat, co);
|
||||
/* compute difference with world space bind coord */
|
||||
sub_v3_v3v3(dco[a], co, bindcagecos[a]);
|
||||
@ -324,7 +324,7 @@ static void meshdeformModifier_do(
|
||||
if (totweight > 0.0f) {
|
||||
mul_v3_fl(co, fac / totweight);
|
||||
mul_m3_v3(icagemat, co);
|
||||
if (G.rt != 527)
|
||||
if (G.debug_value != 527)
|
||||
add_v3_v3(vertexCos[b], co);
|
||||
else
|
||||
copy_v3_v3(vertexCos[b], co);
|
||||
|
@ -692,7 +692,7 @@ void *COM_linker_hack = NULL;
|
||||
void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int rendering, int do_preview)
|
||||
{
|
||||
#ifdef WITH_COMPOSITOR
|
||||
if (G.rt == 200)
|
||||
if (G.debug_value == 200)
|
||||
ntreeCompositExecTreeOld(ntree, rd, do_preview);
|
||||
else
|
||||
COM_execute(rd, ntree, rendering);
|
||||
|
@ -195,7 +195,7 @@ PyDoc_STRVAR(bpy_app_debug_value_doc,
|
||||
);
|
||||
static PyObject *bpy_app_debug_value_get(PyObject *UNUSED(self), void *UNUSED(closure))
|
||||
{
|
||||
return PyLong_FromSsize_t(G.rt);
|
||||
return PyLong_FromSsize_t(G.debug_value);
|
||||
}
|
||||
|
||||
static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure))
|
||||
@ -207,7 +207,7 @@ static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void
|
||||
return -1;
|
||||
}
|
||||
|
||||
G.rt = param;
|
||||
G.debug_value = param;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1194,7 +1194,7 @@ int WM_operator_redo_popup(bContext *C, wmOperator *op)
|
||||
|
||||
static int wm_debug_menu_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
G.rt = RNA_int_get(op->ptr, "debug_value");
|
||||
G.debug_value = RNA_int_get(op->ptr, "debug_value");
|
||||
ED_screen_refresh(CTX_wm_manager(C), CTX_wm_window(C));
|
||||
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
||||
|
||||
@ -1203,7 +1203,7 @@ static int wm_debug_menu_exec(bContext *C, wmOperator *op)
|
||||
|
||||
static int wm_debug_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
|
||||
{
|
||||
RNA_int_set(op->ptr, "debug_value", G.rt);
|
||||
RNA_int_set(op->ptr, "debug_value", G.debug_value);
|
||||
return WM_operator_props_dialog_popup(C, op, 9 * UI_UNIT_X, UI_UNIT_Y);
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ static int debug_mode_libmv(int UNUSED(argc), const char **UNUSED(argv), void *U
|
||||
static int set_debug_value(int argc, const char **argv, void *UNUSED(data))
|
||||
{
|
||||
if (argc > 1) {
|
||||
G.rt = atoi(argv[1]);
|
||||
G.debug_value = atoi(argv[1]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user