forked from bartvdbraak/blender
style cleanup: comments & spelling
This commit is contained in:
parent
8b57f7502b
commit
b867f9f17e
@ -232,7 +232,6 @@ def enable(module_name, default_set=True, persistent=False):
|
||||
|
||||
import os
|
||||
import sys
|
||||
import imp
|
||||
|
||||
def handle_error():
|
||||
import traceback
|
||||
@ -246,6 +245,7 @@ def enable(module_name, default_set=True, persistent=False):
|
||||
mtime_orig = getattr(mod, "__time__", 0)
|
||||
mtime_new = os.path.getmtime(mod.__file__)
|
||||
if mtime_orig != mtime_new:
|
||||
import imp
|
||||
print("module changed on disk:", mod.__file__, "reloading...")
|
||||
|
||||
try:
|
||||
|
@ -2568,10 +2568,12 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
|
||||
sbFreeSimulation(pid->calldata);
|
||||
else if (pid->type == PTCACHE_TYPE_PARTICLES)
|
||||
psys_reset(pid->calldata, PSYS_RESET_DEPSGRAPH);
|
||||
/*else if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
|
||||
#if 0
|
||||
else if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
|
||||
smokeModifier_reset(pid->calldata);
|
||||
else if (pid->type == PTCACHE_TYPE_SMOKE_HIGHRES)
|
||||
smokeModifier_reset_turbulence(pid->calldata);*/
|
||||
smokeModifier_reset_turbulence(pid->calldata);
|
||||
#endif
|
||||
else if (pid->type == PTCACHE_TYPE_DYNAMICPAINT)
|
||||
dynamicPaint_clearSurface((DynamicPaintSurface*)pid->calldata);
|
||||
}
|
||||
|
@ -1045,7 +1045,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
|
||||
|
||||
/* always update layer, so that animating layers works (joshua july 2010) */
|
||||
/* XXX commented out, this has depsgraph issues anyway - and this breaks setting scenes
|
||||
(on scene-set, the base-lay is copied to ob-lay (ton nov 2012) */
|
||||
* (on scene-set, the base-lay is copied to ob-lay (ton nov 2012) */
|
||||
// base->lay = ob->lay;
|
||||
}
|
||||
|
||||
|
@ -1410,7 +1410,7 @@ static float ray_nearest_hit(BVHRayCastData *data, const float bv[6])
|
||||
* Based on Tactical Optimization of Ray/Box Intersection, by Graham Fyffe
|
||||
* [http://tog.acm.org/resources/RTNews/html/rtnv21n1.html#art9]
|
||||
*
|
||||
* TODO this doens't has data->ray.radius in consideration */
|
||||
* TODO this doesn't take data->ray.radius into consideration */
|
||||
static float fast_ray_nearest_hit(const BVHRayCastData *data, const BVHNode *node)
|
||||
{
|
||||
const float *bv = node->bv;
|
||||
|
@ -84,7 +84,7 @@ void mul_qt_qtqt(float q[4], const float q1[4], const float q2[4])
|
||||
* \note:
|
||||
* Assumes a unit quaternion?
|
||||
*
|
||||
* in fact not, but you may wan't to use a unit quat, read on...
|
||||
* in fact not, but you may want to use a unit quat, read on...
|
||||
*
|
||||
* Shortcut for 'q v q*' when \a v is actually a quaternion.
|
||||
* This removes the need for converting a vector to a quaternion,
|
||||
|
@ -985,7 +985,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedu
|
||||
|
||||
|
||||
/* CURRENT STATUS:
|
||||
* - eve->f :1 = availalble in edges
|
||||
* - eve->f :1 = available in edges
|
||||
* - eve->xs :polynumber
|
||||
* - eve->h :amount of edges connected to vertex
|
||||
* - eve->tmp.v :store! original vertex number
|
||||
|
@ -107,14 +107,14 @@ typedef struct BMIter {
|
||||
BMesh *bm;
|
||||
void (*begin)(struct BMIter *iter);
|
||||
void *(*step)(struct BMIter *iter);
|
||||
/*
|
||||
#if 0
|
||||
union {
|
||||
void *p;
|
||||
int i;
|
||||
long l;
|
||||
float f;
|
||||
} filter;
|
||||
*/
|
||||
#endif
|
||||
int count; /* note, only some iterators set this, don't rely on it */
|
||||
char itype;
|
||||
} BMIter;
|
||||
|
@ -117,7 +117,7 @@ static BMOpDefine bmo_smooth_vert_def = {
|
||||
* Vertext Smooth Laplacian
|
||||
* Smooths vertices by using Laplacian smoothing propose by.
|
||||
* Desbrun, et al. Implicit Fairing of Irregular Meshes using Diffusion and Curvature Flow
|
||||
*/
|
||||
*/
|
||||
static BMOpDefine bmo_smooth_laplacian_vert_def = {
|
||||
"smooth_laplacian_vert",
|
||||
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
|
||||
|
@ -552,8 +552,8 @@ bool DocumentImporter::writeVisualScene(const COLLADAFW::VisualScene *visualScen
|
||||
}
|
||||
|
||||
/** When this method is called, the writer must handle all nodes contained in the
|
||||
* library nodes.
|
||||
* \return The writer should return true, if writing succeeded, false otherwise.*/
|
||||
* library nodes.
|
||||
* \return The writer should return true, if writing succeeded, false otherwise.*/
|
||||
bool DocumentImporter::writeLibraryNodes(const COLLADAFW::LibraryNodes *libraryNodes)
|
||||
{
|
||||
if (mImportStage != General)
|
||||
|
@ -81,8 +81,8 @@ public:
|
||||
/**
|
||||
* This method will be called if an error in the loading process occurred and the loader cannot
|
||||
* continue to load. The writer should undo all operations that have been performed.
|
||||
\param errorMessage A message containing informations about the error that occurred.
|
||||
*/
|
||||
* \param errorMessage A message containing informations about the error that occurred.
|
||||
*/
|
||||
void cancel(const COLLADAFW::String& errorMessage);
|
||||
|
||||
/** This is the method called. The writer hast to prepare to receive data.*/
|
||||
|
@ -110,7 +110,7 @@ typedef struct tGPsdata {
|
||||
double ocurtime; /* Used when converting to path */
|
||||
|
||||
float imat[4][4]; /* inverted transformation matrix applying when converting coords from screen-space
|
||||
* to region space */
|
||||
* to region space */
|
||||
|
||||
float custom_color[4]; /* custom color - hack for enforcing a particular color for track/mask editing */
|
||||
|
||||
|
@ -1471,9 +1471,10 @@ static void node_shader_buts_script_details(uiLayout *layout, bContext *C, Point
|
||||
|
||||
node_shader_buts_script(layout, C, ptr);
|
||||
|
||||
/* not implemented yet
|
||||
#if 0 /* not implemented yet */
|
||||
if (RNA_enum_get(ptr, "mode") == NODE_SCRIPT_EXTERNAL)
|
||||
uiItemR(layout, ptr, "use_auto_update", 0, NULL, ICON_NONE);*/
|
||||
uiItemR(layout, ptr, "use_auto_update", 0, NULL, ICON_NONE);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* only once called */
|
||||
|
@ -1228,7 +1228,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
|
||||
|
||||
hmargin = 0.035f * (x2 - x1);
|
||||
vmargin = 0.035f * (y2 - y1);
|
||||
uiDrawBox(GL_LINE_LOOP, x1 + hmargin, y1+vmargin, x2 - hmargin, y2 - vmargin, 2.0f);
|
||||
uiDrawBox(GL_LINE_LOOP, x1 + hmargin, y1 + vmargin, x2 - hmargin, y2 - vmargin, 2.0f);
|
||||
}
|
||||
if (ca && (ca->flag & CAM_SHOWSENSOR)) {
|
||||
/* determine sensor fit, and get sensor x/y, for auto fit we
|
||||
@ -3276,7 +3276,7 @@ static void bl_debug_draw(void)
|
||||
int i;
|
||||
cpack(0x00FF0000);
|
||||
glBegin(GL_LINE_LOOP);
|
||||
for(i=0; i < _bl_debug_draw_quads_tot; i ++) {
|
||||
for (i = 0; i < _bl_debug_draw_quads_tot; i ++) {
|
||||
glVertex3fv(_bl_debug_draw_quads[i][0]);
|
||||
glVertex3fv(_bl_debug_draw_quads[i][1]);
|
||||
glVertex3fv(_bl_debug_draw_quads[i][2]);
|
||||
|
@ -457,7 +457,7 @@ LogImageFile *dpxCreate(const char *filename, int width, int height, int bitsPer
|
||||
}
|
||||
|
||||
/* Header should be rounded to next 8k block
|
||||
6044 = 8092 - sizeof(DpxMainHeader) */
|
||||
* 6044 = 8092 - sizeof(DpxMainHeader) */
|
||||
memset(&pad, 0, 6044);
|
||||
if (fwrite(&pad, 6044, 1, dpx->file) == 0) {
|
||||
if (verbose) printf("DPX: Couldn't write image header\n");
|
||||
|
@ -147,7 +147,7 @@ struct BlockDXT3
|
||||
struct AlphaBlockDXT5
|
||||
{
|
||||
// uint64 unions do not compile on all platforms
|
||||
/*
|
||||
#if 0
|
||||
union {
|
||||
struct {
|
||||
uint64 alpha0 : 8; // 8
|
||||
@ -171,7 +171,7 @@ struct AlphaBlockDXT5
|
||||
};
|
||||
uint64 u;
|
||||
};
|
||||
*/
|
||||
#endif
|
||||
uint64 u;
|
||||
uint8 alpha0() const { return u & 0xffLL; }
|
||||
uint8 alpha1() const { return (u >> 8) & 0xffLL; }
|
||||
|
@ -49,14 +49,14 @@ static bNodeSocketTemplate cmp_node_colorbalance_out[] = {
|
||||
#ifdef WITH_COMPOSITOR_LEGACY
|
||||
|
||||
/* this function implements ASC-CDL according to the spec at http://www.asctech.org/
|
||||
Slope
|
||||
S = in * slope
|
||||
Offset
|
||||
O = S + offset
|
||||
= (in * slope) + offset
|
||||
Power
|
||||
out = Clamp(O) ^ power
|
||||
= Clamp((in * slope) + offset) ^ power
|
||||
* Slope
|
||||
* S = in * slope
|
||||
* Offset
|
||||
* O = S + offset
|
||||
* = (in * slope) + offset
|
||||
* Power
|
||||
* out = Clamp(O) ^ power
|
||||
* = Clamp((in * slope) + offset) ^ power
|
||||
*/
|
||||
DO_INLINE float colorbalance_cdl(float in, float offset, float power, float slope)
|
||||
{
|
||||
|
@ -59,6 +59,19 @@ static PyMethodDef bpy_reload_meth;
|
||||
static PyObject *imp_reload_orig = NULL;
|
||||
|
||||
/* 'builtins' is most likely PyEval_GetBuiltins() */
|
||||
|
||||
/**
|
||||
* \note to the discerning developer, yes - this is nasty
|
||||
* monkey-patching our own import into Python's builtin 'imp' module.
|
||||
*
|
||||
* However Python's alternative is to use import hooks,
|
||||
* which are implemented in a way that we can't use our own importer as a
|
||||
* fall-back (instead we must try and fail - raise an exception evert time).
|
||||
* Since importing from blenders text-blocks is not the common case
|
||||
* I prefer to use Pythons import by default and fall-back to
|
||||
* Blenders - which we can only do by intercepting import calls I'm afraid.
|
||||
* - Campbell
|
||||
*/
|
||||
void bpy_import_init(PyObject *builtins)
|
||||
{
|
||||
PyObject *item;
|
||||
|
@ -711,14 +711,14 @@ static int wm_automatic_draw_method(wmWindow *win)
|
||||
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE))
|
||||
return USER_DRAW_OVERLAP;
|
||||
/* also Intel drivers are slow */
|
||||
/* 2.64 BCon3 period, let's try if intel now works...
|
||||
#if 0 /* 2.64 BCon3 period, let's try if intel now works... */
|
||||
else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_UNIX, GPU_DRIVER_ANY))
|
||||
return USER_DRAW_OVERLAP;
|
||||
else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_ANY))
|
||||
return USER_DRAW_OVERLAP_FLIP;
|
||||
else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_ANY))
|
||||
return USER_DRAW_OVERLAP_FLIP;
|
||||
*/
|
||||
#endif
|
||||
/* Windows software driver darkens color on each redraw */
|
||||
else if (GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_WIN, GPU_DRIVER_SOFTWARE))
|
||||
return USER_DRAW_OVERLAP_FLIP;
|
||||
|
@ -340,7 +340,7 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve
|
||||
int retval;
|
||||
|
||||
/* UI code doesn't handle return values - it just always returns break.
|
||||
to make the DBL_CLICK conversion work, we just don't send this to UI */
|
||||
* to make the DBL_CLICK conversion work, we just don't send this to UI */
|
||||
if (event->val == KM_DBL_CLICK)
|
||||
return WM_HANDLER_CONTINUE;
|
||||
|
||||
@ -1288,9 +1288,9 @@ static int wm_eventmatch(wmEvent *winevent, wmKeyMapItem *kmi)
|
||||
|
||||
/* the matching rules */
|
||||
if (kmitype == KM_TEXTINPUT)
|
||||
if (winevent->val == KM_PRESS) { // prevent double clicks
|
||||
if (winevent->val == KM_PRESS) { /* prevent double clicks */
|
||||
/* NOT using ISTEXTINPUT anymore because (at least on Windows) some key codes above 255
|
||||
could have printable ascii keys - BUG [#30479] */
|
||||
* could have printable ascii keys - BUG [#30479] */
|
||||
if (ISKEYBOARD(winevent->type) && (winevent->ascii || winevent->utf8_buf[0])) return 1;
|
||||
}
|
||||
|
||||
@ -1550,8 +1550,8 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa
|
||||
if (handler->op->reports->list.first) {
|
||||
|
||||
/* FIXME, temp setting window, this is really bad!
|
||||
* only have because lib linking errors need to be seen by users :(
|
||||
* it can be removed without breaking anything but then no linking errors - campbell */
|
||||
* only have because lib linking errors need to be seen by users :(
|
||||
* it can be removed without breaking anything but then no linking errors - campbell */
|
||||
wmWindow *win_prev = CTX_wm_window(C);
|
||||
ScrArea *area_prev = CTX_wm_area(C);
|
||||
ARegion *ar_prev = CTX_wm_region(C);
|
||||
|
@ -1228,7 +1228,7 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, const int do_
|
||||
}
|
||||
|
||||
/* Same as WM_operator_props_popup but call the operator first,
|
||||
* This way - the button values corraspond to the result of the operator.
|
||||
* This way - the button values correspond to the result of the operator.
|
||||
* Without this, first access to a button will make the result jump,
|
||||
* see [#32452] */
|
||||
int WM_operator_props_popup_call(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
|
||||
|
@ -88,7 +88,6 @@ typedef struct PlayState {
|
||||
short pingpong;
|
||||
short noskip;
|
||||
short sstep;
|
||||
short pause;
|
||||
short wait2;
|
||||
short stopped;
|
||||
short go;
|
||||
@ -748,7 +747,6 @@ void WM_main_playanim(int argc, const char **argv)
|
||||
ps.pingpong = FALSE;
|
||||
ps.noskip = FALSE;
|
||||
ps.sstep = FALSE;
|
||||
ps.pause = FALSE;
|
||||
ps.wait2 = FALSE;
|
||||
ps.stopped = FALSE;
|
||||
ps.picture = NULL;
|
||||
|
@ -337,7 +337,7 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
|
||||
int scr_w, scr_h, posy;
|
||||
|
||||
/* force setting multisamples only once, it requires restart - and you cannot
|
||||
mix it, either all windows have it, or none (tested in OSX opengl) */
|
||||
* mix it, either all windows have it, or none (tested in OSX opengl) */
|
||||
if (multisamples == -1)
|
||||
multisamples = U.ogl_multisamples;
|
||||
|
||||
|
@ -285,9 +285,9 @@ enum {
|
||||
|
||||
/* for event checks */
|
||||
/* only used for KM_TEXTINPUT, so assume that we want all user-inputtable ascii codes included */
|
||||
/* UNUSED - see wm_eventmatch - BUG [#30479]
|
||||
#define ISTEXTINPUT(event) (event >= ' ' && event <= 255)
|
||||
*/
|
||||
/* UNUSED - see wm_eventmatch - BUG [#30479] */
|
||||
// #define ISTEXTINPUT(event) (event >= ' ' && event <= 255)
|
||||
|
||||
/* test whether the event is a key on the keyboard */
|
||||
#define ISKEYBOARD(event) (event >= ' ' && event <= 320)
|
||||
|
||||
|
@ -526,7 +526,7 @@ typedef struct KX_PYATTRIBUTE_DEF {
|
||||
|
||||
/*------------------------------
|
||||
* PyObjectPlus
|
||||
------------------------------*/
|
||||
*------------------------------ */
|
||||
typedef PyTypeObject *PyParentObject; /* Define the PyParent Object */
|
||||
|
||||
#else // WITH_PYTHON
|
||||
|
@ -152,8 +152,8 @@ struct SG_Callbacks
|
||||
};
|
||||
|
||||
/**
|
||||
base object that can be part of the scenegraph.
|
||||
*/
|
||||
* base object that can be part of the scenegraph.
|
||||
*/
|
||||
class SG_IObject : public SG_QList
|
||||
{
|
||||
private :
|
||||
|
Loading…
Reference in New Issue
Block a user