style cleanup: use c style comments in C code

This commit is contained in:
Campbell Barton 2012-07-06 23:56:59 +00:00
parent 3a0593cc3d
commit 84bf3e48c0
89 changed files with 705 additions and 702 deletions

View file

@ -870,7 +870,7 @@ AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...)
}
}
else if (movie->streams[i].sh.Type == FCC("auds")) {
// pass
/* pass */
}
#endif
}

View file

@ -74,7 +74,7 @@
static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm);
#endif
#include "BLO_sys_types.h" // for intptr_t support
#include "BLO_sys_types.h" /* for intptr_t support */
#include "GL/glew.h"
@ -956,22 +956,22 @@ void weight_to_rgb(float r_rgb[3], const float weight)
{
const float blend = ((weight / 2.0f) + 0.5f);
if (weight <= 0.25f) { // blue->cyan
if (weight <= 0.25f) { /* blue->cyan */
r_rgb[0] = 0.0f;
r_rgb[1] = blend * weight * 4.0f;
r_rgb[2] = blend;
}
else if (weight <= 0.50f) { // cyan->green
else if (weight <= 0.50f) { /* cyan->green */
r_rgb[0] = 0.0f;
r_rgb[1] = blend;
r_rgb[2] = blend * (1.0f - ((weight - 0.25f) * 4.0f));
}
else if (weight <= 0.75f) { // green->yellow
else if (weight <= 0.75f) { /* green->yellow */
r_rgb[0] = blend * ((weight - 0.50f) * 4.0f);
r_rgb[1] = blend;
r_rgb[2] = 0.0f;
}
else if (weight <= 1.0f) { // yellow->red
else if (weight <= 1.0f) { /* yellow->red */
r_rgb[0] = blend;
r_rgb[1] = blend * (1.0f - ((weight - 0.75f) * 4.0f));
r_rgb[2] = 0.0f;
@ -2379,16 +2379,16 @@ float *mesh_get_mapped_verts_nors(Scene *scene, Object *ob)
typedef struct {
float *precomputedFaceNormals;
MTFace *mtface; // texture coordinates
MFace *mface; // indices
MVert *mvert; // vertices & normals
MTFace *mtface; /* texture coordinates */
MFace *mface; /* indices */
MVert *mvert; /* vertices & normals */
float (*orco)[3];
float (*tangent)[4]; // destination
float (*tangent)[4]; /* destination */
int numTessFaces;
} SGLSLMeshToTangent;
// interface
/* interface */
#include "mikktspace.h"
static int GetNumFaces(const SMikkTSpaceContext *pContext)
@ -2508,7 +2508,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
BLI_memarena_use_calloc(arena);
vtangents = MEM_callocN(sizeof(VertexTangent *) * totvert, "VertexTangent");
// new computation method
/* new computation method */
iCalcNewMethod = 1;
if (iCalcNewMethod != 0) {
SGLSLMeshToTangent mesh2tangent = {0};
@ -2532,7 +2532,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
sInterface.m_getNormal = GetNormal;
sInterface.m_setTSpaceBasic = SetTSpace;
// 0 if failed
/* 0 if failed */
iCalcNewMethod = genTangSpaceDefault(&sContext);
}
@ -2638,7 +2638,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
tex_coords[3] = mtface[f].uv[3];
}
// discard degenerate faces
/* discard degenerate faces */
is_degenerate = 0;
if (equals_v3v3(verts[0], verts[1]) || equals_v3v3(verts[0], verts[2]) || equals_v3v3(verts[1], verts[2]) ||
equals_v2v2(tex_coords[0], tex_coords[1]) || equals_v2v2(tex_coords[0], tex_coords[2]) || equals_v2v2(tex_coords[1], tex_coords[2]))
@ -2646,7 +2646,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
is_degenerate = 1;
}
// verify last vertex as well if this is a quad
/* verify last vertex as well if this is a quad */
if (is_degenerate == 0 && nr_verts == 4) {
if (equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) ||
equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2]))
@ -2654,7 +2654,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
is_degenerate = 1;
}
// verify the winding is consistent
/* verify the winding is consistent */
if (is_degenerate == 0) {
float prev_edge[2];
int is_signed = 0;
@ -2681,11 +2681,11 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
}
}
// proceed if not a degenerate face
/* proceed if not a degenerate face */
if (is_degenerate == 0) {
int nr_tris_to_pile = 0;
// quads split at shortest diagonal
int offs = 0; // initial triangulation is 0,1,2 and 0, 2, 3
/* quads split at shortest diagonal */
int offs = 0; /* initial triangulation is 0,1,2 and 0, 2, 3 */
if (nr_verts == 4) {
float pos_len_diag0, pos_len_diag1;
float vtmp[3];
@ -2743,7 +2743,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
}
}
// finalize
/* finalize */
{
const float avg_area_ratio = (nr_accumulated > 0) ? ((float)(dsum / nr_accumulated)) : 1.0f;
const float use_as_render_bump_scale = sqrtf(avg_area_ratio); // use width of average surface ratio as your bump scale

View file

@ -134,7 +134,7 @@ void BKE_action_make_local(bAction *act)
if (act->id.lib == NULL)
return;
// XXX: double-check this; it used to be just single-user check, but that was when fake-users were still default
/* XXX: double-check this; it used to be just single-user check, but that was when fake-users were still default */
if ((act->id.flag & LIB_FAKEUSER) && (act->id.us <= 1)) {
id_clear_lib_data(bmain, &act->id);
return;
@ -547,7 +547,7 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon)
outPose->ikparam = MEM_dupallocN(src->ikparam);
for (pchan = outPose->chanbase.first; pchan; pchan = pchan->next) {
// TODO: rename this argument...
/* TODO: rename this argument... */
if (copycon) {
copy_constraints(&listb, &pchan->constraints, TRUE); // copy_constraints NULLs listb
pchan->constraints = listb;
@ -807,7 +807,7 @@ void framechange_poses_clear_unkeyed(void)
bPoseChannel *pchan;
/* This needs to be done for each object that has a pose */
// TODO: proxies may/may not be correctly handled here... (this needs checking)
/* TODO: proxies may/may not be correctly handled here... (this needs checking) */
for (ob = G.main->object.first; ob; ob = ob->id.next) {
/* we only need to do this on objects with a pose */
if ( (pose = ob->pose) ) {
@ -907,7 +907,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
float nmin, nmax;
/* get extents for this curve */
// TODO: allow enabling/disabling this?
/* TODO: allow enabling/disabling this? */
calc_fcurve_range(fcu, &nmin, &nmax, FALSE, TRUE);
/* compare to the running tally */
@ -949,7 +949,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
}
break;
// TODO: function modifier may need some special limits
/* TODO: function modifier may need some special limits */
default: /* all other standard modifiers are on the infinite range... */
min = MINAFRAMEF;
@ -1129,7 +1129,7 @@ void BKE_pose_copy_result(bPose *to, bPose *from)
bPoseChannel *pchanto, *pchanfrom;
if (to == NULL || from == NULL) {
printf("pose result copy error to:%p from:%p\n", (void *)to, (void *)from); // debug temp
printf("pose result copy error to:%p from:%p\n", (void *)to, (void *)from); /* debug temp */
return;
}
@ -1378,12 +1378,12 @@ static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip
/* now we need to go pdist further (or less) on cu path */
where_on_path(ob, (pathdist) / path->totdist, vec1, dir); /* vec needs size 4 */
if (pdistNewNormalized <= 1) {
// search for correction in positive path-direction
/* search for correction in positive path-direction */
where_on_path(ob, pdistNewNormalized, vec2, dir); /* vec needs size 4 */
sub_v3_v3v3(stride_offset, vec2, vec1);
}
else {
// we reached the end of the path, search backwards instead
/* we reached the end of the path, search backwards instead */
where_on_path(ob, (pathdist - pdist) / path->totdist, vec2, dir); /* vec needs size 4 */
sub_v3_v3v3(stride_offset, vec1, vec2);
}

View file

@ -86,24 +86,24 @@ void animviz_settings_init(bAnimVizSettings *avs)
/* sanity check */
if (avs == NULL)
return;
/* ghosting settings */
avs->ghost_bc = avs->ghost_ac = 10;
avs->ghost_sf = 1; // xxx - take from scene instead?
avs->ghost_ef = 250; // xxx - take from scene instead?
avs->ghost_sf = 1; /* xxx - take from scene instead? */
avs->ghost_ef = 250; /* xxx - take from scene instead? */
avs->ghost_step = 1;
/* path settings */
avs->path_bc = avs->path_ac = 10;
avs->path_sf = 1; // xxx - take from scene instead?
avs->path_ef = 250; // xxx - take from scene instead?
avs->path_sf = 1; /* xxx - take from scene instead? */
avs->path_ef = 250; /* xxx - take from scene instead? */
avs->path_viewflag = (MOTIONPATH_VIEW_KFRAS | MOTIONPATH_VIEW_KFNOS);
avs->path_step = 1;
}
@ -246,7 +246,7 @@ typedef struct MPathTarget {
/* get list of motion paths to be baked for the given object
* - assumes the given list is ready to be used
*/
// TODO: it would be nice in future to be able to update objects dependent on these bones too?
/* TODO: it would be nice in future to be able to update objects dependent on these bones too? */
void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
{
MPathTarget *mpt;
@ -309,7 +309,9 @@ static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets)
BLI_addhead(&scene->base, base);
mpt->ob->flag |= BA_TEMP_TAG;
break; // we really don't need to continue anymore once this happens, but this line might really 'break'
/* we really don't need to continue anymore once this happens, but this line might really 'break' */
break;
}
}
}
@ -328,17 +330,17 @@ static void motionpaths_calc_update_scene(Scene *scene)
DAG_scene_update_flags(G.main, scene, scene->lay, TRUE);
/* find the last object with the tag
* - all those afterwards are assumed to not be relevant for our calculations
* - all those afterwards are assumed to not be relevant for our calculations
*/
// optimize further by moving out...
/* optimize further by moving out... */
for (base = scene->base.first; base; base = base->next) {
if (base->object->flag & BA_TEMP_TAG)
last = base;
}
/* perform updates for tagged objects */
// XXX: this will break if rigs depend on scene or other data that
// is animated but not attached to/updatable from objects
/* XXX: this will break if rigs depend on scene or other data that
* is animated but not attached to/updatable from objects */
for (base = scene->base.first; base; base = base->next) {
/* update this object */
BKE_object_handle_update(scene, base->object);
@ -353,7 +355,7 @@ static void motionpaths_calc_update_scene(Scene *scene)
* that doesn't force complete update, but for now, this is the
* most accurate way!
*/
BKE_scene_update_for_newframe(G.main, scene, scene->lay); // XXX this is the best way we can get anything moving
BKE_scene_update_for_newframe(G.main, scene, scene->lay); /* XXX this is the best way we can get anything moving */
#endif
}
@ -401,9 +403,9 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
/* Perform baking of the given object's and/or its bones' transforms to motion paths
* - scene: current scene
* - ob: object whose flagged motionpaths should get calculated
* - recalc: whether we need to
* - recalc: whether we need to
*/
// TODO: include reports pointer?
/* TODO: include reports pointer? */
void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
{
MPathTarget *mpt;
@ -418,9 +420,9 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
cfra = CFRA;
sfra = efra = cfra;
// TODO: this method could be improved...
// 1) max range for standard baking
// 2) minimum range for recalc baking (i.e. between keyframes, but how?)
/* TODO: this method could be improved...
* 1) max range for standard baking
* 2) minimum range for recalc baking (i.e. between keyframes, but how?) */
for (mpt = targets->first; mpt; mpt = mpt->next) {
/* try to increase area to do (only as much as needed) */
sfra = MIN2(sfra, mpt->mpath->start_frame);
@ -429,7 +431,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
if (efra <= sfra) return;
/* optimize the depsgraph for faster updates */
// TODO: whether this is used should depend on some setting for the level of optimisations used
/* TODO: whether this is used should depend on some setting for the level of optimisations used */
motionpaths_calc_optimise_depsgraph(scene, targets);
/* calculate path over requested range */

View file

@ -76,9 +76,9 @@ short id_type_can_have_animdata(ID *id)
/* sanity check */
if (id == NULL)
return 0;
/* Only some ID-blocks have this info for now */
// TODO: finish adding this for the other blocktypes
/* TODO: finish adding this for the other blocktypes */
switch (GS(id->name)) {
/* has AnimData */
case ID_OB:
@ -231,7 +231,7 @@ void BKE_free_animdata(ID *id)
free_fcurves(&adt->drivers);
/* free overrides */
// TODO...
/* TODO... */
/* free animdata now */
MEM_freeN(adt);
@ -334,7 +334,7 @@ void BKE_animdata_make_local(AnimData *adt)
if (adt->remap && adt->remap->target) BKE_action_make_local(adt->remap->target);
/* Drivers */
// TODO: need to remap the ID-targets too?
/* TODO: need to remap the ID-targets too? */
/* NLA Data */
for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next)
@ -505,8 +505,8 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths
else if (dstAdt->action == srcAdt->action) {
printf("Argh! Source and Destination share animation! ('%s' and '%s' both use '%s') Making new empty action\n",
srcID->name, dstID->name, srcAdt->action->id.name);
// TODO: review this...
/* TODO: review this... */
id_us_min(&dstAdt->action->id);
dstAdt->action = add_empty_action(dstAdt->action->id.name + 2);
}
@ -534,9 +534,9 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths
/* just need to change lists */
BLI_remlink(&srcAdt->drivers, fcu);
BLI_addtail(&dstAdt->drivers, fcu);
// TODO: add depsgraph flushing calls?
/* TODO: add depsgraph flushing calls? */
/* can stop now, as moved already */
break;
}
@ -603,7 +603,7 @@ static char *rna_path_rename_fix(ID *owner_id, const char *prefix, const char *o
BLI_dynstr_free(ds);
/* check if the new path will solve our problems */
// TODO: will need to check whether this step really helps in practice
/* TODO: will need to check whether this step really helps in practice */
if (!verify_paths || check_rna_path_is_valid(owner_id, newPath)) {
/* free the old path, and return the new one, since we've solved the issues */
MEM_freeN(oldpath);
@ -907,7 +907,7 @@ void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const cha
/* Finding Tools --------------------------- */
/* Find the first path that matches the given criteria */
// TODO: do we want some method to perform partial matches too?
/* TODO: do we want some method to perform partial matches too? */
KS_Path *BKE_keyingset_find_path(KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, int UNUSED(group_mode))
{
KS_Path *ksp;
@ -1019,7 +1019,7 @@ KS_Path *BKE_keyingset_add_path(KeyingSet *ks, ID *id, const char group_name[],
ksp->idtype = GS(id->name);
/* just copy path info */
// TODO: should array index be checked too?
/* TODO: should array index be checked too? */
ksp->rna_path = BLI_strdupn(rna_path, strlen(rna_path));
ksp->array_index = array_index;
@ -1216,8 +1216,8 @@ static short animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_in
}
else {
/* failed to get path */
// XXX don't tag as failed yet though, as there are some legit situations (Action Constraint)
// where some channels will not exist, but shouldn't lock up Action
/* XXX don't tag as failed yet though, as there are some legit situations (Action Constraint)
* where some channels will not exist, but shouldn't lock up Action */
if (G.debug & G_DEBUG) {
printf("Animato: Invalid path. ID = '%s', '%s[%d]'\n",
(ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name + 2) : "<No ID>",
@ -1425,11 +1425,11 @@ static void nlastrip_evaluate_controls(NlaStrip *strip, float ctime)
animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime);
}
/* if user can control the evaluation time (using F-Curves), consider the option which allows this time to be clamped
/* if user can control the evaluation time (using F-Curves), consider the option which allows this time to be clamped
* to lie within extents of the action-clip, so that a steady changing rate of progress through several cycles of the clip
* can be achieved easily
*/
// NOTE: if we add any more of these special cases, we better group them up nicely...
/* NOTE: if we add any more of these special cases, we better group them up nicely... */
if ((strip->flag & NLASTRIP_FLAG_USR_TIME) && (strip->flag & NLASTRIP_FLAG_USR_TIME_CYCLIC))
strip->strip_time = fmod(strip->strip_time - strip->actstart, strip->actend - strip->actstart);
}
@ -1511,7 +1511,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short
* - skip if no influence (i.e. same effect as muting the strip)
* - negative influence is not supported yet... how would that be defined?
*/
// TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on...
/* TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... */
nlastrip_evaluate_controls(estrip, ctime);
if (estrip->influence <= 0.0f)
return NULL;
@ -1668,7 +1668,7 @@ static void nlaevalchan_accumulate(NlaEvalChannel *nec, NlaEvalStrip *nes, short
break;
case NLASTRIP_MODE_REPLACE:
default: // TODO: do we really want to blend by default? it seems more uses might prefer add...
default: /* TODO: do we really want to blend by default? it seems more uses might prefer add... */
/* do linear interpolation
* - the influence of the accumulated data (elsewhere, that is called dstweight)
* is 1 - influence, since the strip's influence is srcweight
@ -1864,7 +1864,7 @@ static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, Li
tmp_nes = *nes;
/* evaluate these strips into a temp-buffer (tmp_channels) */
// FIXME: modifier evalation here needs some work...
/* FIXME: modifier evalation here needs some work... */
/* first strip */
tmp_nes.strip_mode = NES_TIME_TRANSITION_START;
tmp_nes.strip = s1;
@ -1928,11 +1928,11 @@ static void nlastrip_evaluate_meta(PointerRNA *ptr, ListBase *channels, ListBase
void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
{
NlaStrip *strip = nes->strip;
/* to prevent potential infinite recursion problems (i.e. transition strip, beside meta strip containing a transition
* several levels deep inside it), we tag the current strip as being evaluated, and clear this when we leave
*/
// TODO: be careful with this flag, since some edit tools may be running and have set this while animplayback was running
/* TODO: be careful with this flag, since some edit tools may be running and have set this while animplayback was running */
if (strip->flag & NLASTRIP_FLAG_EDIT_TOUCHED)
return;
strip->flag |= NLASTRIP_FLAG_EDIT_TOUCHED;
@ -2081,7 +2081,7 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
}
else {
/* special case - evaluate as if there isn't any NLA data */
// TODO: this is really just a stop-gap measure...
/* TODO: this is really just a stop-gap measure... */
animsys_evaluate_action(ptr, adt->action, adt->remap, ctime);
return;
}
@ -2107,10 +2107,10 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
static void animsys_calculate_nla(PointerRNA *ptr, AnimData *adt, float ctime)
{
ListBase echannels = {NULL, NULL};
// TODO: need to zero out all channels used, otherwise we have problems with threadsafety
// and also when the user jumps between different times instead of moving sequentially...
/* TODO: need to zero out all channels used, otherwise we have problems with threadsafety
* and also when the user jumps between different times instead of moving sequentially... */
/* evaluate the NLA stack, obtaining a set of values to flush */
animsys_evaluate_nla(&echannels, ptr, adt, ctime);
@ -2130,9 +2130,9 @@ static void animsys_calculate_nla(PointerRNA *ptr, AnimData *adt, float ctime)
#if 0
AnimOverride *BKE_animsys_validate_override(PointerRNA *UNUSED(ptr), char *UNUSED(path), int UNUSED(array_index))
{
// FIXME: need to define how to get overrides
/* FIXME: need to define how to get overrides */
return NULL;
}
}
#endif
/* -------------------- */
@ -2202,7 +2202,7 @@ void BKE_animsys_evaluate_animdata(Scene *scene, ID *id, AnimData *adt, float ct
* - NLA before Active Action, as Active Action behaves as 'tweaking track'
* that overrides 'rough' work in NLA
*/
// TODO: need to double check that this all works correctly
/* TODO: need to double check that this all works correctly */
if ((recalc & ADT_RECALC_ANIM) || (adt->recalc & ADT_RECALC_ANIM)) {
/* evaluate NLA data */
if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF)) {

View file

@ -301,8 +301,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
//setscreen(G.curscreen);
}
// FIXME: this version patching should really be part of the file-reading code,
// but we still get too many unrelated data-corruption crashes otherwise...
/* FIXME: this version patching should really be part of the file-reading code,
* but we still get too many unrelated data-corruption crashes otherwise... */
if (G.main->versionfile < 250)
do_versions_ipos_to_animato(G.main);

View file

@ -96,9 +96,9 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
ysize = (bytes + (ibuf->x - 1)) / ibuf->x;
if (ysize < ibuf->y) {
// we're first going to copy all data into a liniar buffer.
// step can be 4 or 1 bytes, and the data is not sequential because
// the bitmap was flipped vertically.
/* we're first going to copy all data into a liniar buffer.
* step can be 4 or 1 bytes, and the data is not sequential because
* the bitmap was flipped vertically. */
buffer = MEM_mallocN(bytes, "readBitmapFontVersion0:buffer");
@ -113,7 +113,7 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
}
}
// we're now going to endian convert the data
/* we're now going to endian convert the data */
bmfont = MEM_mallocN(bytes, "readBitmapFontVersion0:bmfont");
index = 0;
@ -151,16 +151,16 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
printf("bytes = %d\n", bytes);
}
// we've read the data from the image. Now we're going
// to crop the image vertically so only the bitmap data
// remains visible
/* we've read the data from the image. Now we're going
* to crop the image vertically so only the bitmap data
* remains visible */
ibuf->y -= ysize;
ibuf->userdata = bmfont;
ibuf->userflags |= IB_BITMAPFONT;
if (ibuf->planes < 32) {
// we're going to fake alpha here:
/* we're going to fake alpha here: */
calcAlpha(ibuf);
}
}
@ -176,32 +176,32 @@ void detectBitmapFont(ImBuf *ibuf)
int i;
if (ibuf != NULL && ibuf->rect != NULL) {
// bitmap must have an x size that is a power of two
/* bitmap must have an x size that is a power of two */
if (is_power_of_two(ibuf->x)) {
rect = (unsigned char *) (ibuf->rect + (ibuf->x * (ibuf->y - 1)));
// printf ("starts with: %s %c %c %c %c\n", rect, rect[0], rect[1], rect[2], rect[3]);
/* printf ("starts with: %s %c %c %c %c\n", rect, rect[0], rect[1], rect[2], rect[3]); */
if (rect[0] == 'B' && rect[1] == 'F' && rect[2] == 'N' && rect[3] == 'T') {
// printf("found 8bit font !\n");
// round y size down
// do the 8 bit font stuff. (not yet)
/* printf("found 8bit font !\n");
* round y size down
* do the 8 bit font stuff. (not yet) */
}
else {
// we try all 4 possible combinations
/* we try all 4 possible combinations */
for (i = 0; i < 4; i++) {
if (rect[0] == 'B' && rect[4] == 'F' && rect[8] == 'N' && rect[12] == 'T') {
// printf("found 24bit font !\n");
// We're going to parse the file:
/* printf("found 24bit font !\n");
* We're going to parse the file: */
version = (rect[16] << 8) | rect[20];
if (version == 0) {
readBitmapFontVersion0(ibuf, rect, 4);
}
else {
printf("detectBitmapFont :Unsupported version %d\n", version);
}
// on succes ibuf->userdata points to the bitmapfont
/* on succes ibuf->userdata points to the bitmapfont */
if (ibuf->userdata) {
break;
}
@ -221,23 +221,23 @@ int locateGlyph(bmFont *bmfont, unsigned short unicode)
min = 0;
max = bmfont->glyphcount;
while (1) {
// look halfway for glyph
/* look halfway for glyph */
current = (min + max) >> 1;
if (bmfont->glyphs[current].unicode == unicode) {
break;
}
else if (bmfont->glyphs[current].unicode < unicode) {
// have to move up
/* have to move up */
min = current;
}
else {
// have to move down
/* have to move down */
max = current;
}
if (max - min <= 1) {
// unable to locate glyph
/* unable to locate glyph */
current = 0;
break;
}

View file

@ -330,7 +330,7 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
}
}
// Account for numerical round-off error
/* Account for numerical round-off error */
if (sqrDist < FLT_EPSILON)
sqrDist = 0.0f;
@ -345,7 +345,7 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
add_v3_v3v3(z, z, y);
//sub_v3_v3v3(d, p, z);
copy_v3_v3(nearest, z);
// d = p - ( v0 + S * e0 + T * e1 );
//d = p - ( v0 + S * e0 + T * e1 );
}
*v = lv;
*e = le;

View file

@ -224,26 +224,26 @@ static BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon
verts = cloth->verts;
mfaces = cloth->mfaces;
// in the moment, return zero if no faces there
/* in the moment, return zero if no faces there */
if (!cloth->numfaces)
return NULL;
// create quadtree with k=26
/* create quadtree with k=26 */
bvhtree = BLI_bvhtree_new(cloth->numfaces, epsilon, 4, 26);
// fill tree
/* fill tree */
for (i = 0; i < cloth->numfaces; i++, mfaces++) {
copy_v3_v3(&co[0*3], verts[mfaces->v1].xold);
copy_v3_v3(&co[1*3], verts[mfaces->v2].xold);
copy_v3_v3(&co[2*3], verts[mfaces->v3].xold);
if (mfaces->v4)
copy_v3_v3(&co[3*3], verts[mfaces->v4].xold);
BLI_bvhtree_insert(bvhtree, i, co, (mfaces->v4 ? 4 : 3));
}
// balance tree
/* balance tree */
BLI_bvhtree_balance(bvhtree);
return bvhtree;
@ -313,23 +313,23 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving)
return;
mfaces = cloth->mfaces;
// update vertex position in bvh tree
if (verts && mfaces) {
for (i = 0; i < cloth->numverts; i++, verts++) {
copy_v3_v3(&co[0*3], verts->txold);
// copy new locations into array
if (moving) {
// update moving positions
copy_v3_v3(&co_moving[0*3], verts->tx);
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1);
}
else {
ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, 1);
}
// check if tree is already full
if (!ret)
break;
@ -673,7 +673,7 @@ void cloth_free_modifier_extern(ClothModifierData *clmd )
if ( cloth ) {
if (G.rt > 0)
printf("cloth_free_modifier_extern in\n");
// If our solver provides a free function, call it
if ( solvers [clmd->sim_parms->solver_type].free ) {
solvers [clmd->sim_parms->solver_type].free ( clmd );
@ -691,12 +691,12 @@ void cloth_free_modifier_extern(ClothModifierData *clmd )
LinkNode *search = cloth->springs;
while (search) {
ClothSpring *spring = search->link;
MEM_freeN ( spring );
search = search->next;
}
BLI_linklist_free(cloth->springs, NULL);
cloth->springs = NULL;
}
@ -713,11 +713,11 @@ void cloth_free_modifier_extern(ClothModifierData *clmd )
// we save our faces for collision objects
if ( cloth->mfaces )
MEM_freeN ( cloth->mfaces );
if (cloth->edgehash)
BLI_edgehash_free ( cloth->edgehash, NULL );
/*
if (clmd->clothObject->facemarks)
MEM_freeN(clmd->clothObject->facemarks);
@ -875,10 +875,10 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
cloth_from_mesh ( clmd, dm );
// create springs
// create springs
clmd->clothObject->springs = NULL;
clmd->clothObject->numsprings = -1;
if ( clmd->sim_parms->shapekey_rest )
shapekey_rest = dm->getVertDataArray ( dm, CD_CLOTH_ORCO );
@ -1127,13 +1127,13 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
for (i = 0; i < numverts; i++) {
cloth->verts[i].avg_spring_len = cloth->verts[i].avg_spring_len * 0.49f / ((float)cloth->verts[i].spring_count);
}
// shear springs
for ( i = 0; i < numfaces; i++ ) {
// triangle faces already have shear springs due to structural geometry
if ( !mface[i].v4 )
continue;
continue;
spring = ( ClothSpring *) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
if (!spring) {
@ -1174,7 +1174,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
BLI_linklist_prepend ( &cloth->springs, spring );
}
if (numfaces) {
// bending springs
search2 = cloth->springs;
@ -1187,14 +1187,14 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
while ( search ) {
tspring = search->link;
index2 = ( ( tspring->ij==tspring2->kl ) ? ( tspring->kl ) : ( tspring->ij ) );
// check for existing spring
// check also if startpoint is equal to endpoint
if (!BLI_edgehash_haskey(edgehash, MIN2(tspring2->ij, index2), MAX2(tspring2->ij, index2)) &&
(index2 != tspring2->ij))
{
spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
if (!spring) {
cloth_free_errorsprings(cloth, edgehash, edgelist);
return 0;

View file

@ -226,69 +226,69 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
zero_v3(i2);
zero_v3(i3);
// only handle static collisions here
/* only handle static collisions here */
if ( collpair->flag & COLLISION_IN_FUTURE )
continue;
// compute barycentric coordinates for both collision points
/* compute barycentric coordinates for both collision points */
collision_compute_barycentric ( collpair->pa,
cloth1->verts[collpair->ap1].txold,
cloth1->verts[collpair->ap2].txold,
cloth1->verts[collpair->ap3].txold,
&w1, &w2, &w3 );
// was: txold
/* was: txold */
collision_compute_barycentric ( collpair->pb,
collmd->current_x[collpair->bp1].co,
collmd->current_x[collpair->bp2].co,
collmd->current_x[collpair->bp3].co,
&u1, &u2, &u3 );
// Calculate relative "velocity".
/* Calculate relative "velocity". */
collision_interpolateOnTriangle ( v1, cloth1->verts[collpair->ap1].tv, cloth1->verts[collpair->ap2].tv, cloth1->verts[collpair->ap3].tv, w1, w2, w3 );
collision_interpolateOnTriangle ( v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, u1, u2, u3 );
sub_v3_v3v3(relativeVelocity, v2, v1);
// Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
/* Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal'). */
magrelVel = dot_v3v3(relativeVelocity, collpair->normal);
// printf("magrelVel: %f\n", magrelVel);
/* printf("magrelVel: %f\n", magrelVel); */
// Calculate masses of points.
// TODO
/* Calculate masses of points.
* TODO */
// If v_n_mag < 0 the edges are approaching each other.
/* If v_n_mag < 0 the edges are approaching each other. */
if ( magrelVel > ALMOST_ZERO ) {
// Calculate Impulse magnitude to stop all motion in normal direction.
/* Calculate Impulse magnitude to stop all motion in normal direction. */
float magtangent = 0, repulse = 0, d = 0;
double impulse = 0.0;
float vrel_t_pre[3];
float temp[3], spf;
// calculate tangential velocity
/* calculate tangential velocity */
copy_v3_v3 ( temp, collpair->normal );
mul_v3_fl(temp, magrelVel);
sub_v3_v3v3(vrel_t_pre, relativeVelocity, temp);
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
/* Decrease in magnitude of relative tangential velocity due to coulomb friction
* in original formula "magrelVel" should be the "change of relative velocity in normal direction" */
magtangent = minf(clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf(dot_v3v3(vrel_t_pre, vrel_t_pre)));
// Apply friction impulse.
/* Apply friction impulse. */
if ( magtangent > ALMOST_ZERO ) {
normalize_v3(vrel_t_pre);
impulse = magtangent / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); // 2.0 *
impulse = magtangent / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); /* 2.0 * */
VECADDMUL ( i1, vrel_t_pre, w1 * impulse );
VECADDMUL ( i2, vrel_t_pre, w2 * impulse );
VECADDMUL ( i3, vrel_t_pre, w3 * impulse );
}
// Apply velocity stopping impulse
// I_c = m * v_N / 2.0
// no 2.0 * magrelVel normally, but looks nicer DG
/* Apply velocity stopping impulse
* I_c = m * v_N / 2.0
* no 2.0 * magrelVel normally, but looks nicer DG */
impulse = magrelVel / ( 1.0 + w1*w1 + w2*w2 + w3*w3 );
VECADDMUL ( i1, collpair->normal, w1 * impulse );
@ -300,24 +300,24 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
VECADDMUL ( i3, collpair->normal, w3 * impulse );
cloth1->verts[collpair->ap3].impulse_count++;
// Apply repulse impulse if distance too short
// I_r = -min(dt*kd, m(0, 1d/dt - v_n))
// DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this:
// v += impulse; x_new = x + v;
// We don't use dt!!
// DG TODO: Fix usage of dt here!
/* Apply repulse impulse if distance too short
* I_r = -min(dt*kd, m(0, 1d/dt - v_n))
* DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this:
* v += impulse; x_new = x + v;
* We don't use dt!!
* DG TODO: Fix usage of dt here! */
spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
d = clmd->coll_parms->epsilon*8.0f/9.0f + epsilon2*8.0f/9.0f - collpair->distance;
if ( ( magrelVel < 0.1f*d*spf ) && ( d > ALMOST_ZERO ) ) {
repulse = MIN2 ( d*1.0f/spf, 0.1f*d*spf - magrelVel );
// stay on the safe side and clamp repulse
/* stay on the safe side and clamp repulse */
if ( impulse > ALMOST_ZERO )
repulse = MIN2 ( repulse, 5.0*impulse );
repulse = MAX2 ( impulse, repulse );
impulse = repulse / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); // original 2.0 / 0.25
impulse = repulse / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); /* original 2.0 / 0.25 */
VECADDMUL ( i1, collpair->normal, impulse );
VECADDMUL ( i2, collpair->normal, impulse );
VECADDMUL ( i3, collpair->normal, impulse );
@ -326,19 +326,19 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
result = 1;
}
else {
// Apply repulse impulse if distance too short
// I_r = -min(dt*kd, max(0, 1d/dt - v_n))
// DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this:
// v += impulse; x_new = x + v;
// We don't use dt!!
/* Apply repulse impulse if distance too short
* I_r = -min(dt*kd, max(0, 1d/dt - v_n))
* DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this:
* v += impulse; x_new = x + v;
* We don't use dt!! */
float spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
float d = clmd->coll_parms->epsilon*8.0f/9.0f + epsilon2*8.0f/9.0f - collpair->distance;
if ( d > ALMOST_ZERO) {
// stay on the safe side and clamp repulse
/* stay on the safe side and clamp repulse */
float repulse = d*1.0f/spf;
float impulse = repulse / ( 3.0 * ( 1.0f + w1*w1 + w2*w2 + w3*w3 )); // original 2.0 / 0.25
float impulse = repulse / ( 3.0 * ( 1.0f + w1*w1 + w2*w2 + w3*w3 )); /* original 2.0 / 0.25 */
VECADDMUL ( i1, collpair->normal, impulse );
VECADDMUL ( i2, collpair->normal, impulse );
@ -805,7 +805,7 @@ int cloth_bvh_objcollision(Object *ob, ClothModifierData * clmd, float step, flo
////////////////////////////////////////////////////////////
if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF ) {
for (l = 0; l < (unsigned int)clmd->coll_parms->self_loop_count; l++) {
// TODO: add coll quality rounds again
/* TODO: add coll quality rounds again */
BVHTreeOverlap *overlap = NULL;
unsigned int result = 0;

View file

@ -1316,7 +1316,7 @@ static void followpath_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *
bFollowPathConstraint *data = con->data;
/* get Object transform (loc/rot/size) to determine transformation from path */
// TODO: this used to be local at one point, but is probably more useful as-is
/* TODO: this used to be local at one point, but is probably more useful as-is */
copy_m4_m4(obmat, cob->matrix);
/* get scaling of object before applying constraint */
@ -4435,9 +4435,9 @@ static bConstraint *add_new_constraint(Object *ob, bPoseChannel *pchan, const ch
/* make this constraint the active one */
constraints_set_active(list, con);
}
/* set type+owner specific immutable settings */
// TODO: does action constraint need anything here - i.e. spaceonce?
/* TODO: does action constraint need anything here - i.e. spaceonce? */
switch (type) {
case CONSTRAINT_TYPE_CHILDOF:
{

View file

@ -383,11 +383,11 @@ static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Mat
if (ma->adt) {
dag_add_driver_relation(ma->adt, dag, node, 1);
}
/* textures */
// TODO...
//dag_add_texture_driver_relations(DagForest *dag, DagNode *node, ID *id);
/* material's nodetree */
if (ma->nodetree) {
dag_add_material_nodetree_driver_relations(dag, node, ma->nodetree, ma);

View file

@ -634,9 +634,9 @@ short fcurve_are_keyframes_usable(FCurve *fcu)
/* if it has modifiers, none of these should "drastically" alter the curve */
if (fcu->modifiers.first) {
FModifier *fcm;
/* check modifiers from last to first, as last will be more influential */
// TODO: optionally, only check modifier if it is the active one...
/* TODO: optionally, only check modifier if it is the active one... */
for (fcm = fcu->modifiers.last; fcm; fcm = fcm->prev) {
/* ignore if muted/disabled */
if (fcm->flag & (FMODIFIER_FLAG_DISABLED | FMODIFIER_FLAG_MUTED))
@ -748,7 +748,7 @@ void fcurve_store_samples(FCurve *fcu, void *data, int start, int end, FcuSample
int cfra;
/* sanity checks */
// TODO: make these tests report errors using reports not printf's
/* TODO: make these tests report errors using reports not printf's */
if (ELEM(NULL, fcu, sample_cb)) {
printf("Error: No F-Curve with F-Curve Modifiers to Bake\n");
return;
@ -1018,7 +1018,7 @@ static float dtar_get_prop_val(ChannelDriver *driver, DriverTarget *dtar)
id = dtar_id_ensure_proxy_from(dtar->id);
/* error check for missing pointer... */
// TODO: tag the specific target too as having issues
/* TODO: tag the specific target too as having issues */
if (id == NULL) {
printf("Error: driver has an invalid target to use\n");
if (G.debug & G_DEBUG) printf("\tpath = %s\n", dtar->rna_path);
@ -1152,7 +1152,7 @@ static float dvar_eval_rotDiff(ChannelDriver *driver, DriverVar *dvar)
}
/* evaluate 'location difference' driver variable */
// TODO: this needs to take into account space conversions...
/* TODO: this needs to take into account space conversions... */
static float dvar_eval_locDiff(ChannelDriver *driver, DriverVar *dvar)
{
float loc1[3] = {0.0f, 0.0f, 0.0f};

View file

@ -463,7 +463,7 @@ static void fcm_envelope_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *cv
}
else {
/* evaltime occurs somewhere between segments */
// TODO: implement binary search for this to make it faster?
/* TODO: implement binary search for this to make it faster? */
for (a = 0; prevfed && fed && (a < env->totvert - 1); a++, prevfed = fed, fed++) {
/* evaltime occurs within the interval defined by these two envelope points */
if ((prevfed->time <= evaltime) && (fed->time >= evaltime)) {
@ -1005,7 +1005,7 @@ FModifier *add_fmodifier(ListBase *modifiers, int type)
/* special checks for whether modifier can be added */
if ((modifiers->first) && (type == FMODIFIER_TYPE_CYCLES)) {
/* cycles modifier must be first in stack, so for now, don't add if it can't be */
// TODO: perhaps there is some better way, but for now,
/* TODO: perhaps there is some better way, but for now, */
printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack.\n");
return NULL;
}
@ -1343,7 +1343,7 @@ void fcurve_bake_modifiers(FCurve *fcu, int start, int end)
ChannelDriver *driver;
/* sanity checks */
// TODO: make these tests report errors using reports not printf's
/* TODO: make these tests report errors using reports not printf's */
if (ELEM(NULL, fcu, fcu->modifiers.first)) {
printf("Error: No F-Curve with F-Curve Modifiers to Bake\n");
return;

View file

@ -1216,7 +1216,7 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i
{
BKE_imformat_defaults(im_format);
// file type
/* file type */
if (imbuf->ftype == IMAGIC)
im_format->imtype = R_IMF_IMTYPE_IRIS;
@ -1297,7 +1297,7 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i
im_format->quality = imbuf->ftype & ~JPG_MSK;
}
// planes
/* planes */
switch (imbuf->channels) {
case 0:
case 4: im_format->planes = R_IMF_PLANES_RGBA;

View file

@ -185,7 +185,7 @@ DO_INLINE void print_lfvector(float (*fLongVector)[3], unsigned int verts)
/* create long vector */
DO_INLINE lfVector *create_lfvector(unsigned int verts)
{
// TODO: check if memory allocation was successfull */
/* TODO: check if memory allocation was successfull */
return (lfVector *)MEM_callocN(verts * sizeof(lfVector), "cloth_implicit_alloc_vector");
// return (lfVector *)cloth_aligned_malloc(&MEMORY_BASE, verts * sizeof(lfVector));
}
@ -529,8 +529,8 @@ DO_INLINE void del_bfmatrix(fmatrix3x3 *matrix)
/* copy big matrix */
DO_INLINE void cp_bfmatrix(fmatrix3x3 *to, fmatrix3x3 *from)
{
// TODO bounds checking
{
// TODO bounds checking
memcpy(to, from, sizeof(fmatrix3x3) * (from[0].vcount+from[0].scount));
}
@ -1239,13 +1239,13 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
s->flags |= CLOTH_SPRING_FLAG_NEEDED;
k = clmd->sim_parms->structural;
scaling = k + s->stiffness * ABS(clmd->sim_parms->max_struct-k);
k = scaling / (clmd->sim_parms->avg_spring_len + FLT_EPSILON);
// TODO: verify, half verified (couldn't see error)
mul_fvector_S(stretch_force, dir, k*(length-L));
mul_fvector_S(stretch_force, dir, k*(length-L));
VECADD(s->f, s->f, stretch_force);
@ -1833,11 +1833,11 @@ int implicit_solver(Object *ob, float frame, ClothModifierData *clmd, ListBase *
for (i=0, cv=cloth->verts; i<cloth->numverts; i++, cv++) {
copy_v3_v3(initial_cos[i], cv->tx);
}
// call collision function
// TODO: check if "step" or "step+dt" is correct - dg
do_extra_solve = cloth_bvh_objcollision(ob, clmd, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale);
// copy corrected positions back to simulation
for (i = 0; i < numverts; i++) {
// correct velocity again, just to be sure we had to change it due to adaptive collisions

View file

@ -895,7 +895,7 @@ static char *get_rna_access(int blocktype, int adrcode, char actname[], char con
/* special case for rotdiff drivers... we don't need a property for this... */
break;
// TODO... add other blocktypes...
/* TODO... add other blocktypes... */
default:
printf("IPO2ANIMATO WARNING: No path for blocktype %d, adrcode %d yet\n", blocktype, adrcode);
break;
@ -1588,9 +1588,9 @@ static void action_to_animdata(ID *id, bAction *act)
/* ------------------------- */
// TODO:
// - NLA group duplicators info
// - NLA curve/stride modifiers...
/* TODO:
* - NLA group duplicators info
* - NLA curve/stride modifiers... */
/* Convert NLA-Strip to new system */
static void nlastrips_to_animdata(ID *id, ListBase *strips)

View file

@ -1618,13 +1618,13 @@ static void decode_tfaceflag(Material *ma, int flag, int convertall)
/* boolean check to see if the mesh needs a material */
static int check_tfaceneedmaterial(int flag)
{
// check if the flags we have are not deprecated != than default material options
// also if only flags are visible and collision see if all objects using this mesh have this option in physics
/* check if the flags we have are not deprecated != than default material options
* also if only flags are visible and collision see if all objects using this mesh have this option in physics */
/* flag is shifted in 1 to make 0 != no flag yet (see encode_tfaceflag) */
flag -= 1;
// deprecated flags
/* deprecated flags */
flag &= ~TF_OBCOL;
flag &= ~TF_SHAREDVERT;
flag &= ~TF_SHAREDCOL;
@ -1632,12 +1632,12 @@ static int check_tfaceneedmaterial(int flag)
/* light tface flag is ignored in GLSL mode */
flag &= ~TF_LIGHT;
// automatic detected if tex image has alpha
/* automatic detected if tex image has alpha */
flag &= ~(TF_ALPHA << 15);
// automatic detected if using texture
/* automatic detected if using texture */
flag &= ~TF_TEX;
// settings for the default NoMaterial
/* settings for the default NoMaterial */
if (flag == TF_DYNAMIC)
return 0;
@ -1646,7 +1646,7 @@ static int check_tfaceneedmaterial(int flag)
}
/* return number of digits of an integer */
// XXX to be optmized or replaced by an equivalent blender internal function
/* XXX to be optmized or replaced by an equivalent blender internal function */
static int integer_getdigits(int number)
{
int i = 0;
@ -1661,9 +1661,9 @@ static int integer_getdigits(int number)
static void calculate_tface_materialname(char *matname, char *newname, int flag)
{
// if flag has only light and collision and material matches those values
// you can do strcpy(name, mat_name);
// otherwise do:
/* if flag has only light and collision and material matches those values
* you can do strcpy(name, mat_name);
* otherwise do: */
int digits = integer_getdigits(flag);
/* clamp the old name, remove the MA prefix and add the .TF.flag suffix
* e.g. matname = "MALoooooooooooooongName"; newname = "Loooooooooooooon.TF.2" */
@ -1736,9 +1736,9 @@ static short convert_tfacenomaterial(Main *main, Mesh *me, MTFace *tf, int flag)
set_facetexture_flags(ma, tf->tpage);
decode_tfaceflag(ma, flag, 1);
// the final decoding will happen after, outside the main loop
// for now store the flag into the material and change light/tex/collision
// store the flag as a negative number
/* the final decoding will happen after, outside the main loop
* for now store the flag into the material and change light/tex/collision
* store the flag as a negative number */
ma->game.flag = -flag;
id_us_min((ID *)ma);
}

View file

@ -1469,20 +1469,20 @@ void BKE_nla_validate_state(AnimData *adt)
* for normal editing only (i.e. not in editmode for some strip's action),
* so no checks for this are performed.
*/
// TODO: maybe we should have checks for this too...
/* TODO: maybe we should have checks for this too... */
void BKE_nla_action_pushdown(AnimData *adt)
{
NlaStrip *strip;
/* sanity checks */
// TODO: need to report the error for this
/* TODO: need to report the error for this */
if (ELEM(NULL, adt, adt->action))
return;
/* if the action is empty, we also shouldn't try to add to stack,
/* if the action is empty, we also shouldn't try to add to stack,
* as that will cause us grief down the track
*/
// TODO: what about modifiers?
/* TODO: what about modifiers? */
if (action_has_motion(adt->action) == 0) {
printf("BKE_nla_action_pushdown(): action has no data\n");
return;

View file

@ -223,7 +223,7 @@ void BKE_object_link_modifiers(struct Object *ob, struct Object *from)
BKE_object_copy_particlesystems(ob, from);
BKE_object_copy_softbody(ob, from);
// TODO: smoke?, cloth?
/* TODO: smoke?, cloth? */
}
/* here we will collect all local displist stuff */
@ -376,7 +376,7 @@ void BKE_object_unlink(Object *ob)
unlink_actuators(&ob->actuators);
/* check all objects: parents en bevels and fields, also from libraries */
// FIXME: need to check all animation blocks (drivers)
/* FIXME: need to check all animation blocks (drivers) */
obt = bmain->object.first;
while (obt) {
if (obt->proxy == ob)
@ -1376,7 +1376,7 @@ void BKE_object_make_proxy(Object *ob, Object *target, Object *gob)
BKE_object_copy_proxy_drivers(ob, target);
/* skip constraints? */
// FIXME: this is considered by many as a bug
/* FIXME: this is considered by many as a bug */
/* set object type and link to data */
ob->type = target->type;
@ -1971,7 +1971,7 @@ static void solve_parenting(Scene *scene, Object *ob, Object *par, float obmat[]
// external usable originmat
copy_m3_m4(originmat, tmat);
// origin, voor help line
/* origin, for help line */
if ((ob->partype & PARTYPE) == PARSKEL) {
copy_v3_v3(ob->orig, par->obmat[3]);
}
@ -1987,7 +1987,7 @@ static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[
float fac1, fac2;
int a;
// include framerate
/* include framerate */
fac1 = (1.0f / (1.0f + fabsf(ob->sf)) );
if (fac1 >= 1.0f) return 0;
fac2 = 1.0f - fac1;

View file

@ -952,9 +952,9 @@ static void scene_update_drivers(Main *UNUSED(bmain), Scene *scene)
if (scene->adt && scene->adt->drivers.first) {
BKE_animsys_evaluate_animdata(scene, &scene->id, scene->adt, ctime, ADT_RECALC_DRIVERS);
}
/* world */
// TODO: what about world textures? but then those have nodes too...
/* TODO: what about world textures? but then those have nodes too... */
if (scene->world) {
ID *wid = (ID *)scene->world;
AnimData *adt = BKE_animdata_from_id(wid);

View file

@ -120,13 +120,13 @@ void space_transform_invert(const SpaceTransform *data, float co[3])
static void space_transform_apply_normal(const SpaceTransform *data, float no[3])
{
mul_mat3_m4_v3(((SpaceTransform *)data)->local2target, no);
normalize_v3(no); // TODO: could we just determine de scale value from the matrix?
normalize_v3(no); /* TODO: could we just determine de scale value from the matrix? */
}
static void space_transform_invert_normal(const SpaceTransform *data, float no[3])
{
mul_mat3_m4_v3(((SpaceTransform *)data)->target2local, no);
normalize_v3(no); // TODO: could we just determine de scale value from the matrix?
normalize_v3(no); /* TODO: could we just determine de scale value from the matrix? */
}
/*

View file

@ -134,12 +134,12 @@ DLRBT_Node *BLI_dlrbTree_search(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, vo
{
DLRBT_Node *node = (tree) ? tree->root : NULL;
short found = 0;
/* check that there is a comparator to use */
// TODO: if no comparator is supplied, try using the one supplied with the tree...
/* TODO: if no comparator is supplied, try using the one supplied with the tree... */
if (cmp_cb == NULL)
return NULL;
/* iteratively perform this search */
while (node && found == 0) {
/* check if traverse further or not
@ -177,7 +177,7 @@ DLRBT_Node *BLI_dlrbTree_search_exact(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_
short found = 0;
/* check that there is a comparator to use */
// TODO: if no comparator is supplied, try using the one supplied with the tree...
/* TODO: if no comparator is supplied, try using the one supplied with the tree... */
if (cmp_cb == NULL)
return NULL;
@ -217,7 +217,7 @@ DLRBT_Node *BLI_dlrbTree_search_prev(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_c
DLRBT_Node *node;
/* check that there is a comparator to use */
// TODO: if no comparator is supplied, try using the one supplied with the tree...
/* TODO: if no comparator is supplied, try using the one supplied with the tree... */
if (cmp_cb == NULL)
return NULL;
@ -242,9 +242,9 @@ DLRBT_Node *BLI_dlrbTree_search_prev(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_c
DLRBT_Node *BLI_dlrbTree_search_next(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
{
DLRBT_Node *node;
/* check that there is a comparator to use */
// TODO: if no comparator is supplied, try using the one supplied with the tree...
/* TODO: if no comparator is supplied, try using the one supplied with the tree... */
if (cmp_cb == NULL)
return NULL;
@ -512,18 +512,18 @@ DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
/* sanity checks */
if (tree == NULL)
return NULL;
// TODO: if no comparator is supplied, try using the one supplied with the tree...
/* TODO: if no comparator is supplied, try using the one supplied with the tree... */
if (cmp_cb == NULL)
return NULL;
// TODO: if no allocator is supplied, try using the one supplied with the tree...
/* TODO: if no allocator is supplied, try using the one supplied with the tree... */
if (new_cb == NULL)
return NULL;
// TODO: if no updater is supplied, try using the one supplied with the tree...
/* TODO: if no updater is supplied, try using the one supplied with the tree... */
/* try to find the nearest node to this one */
parNode = BLI_dlrbTree_search(tree, cmp_cb, data);
/* add new node to the BST in the 'standard way' as appropriate
* NOTE: we do not support duplicates in our tree...
*/
@ -586,6 +586,6 @@ DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
/* *********************************************** */
/* Remove */
// TODO: this hasn't been coded yet, since this functionality was not needed by the author
/* TODO: this hasn't been coded yet, since this functionality was not needed by the author */
/* *********************************************** */

View file

@ -1271,7 +1271,7 @@ int is_negative_m4(float mat[][4])
/* make a 4x4 matrix out of 3 transform components */
/* matrices are made in the order: scale * rot * loc */
// TODO: need to have a version that allows for rotation order...
/* TODO: need to have a version that allows for rotation order... */
void loc_eul_size_to_mat4(float mat[4][4], const float loc[3], const float eul[3], const float size[3])
{

View file

@ -99,11 +99,11 @@
*/
static BMOpDefine bmo_smooth_vert_def = {
"smooth_vert",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
{BMO_OP_SLOT_BOOL, "mirror_clip_x"}, //set vertices close to the x axis before the operation to 0
{BMO_OP_SLOT_BOOL, "mirror_clip_y"}, //set vertices close to the y axis before the operation to 0
{BMO_OP_SLOT_BOOL, "mirror_clip_z"}, //set vertices close to the z axis before the operation to 0
{BMO_OP_SLOT_FLT, "clipdist"}, //clipping threshod for the above three slots
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input vertices */
{BMO_OP_SLOT_BOOL, "mirror_clip_x"}, /* set vertices close to the x axis before the operation to 0 */
{BMO_OP_SLOT_BOOL, "mirror_clip_y"}, /* set vertices close to the y axis before the operation to 0 */
{BMO_OP_SLOT_BOOL, "mirror_clip_z"}, /* set vertices close to the z axis before the operation to 0 */
{BMO_OP_SLOT_FLT, "clipdist"}, /* clipping threshod for the above three slots */
{0} /* null-terminating sentinel */,
},
bmo_smooth_vert_exec,
@ -119,7 +119,7 @@ static BMOpDefine bmo_smooth_vert_def = {
static BMOpDefine bmo_recalc_face_normals_def = {
"recalc_face_normals",
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
{BMO_OP_SLOT_BOOL, "do_flip"}, //internal flag, used by bmesh_rationalize_normals
{BMO_OP_SLOT_BOOL, "do_flip"}, /* internal flag, used by bmesh_rationalize_normals */
{0} /* null-terminating sentinel */,
},
bmo_recalc_face_normals_exec,
@ -138,10 +138,10 @@ static BMOpDefine bmo_recalc_face_normals_def = {
*/
static BMOpDefine bmo_region_extend_def = {
"region_extend",
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, //input geometry
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, //output slot, computed boundary geometry.
{BMO_OP_SLOT_BOOL, "constrict"}, //find boundary inside the regions, not outside.
{BMO_OP_SLOT_BOOL, "use_faces"}, //extend from faces instead of edges
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, /* input geometry */
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, /* output slot, computed boundary geometry. */
{BMO_OP_SLOT_BOOL, "constrict"}, /* find boundary inside the regions, not outside. */
{BMO_OP_SLOT_BOOL, "use_faces"}, /* extend from faces instead of edges */
{0} /* null-terminating sentinel */,
},
bmo_region_extend_exec,
@ -156,9 +156,9 @@ static BMOpDefine bmo_region_extend_def = {
*/
static BMOpDefine bmo_rotate_edges_def = {
"rotate_edges",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, //input edges
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, //newly spun edges
{BMO_OP_SLOT_BOOL, "ccw"}, //rotate edge counter-clockwise if true, othewise clockwise
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edges */
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, /* newly spun edges */
{BMO_OP_SLOT_BOOL, "ccw"}, /* rotate edge counter-clockwise if true, othewise clockwise */
{0} /* null-terminating sentinel */,
},
bmo_rotate_edges_exec,
@ -173,7 +173,7 @@ static BMOpDefine bmo_rotate_edges_def = {
*/
static BMOpDefine bmo_reverse_faces_def = {
"reverse_faces",
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, //input faces
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, /* input faces */
{0} /* null-terminating sentinel */,
},
bmo_reverse_faces_exec,
@ -188,9 +188,9 @@ static BMOpDefine bmo_reverse_faces_def = {
*/
static BMOpDefine bmo_bisect_edges_def = {
"bisect_edges",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, //input edges
{BMO_OP_SLOT_INT, "numcuts"}, //number of cuts
{BMO_OP_SLOT_ELEMENT_BUF, "outsplit"}, //newly created vertices and edges
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edges */
{BMO_OP_SLOT_INT, "numcuts"}, /* number of cuts */
{BMO_OP_SLOT_ELEMENT_BUF, "outsplit"}, /* newly created vertices and edges */
{0} /* null-terminating sentinel */,
},
bmo_bisect_edges_exec,
@ -207,13 +207,13 @@ static BMOpDefine bmo_bisect_edges_def = {
static BMOpDefine bmo_mirror_def = {
"mirror",
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, //input geometry
{BMO_OP_SLOT_MAT, "mat"}, //matrix defining the mirror transformation
{BMO_OP_SLOT_FLT, "mergedist"}, //maximum distance for merging. does no merging if 0.
{BMO_OP_SLOT_ELEMENT_BUF, "newout"}, //output geometry, mirrored
{BMO_OP_SLOT_INT, "axis"}, //the axis to use, 0, 1, or 2 for x, y, z
{BMO_OP_SLOT_BOOL, "mirror_u"}, //mirror UVs across the u axis
{BMO_OP_SLOT_BOOL, "mirror_v"}, //mirror UVs across the v axis
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, /* input geometry */
{BMO_OP_SLOT_MAT, "mat"}, /* matrix defining the mirror transformation */
{BMO_OP_SLOT_FLT, "mergedist"}, /* maximum distance for merging. does no merging if 0. */
{BMO_OP_SLOT_ELEMENT_BUF, "newout"}, /* output geometry, mirrored */
{BMO_OP_SLOT_INT, "axis"}, /* the axis to use, 0, 1, or 2 for x, y, z */
{BMO_OP_SLOT_BOOL, "mirror_u"}, /* mirror UVs across the u axis */
{BMO_OP_SLOT_BOOL, "mirror_v"}, /* mirror UVs across the v axis */
{0, /* null-terminating sentinel */}},
bmo_mirror_exec,
0,
@ -230,9 +230,9 @@ static BMOpDefine bmo_mirror_def = {
*/
static BMOpDefine bmo_find_doubles_def = {
"find_doubles",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
{BMO_OP_SLOT_ELEMENT_BUF, "keep_verts"}, //list of verts to keep
{BMO_OP_SLOT_FLT, "dist"}, //minimum distance
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input vertices */
{BMO_OP_SLOT_ELEMENT_BUF, "keep_verts"}, /* list of verts to keep */
{BMO_OP_SLOT_FLT, "dist"}, /* minimum distance */
{BMO_OP_SLOT_MAPPING, "targetmapout"},
{0, /* null-terminating sentinel */}},
bmo_find_doubles_exec,
@ -247,8 +247,8 @@ static BMOpDefine bmo_find_doubles_def = {
*/
static BMOpDefine bmo_remove_doubles_def = {
"remove_doubles",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input verts
{BMO_OP_SLOT_FLT, "dist"}, //minimum distance
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input verts */
{BMO_OP_SLOT_FLT, "dist"}, /* minimum distance */
{0, /* null-terminating sentinel */}},
bmo_remove_doubles_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
@ -263,8 +263,8 @@ static BMOpDefine bmo_remove_doubles_def = {
*/
static BMOpDefine bmo_automerge_def = {
"automerge",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input verts
{BMO_OP_SLOT_FLT, "dist"}, //minimum distance
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input verts */
{BMO_OP_SLOT_FLT, "dist"}, /* minimum distance */
{0, /* null-terminating sentinel */}},
bmo_automerge_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
@ -916,11 +916,11 @@ static BMOpDefine bmo_split_edges_def = {
*/
static BMOpDefine bmo_create_grid_def = {
"create_grid",
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_INT, "xsegments"}, //number of x segments
{BMO_OP_SLOT_INT, "ysegments"}, //number of y segments
{BMO_OP_SLOT_FLT, "size"}, //size of the grid
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output verts */
{BMO_OP_SLOT_INT, "xsegments"}, /* number of x segments */
{BMO_OP_SLOT_INT, "ysegments"}, /* number of y segments */
{BMO_OP_SLOT_FLT, "size"}, /* size of the grid */
{BMO_OP_SLOT_MAT, "mat"}, /* matrix to multiply the new geometry with */
{0, /* null-terminating sentinel */}},
bmo_create_grid_exec,
0,
@ -933,11 +933,11 @@ static BMOpDefine bmo_create_grid_def = {
*/
static BMOpDefine bmo_create_uvsphere_def = {
"create_uvsphere",
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_INT, "segments"}, //number of u segments
{BMO_OP_SLOT_INT, "revolutions"}, //number of v segment
{BMO_OP_SLOT_FLT, "diameter"}, //diameter
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output verts */
{BMO_OP_SLOT_INT, "segments"}, /* number of u segments */
{BMO_OP_SLOT_INT, "revolutions"}, /* number of v segment */
{BMO_OP_SLOT_FLT, "diameter"}, /* diameter */
{BMO_OP_SLOT_MAT, "mat"}, /* matrix to multiply the new geometry with-- */
{0, /* null-terminating sentinel */}},
bmo_create_uvsphere_exec,
0,
@ -950,10 +950,10 @@ static BMOpDefine bmo_create_uvsphere_def = {
*/
static BMOpDefine bmo_create_icosphere_def = {
"create_icosphere",
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_INT, "subdivisions"}, //how many times to recursively subdivide the sphere
{BMO_OP_SLOT_FLT, "diameter"}, //diameter
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output verts */
{BMO_OP_SLOT_INT, "subdivisions"}, /* how many times to recursively subdivide the sphere */
{BMO_OP_SLOT_FLT, "diameter"}, /* diameter */
{BMO_OP_SLOT_MAT, "mat"}, /* matrix to multiply the new geometry with */
{0, /* null-terminating sentinel */}},
bmo_create_icosphere_exec,
0,
@ -966,8 +966,8 @@ static BMOpDefine bmo_create_icosphere_def = {
*/
static BMOpDefine bmo_create_monkey_def = {
"create_monkey",
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output verts */
{BMO_OP_SLOT_MAT, "mat"}, /* matrix to multiply the new geometry with-- */
{0, /* null-terminating sentinel */}},
bmo_create_monkey_exec,
0,
@ -980,14 +980,14 @@ static BMOpDefine bmo_create_monkey_def = {
*/
static BMOpDefine bmo_create_cone_def = {
"create_cone",
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_BOOL, "cap_ends"}, //wheter or not to fill in the ends with faces
{BMO_OP_SLOT_BOOL, "cap_tris"}, //fill ends with triangles instead of ngons
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output verts */
{BMO_OP_SLOT_BOOL, "cap_ends"}, /* wheter or not to fill in the ends with faces */
{BMO_OP_SLOT_BOOL, "cap_tris"}, /* fill ends with triangles instead of ngons */
{BMO_OP_SLOT_INT, "segments"},
{BMO_OP_SLOT_FLT, "diameter1"}, //diameter of one end
{BMO_OP_SLOT_FLT, "diameter2"}, //diameter of the opposite
{BMO_OP_SLOT_FLT, "depth"}, //distance between ends
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
{BMO_OP_SLOT_FLT, "diameter1"}, /* diameter of one end */
{BMO_OP_SLOT_FLT, "diameter2"}, /* diameter of the opposite */
{BMO_OP_SLOT_FLT, "depth"}, /* distance between ends */
{BMO_OP_SLOT_MAT, "mat"}, /* matrix to multiply the new geometry with-- */
{0, /* null-terminating sentinel */}},
bmo_create_cone_exec,
0,
@ -998,12 +998,12 @@ static BMOpDefine bmo_create_cone_def = {
*/
static BMOpDefine bmo_create_circle_def = {
"create_circle",
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_BOOL, "cap_ends"}, //wheter or not to fill in the ends with faces
{BMO_OP_SLOT_BOOL, "cap_tris"}, //fill ends with triangles instead of ngons
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output verts */
{BMO_OP_SLOT_BOOL, "cap_ends"}, /* wheter or not to fill in the ends with faces */
{BMO_OP_SLOT_BOOL, "cap_tris"}, /* fill ends with triangles instead of ngons */
{BMO_OP_SLOT_INT, "segments"},
{BMO_OP_SLOT_FLT, "diameter"}, //diameter of one end
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
{BMO_OP_SLOT_FLT, "diameter"}, /* diameter of one end */
{BMO_OP_SLOT_MAT, "mat"}, /* matrix to multiply the new geometry with-- */
{0, /* null-terminating sentinel */}},
bmo_create_circle_exec,
0,
@ -1016,9 +1016,9 @@ static BMOpDefine bmo_create_circle_def = {
*/
static BMOpDefine bmo_create_cube_def = {
"create_cube",
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_FLT, "size"}, //size of the cube
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output verts */
{BMO_OP_SLOT_FLT, "size"}, /* size of the cube */
{BMO_OP_SLOT_MAT, "mat"}, /* matrix to multiply the new geometry with-- */
{0, /* null-terminating sentinel */}},
bmo_create_cube_exec,
0,

View file

@ -3009,28 +3009,28 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
offset += ICON_WIDTH;
}
}
/* step 5) draw name ............................................... */
// TODO: when renaming, we might not want to draw this, especially if name happens to be longer than channel
/* TODO: when renaming, we might not want to draw this, especially if name happens to be longer than channel */
if (acf->name) {
char name[ANIM_CHAN_NAME_SIZE]; /* hopefully this will be enough! */
/* set text color */
// XXX: if active, highlight differently?
/* XXX: if active, highlight differently? */
if (selected)
UI_ThemeColor(TH_TEXT_HI);
else
UI_ThemeColor(TH_TEXT);
/* get name */
acf->name(ale, name);
offset += 3;
UI_DrawString(offset, ytext, name);
/* draw red underline if channel is disabled */
if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED)) {
// FIXME: replace hardcoded color here, and check on extents!
/* FIXME: replace hardcoded color here, and check on extents! */
glColor3f(1.0f, 0.0f, 0.0f);
glLineWidth(2.0);
fdrawline((float)(offset), yminc,
@ -3038,13 +3038,13 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
glLineWidth(1.0);
}
}
/* step 6) draw backdrops behidn mute+protection toggles + (sliders) ....................... */
/* reset offset - now goes from RHS of panel */
offset = 0;
// TODO: when drawing sliders, make those draw instead of these toggles if not enough space
/* TODO: when drawing sliders, make those draw instead of these toggles if not enough space */
if (v2d) {
short draw_sliders = 0;
float color[3];

View file

@ -400,7 +400,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
/* compare data, and type as main way of identifying the channel */
if ((ale->data == ale_setting->data) && (ale->type == ale_setting->type)) {
/* we also have to check the ID, this is assigned to, since a block may have multiple users */
// TODO: is the owner-data more revealing?
/* TODO: is the owner-data more revealing? */
if (ale->id == ale_setting->id) {
match = ale;
break;
@ -576,13 +576,13 @@ static int animedit_poll_channels_active(bContext *C)
ScrArea *sa = CTX_wm_area(C);
/* channels region test */
// TODO: could enhance with actually testing if channels region?
/* TODO: could enhance with actually testing if channels region? */
if (ELEM(NULL, sa, CTX_wm_region(C)))
return 0;
/* animation editor test */
if (ELEM3(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA) == 0)
return 0;
return 1;
}
@ -591,9 +591,9 @@ static int animedit_poll_channels_nla_tweakmode_off(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
Scene *scene = CTX_data_scene(C);
/* channels region test */
// TODO: could enhance with actually testing if channels region?
/* TODO: could enhance with actually testing if channels region? */
if (ELEM(NULL, sa, CTX_wm_region(C)))
return 0;
/* animation editor test */
@ -1314,16 +1314,16 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op))
/* make all the selected channels visible */
filter = (ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
/* hack: skip object channels for now, since flushing those will always flush everything, but they are always included */
// TODO: find out why this is the case, and fix that
/* TODO: find out why this is the case, and fix that */
if (ale->type == ANIMTYPE_OBJECT)
continue;
/* enable the setting */
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_ADD);
/* now, also flush selection status up/down as appropriate */
ANIM_flush_setting_anim_channels(&ac, &all_data, ale, ACHANNEL_SETTING_VISIBLE, 1);
}
@ -1394,13 +1394,13 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *UNUSED(o
/* Now set the flags */
for (ale = anim_data.first; ale; ale = ale->next) {
/* hack: skip object channels for now, since flushing those will always flush everything, but they are always included */
// TODO: find out why this is the case, and fix that
/* TODO: find out why this is the case, and fix that */
if (ale->type == ANIMTYPE_OBJECT)
continue;
/* change the setting */
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, vis);
/* now, also flush selection status up/down as appropriate */
ANIM_flush_setting_anim_channels(&ac, &all_data, ale, ACHANNEL_SETTING_VISIBLE, (vis == ACHANNEL_SETFLAG_ADD));
}
@ -1734,9 +1734,9 @@ static void ANIM_OT_channels_collapse(wmOperatorType *ot)
static int animchannels_enable_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
/* channels region test */
// TODO: could enhance with actually testing if channels region?
/* TODO: could enhance with actually testing if channels region? */
if (ELEM(NULL, sa, CTX_wm_region(C)))
return 0;
@ -2103,17 +2103,17 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
BLI_freelistN(&anim_data);
return 0;
}
/* selectmode -1 is a special case for ActionGroups only, which selects all of the channels underneath it only... */
// TODO: should this feature be extended to work with other channel types too?
/* TODO: should this feature be extended to work with other channel types too? */
if ((selectmode == -1) && (ale->type != ANIMTYPE_GROUP)) {
/* normal channels should not behave normally in this case */
BLI_freelistN(&anim_data);
return 0;
}
/* action to take depends on what channel we've got */
// WARNING: must keep this in sync with the equivalent function in nla_channels.c
/* WARNING: must keep this in sync with the equivalent function in nla_channels.c */
switch (ale->type) {
case ANIMTYPE_SCENE:
{
@ -2152,9 +2152,9 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
}
else {
Base *b;
/* deselect all */
// TODO: should this deselect all other types of channels too?
/* TODO: should this deselect all other types of channels too? */
for (b = sce->base.first; b; b = b->next) {
b->flag &= ~SELECT;
b->object->flag = b->flag;
@ -2438,10 +2438,10 @@ void ED_operatortypes_animchannels(void)
WM_operatortype_append(ANIM_OT_channels_setting_enable);
WM_operatortype_append(ANIM_OT_channels_setting_disable);
WM_operatortype_append(ANIM_OT_channels_setting_toggle);
WM_operatortype_append(ANIM_OT_channels_delete);
// XXX does this need to be a separate operator?
/* XXX does this need to be a separate operator? */
WM_operatortype_append(ANIM_OT_channels_editable_toggle);
WM_operatortype_append(ANIM_OT_channels_move);
@ -2463,11 +2463,11 @@ void ED_keymap_animchannels(wmKeyConfig *keyconf)
/* selection */
/* click-select */
// XXX for now, only leftmouse....
/* XXX for now, only leftmouse.... */
WM_keymap_add_item(keymap, "ANIM_OT_channels_click", LEFTMOUSE, KM_PRESS, 0, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", TRUE);
RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_CTRL | KM_SHIFT, 0)->ptr, "children_only", TRUE);
/* rename */
WM_keymap_add_item(keymap, "ANIM_OT_channels_rename", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);

View file

@ -381,11 +381,11 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short rest
return RAD2DEGF(1.0f); /* radians to degrees */
}
}
// TODO: other rotation types here as necessary
/* TODO: other rotation types here as necessary */
}
}
/* no mapping needs to occur... */
return 1.0f;
}

View file

@ -164,21 +164,21 @@ static short actedit_get_context(bAnimContext *ac, SpaceAction *saction)
ac->mode = saction->mode;
return 1;
case SACTCONT_GPENCIL: /* Grease Pencil */ // XXX review how this mode is handled...
case SACTCONT_GPENCIL: /* Grease Pencil */ /* XXX review how this mode is handled... */
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
saction->ads.source = (ID *)ac->scene;
ac->datatype = ANIMCONT_GPENCIL;
ac->data = &saction->ads;
ac->mode = saction->mode;
return 1;
case SACTCONT_MASK: /* Grease Pencil */ // XXX review how this mode is handled...
case SACTCONT_MASK: /* Grease Pencil */ /* XXX review how this mode is handled... */
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
{
// TODO, other methods to get the mask
/* TODO, other methods to get the mask */
// Sequence *seq = BKE_sequencer_active_get(ac->scene);
//MovieClip *clip = ac->scene->clip;
// struct Mask *mask = seq ? seq->mask : NULL;
@ -1890,9 +1890,9 @@ static size_t animdata_filter_ds_obanim(bAnimContext *ac, ListBase *anim_data, b
AnimData *adt = ob->adt;
short type = 0, expanded = 1;
void *cdata = NULL;
/* determine the type of expander channels to use */
// this is the best way to do this for now...
/* this is the best way to do this for now... */
ANIMDATA_FILTER_CASES(ob,
{ /* AnimData - no channel, but consider data */ },
{ /* NLA - no channel, but consider data */ },
@ -2122,11 +2122,11 @@ static size_t animdata_filter_dopesheet_scene(bAnimContext *ac, ListBase *anim_d
if ((ntree) && !(ads->filterflag & ADS_FILTER_NONTREE)) {
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)sce, ntree, filter_mode);
}
// TODO: one day, when sequencer becomes its own datatype, perhaps it should be included here
/* TODO: one day, when sequencer becomes its own datatype, perhaps it should be included here */
}
END_ANIMFILTER_SUBCHANNELS;
/* if we collected some channels, add these to the new list... */
if (tmp_items) {
/* firstly add object expander if required */

View file

@ -143,15 +143,15 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
/* no array index */
arrayname = "";
}
/* putting this all together into the buffer */
// XXX we need to check for invalid names...
// XXX the name length limit needs to be passed in or as some define
/* XXX we need to check for invalid names...
* XXX the name length limit needs to be passed in or as some define */
if (structname)
BLI_snprintf(name, 256, "%s%s (%s)", arrayname, propname, structname);
BLI_snprintf(name, 256, "%s%s (%s)", arrayname, propname, structname);
else
BLI_snprintf(name, 256, "%s%s", arrayname, propname);
BLI_snprintf(name, 256, "%s%s", arrayname, propname);
/* free temp name if nameprop is set */
if (free_structname)
MEM_freeN((void *)structname);
@ -170,11 +170,11 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
else {
/* invalid path */
BLI_snprintf(name, 256, "\"%s[%d]\"", fcu->rna_path, fcu->array_index);
/* icon for this should be the icon for the base ID */
// TODO: or should we just use the error icon?
/* TODO: or should we just use the error icon? */
icon = RNA_struct_ui_icon(id_ptr.type);
/* tag F-Curve as disabled - as not usable path */
fcu->flag |= FCURVE_DISABLED;
}

View file

@ -506,10 +506,10 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
row = uiLayoutRow(col, TRUE);
uiItemR(row, &ptr, "default_min", 0, IFACE_("Min"), ICON_NONE);
uiItemR(row, &ptr, "default_max", 0, IFACE_("Max"), ICON_NONE);
/* control points header */
// TODO: move this control-point control stuff to using the new special widgets for lists
// the current way is far too cramped
/* TODO: move this control-point control stuff to using the new special widgets for lists
* the current way is far too cramped */
row = uiLayoutRow(layout, FALSE);
block = uiLayoutGetBlock(row);

View file

@ -673,23 +673,23 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
/* draw keys */
if (keys) {
/* locked channels are less strongly shown, as feedback for locked channels in DopeSheet */
// TODO: allow this opacity factor to be themed?
/* TODO: allow this opacity factor to be themed? */
float kalpha = (channelLocked) ? 0.35f : 1.0f;
for (ak = keys->first; ak; ak = ak->next) {
/* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw
/* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw
* - this might give some improvements, since we current have to flip between view/region matrices
*/
if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax) == 0)
continue;
/* draw using OpenGL - uglier but faster */
// NOTE1: a previous version of this didn't work nice for some intel cards
// NOTE2: if we wanted to go back to icons, these are icon = (ak->sel & SELECT) ? ICON_SPACE2 : ICON_SPACE3;
/* NOTE1: a previous version of this didn't work nice for some intel cards
* NOTE2: if we wanted to go back to icons, these are icon = (ak->sel & SELECT) ? ICON_SPACE2 : ICON_SPACE3; */
draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT), ak->key_type, KEYFRAME_SHAPE_BOTH, kalpha);
}
}
}
glDisable(GL_BLEND);
}

View file

@ -134,9 +134,9 @@ bAction *verify_adt_action(ID *id, short add)
printf("ERROR: Couldn't add AnimData (ID = %s)\n", (id) ? (id->name) : "<None>");
return NULL;
}
/* init action if none available yet */
// TODO: need some wizardry to handle NLA stuff correct
/* TODO: need some wizardry to handle NLA stuff correct */
if ((adt->action == NULL) && (add)) {
char actname[sizeof(id->name) - 2];
BLI_snprintf(actname, sizeof(actname), "%sAction", id->name + 2);
@ -256,8 +256,8 @@ int insert_bezt_fcurve(FCurve *fcu, BezTriple *bezt, short flag)
dst->f1 = bezt->f1;
dst->f2 = bezt->f2;
dst->f3 = bezt->f3;
// TODO: perform some other operations?
/* TODO: perform some other operations? */
}
}
/* keyframing modes allow to not replace keyframe */
@ -1691,11 +1691,11 @@ static short object_frame_has_keyframe(Object *ob, float frame, short filter)
/* 1. test for relative (with keyframes) */
if (id_frame_has_keyframe((ID *)key, frame, filter))
return 1;
/* 2. test for time */
// TODO... yet to be implemented (this feature may evolve before then anyway)
/* TODO... yet to be implemented (this feature may evolve before then anyway) */
}
/* try materials */
if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOMAT) ) {
/* if only active, then we can skip a lot of looping */

View file

@ -597,13 +597,13 @@ void ANIM_keyingset_info_register(KeyingSetInfo *ksi)
void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *ksi)
{
KeyingSet *ks, *ksn;
/* find relevant builtin KeyingSets which use this, and remove them */
// TODO: this isn't done now, since unregister is really only used atm when we
// reload the scripts, which kindof defeats the purpose of "builtin"?
/* TODO: this isn't done now, since unregister is really only used atm when we
* reload the scripts, which kindof defeats the purpose of "builtin"? */
for (ks = builtin_keyingsets.first; ks; ks = ksn) {
ksn = ks->next;
/* remove if matching typeinfo name */
if (strcmp(ks->typeinfo, ksi->idname) == 0) {
Scene *scene;
@ -791,8 +791,8 @@ short ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *ks)
/* get the associated 'type info' for this KeyingSet */
if (ksi == NULL)
return 0;
// TODO: check for missing callbacks!
/* TODO: check for missing callbacks! */
/* check if it can be used in the current context */
return (ksi->poll(ksi, C));
}
@ -878,8 +878,8 @@ short ANIM_validate_keyingset(bContext *C, ListBase *dsources, KeyingSet *ks)
/* get the associated 'type info' for this KeyingSet */
if (ksi == NULL)
return MODIFYKEY_MISSING_TYPEINFO;
// TODO: check for missing callbacks!
/* TODO: check for missing callbacks! */
/* check if it can be used in the current context */
if (ksi->poll(ksi, C)) {
/* if a list of data sources are provided, run a special iterator over them,

View file

@ -191,8 +191,8 @@ void ED_operatormacros_armature(void)
RNA_enum_set(otmacro->ptr, "proportional", 0);
}
// XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate?
// that would require fixing a properties bug 19733
/* XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate?
* that would require fixing a properties bug 19733 */
ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked",
"Create new bones from the selected joints and move them",
OPTYPE_UNDO | OPTYPE_REGISTER);
@ -321,7 +321,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_apply", AKEY, KM_PRESS, KM_CTRL, 0);
// TODO: clear pose
/* TODO: clear pose */
WM_keymap_add_item(keymap, "POSE_OT_rot_clear", RKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "POSE_OT_loc_clear", GKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "POSE_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0);

View file

@ -657,12 +657,12 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature"); //error_libdata();
return OPERATOR_CANCELLED;
}
/* helpful warnings... */
// TODO: add warnings to be careful about actions, applying deforms first, etc.
if (ob->adt && ob->adt->action)
/* TODO: add warnings to be careful about actions, applying deforms first, etc. */
if (ob->adt && ob->adt->action)
BKE_report(op->reports, RPT_WARNING, "Actions on this armature will be destroyed by this new rest pose as the transforms stored are relative to the old rest pose");
/* Get editbones of active armature to alter */
ED_armature_to_edit(ob);
@ -1192,9 +1192,9 @@ static int separate_armature_exec(bContext *C, wmOperator *UNUSED(op))
* 4. fix constraint links
* 5. make original armature active and enter editmode
*/
/* 1) only edit-base selected */
// TODO: use context iterators for this?
/* TODO: use context iterators for this? */
CTX_DATA_BEGIN(C, Base *, base, visible_bases)
{
if (base->object == obedit) base->flag |= 1;

View file

@ -243,32 +243,32 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, float *val)
* - numerator should be larger than denominator to 'expand' the result
* - perform this weighting a number of times given by the percentage...
*/
int iters = (int)ceil(10.0f * pso->percentage); // TODO: maybe a sensitivity ctrl on top of this is needed
int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */
while (iters-- > 0) {
(*val) = (-((sVal * w2) + (eVal * w1)) + ((*val) * 6.0f) ) / 5.0f;
}
}
break;
case POSESLIDE_RELAX: /* make the current pose more like its surrounding ones */
{
/* perform a weighted average here, favoring the middle pose
* - numerator should be smaller than denominator to 'relax' the result
* - perform this weighting a number of times given by the percentage...
*/
int iters = (int)ceil(10.0f * pso->percentage); // TODO: maybe a sensitivity ctrl on top of this is needed
int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */
while (iters-- > 0) {
(*val) = ( ((sVal * w2) + (eVal * w1)) + ((*val) * 5.0f) ) / 6.0f;
}
}
break;
case POSESLIDE_BREAKDOWN: /* make the current pose slide around between the endpoints */
{
/* perform simple linear interpolation - coefficient for start must come from pso->percentage... */
// TODO: make this use some kind of spline interpolation instead?
/* TODO: make this use some kind of spline interpolation instead? */
(*val) = ((sVal * w2) + (eVal * w1));
}
break;
@ -415,11 +415,11 @@ static void pose_slide_apply_quat(tPoseSlideOp *pso, tPChanFCurveLink *pfl)
}
else if (pso->mode == POSESLIDE_PUSH) {
float quat_diff[4], quat_orig[4];
/* calculate the delta transform from the previous to the current */
// TODO: investigate ways to favour one transform more?
/* TODO: investigate ways to favour one transform more? */
sub_qt_qtqt(quat_diff, pchan->quat, quat_prev);
/* make a copy of the original rotation */
copy_qt_qt(quat_orig, pchan->quat);
@ -428,8 +428,8 @@ static void pose_slide_apply_quat(tPoseSlideOp *pso, tPChanFCurveLink *pfl)
}
else {
float quat_interp[4], quat_orig[4];
int iters = (int)ceil(10.0f * pso->percentage); // TODO: maybe a sensitivity ctrl on top of this is needed
int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */
/* perform this blending several times until a satisfactory result is reached */
while (iters-- > 0) {
/* calculate the interpolation between the endpoints */

View file

@ -306,11 +306,11 @@ static int poselib_sanitize_exec(bContext *C, wmOperator *op)
BLI_dlrbTree_init(&keys);
action_to_keylist(NULL, act, &keys, NULL);
BLI_dlrbTree_linkedlist_sync(&keys);
/* for each key, make sure there is a corresponding pose */
for (ak = keys.first; ak; ak = ak->next) {
/* check if any pose matches this */
// TODO: don't go looking through the list like this every time...
/* TODO: don't go looking through the list like this every time... */
for (marker = act->markers.first; marker; marker = marker->next) {
if (IS_EQ(marker->frame, (double)ak->cfra)) {
marker->flag = -1;
@ -819,12 +819,12 @@ static void poselib_backup_restore(tPoseLib_PreviewData *pld)
for (plb = pld->backups.first; plb; plb = plb->next) {
/* copy most of data straight back */
memcpy(plb->pchan, &plb->olddata, sizeof(bPoseChannel));
/* just overwrite values of properties from the stored copies (there should be some) */
if (plb->oldprops)
IDP_SyncGroupValues(plb->pchan->prop, plb->oldprops);
// TODO: constraints settings aren't restored yet, even though these could change (though not that likely)
/* TODO: constraints settings aren't restored yet, even though these could change (though not that likely) */
}
}
@ -832,10 +832,10 @@ static void poselib_backup_restore(tPoseLib_PreviewData *pld)
static void poselib_backup_free_data(tPoseLib_PreviewData *pld)
{
tPoseLib_Backup *plb, *plbn;
for (plb = pld->backups.first; plb; plb = plbn) {
plbn = plb->next;
/* free custom data */
if (plb->oldprops) {
IDP_FreeProperty(plb->oldprops);
@ -1658,11 +1658,11 @@ void POSELIB_OT_apply_pose(wmOperatorType *ot)
/* callbacks */
ot->exec = poselib_preview_exec;
ot->poll = has_poselib_pose_data_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
// TODO: make the pose_index into a proper enum instead of a cryptic int...
/* properties */
/* TODO: make the pose_index into a proper enum instead of a cryptic int... */
ot->prop = RNA_def_int(ot->srna, "pose_index", -1, -2, INT_MAX, "Pose", "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)", 0, INT_MAX);
}

View file

@ -103,7 +103,7 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
return;
}
// XXX: disabled as this would otherwise cause a nasty loop...
/* XXX: disabled as this would otherwise cause a nasty loop... */
//ED_object_toggle_modes(C, ob->mode);
}
@ -253,14 +253,14 @@ static int pose_calculate_paths_exec(bContext *C, wmOperator *op)
animviz_verify_motionpaths(op->reports, scene, ob, pchan);
}
CTX_DATA_END;
/* calculate the bones that now have motionpaths... */
// TODO: only make for the selected bones?
/* TODO: only make for the selected bones? */
ED_pose_recalculate_paths(scene, ob);
/* notifiers for updates */
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
return OPERATOR_FINISHED;
}
@ -299,9 +299,9 @@ static int pose_update_paths_exec(bContext *C, wmOperator *UNUSED(op))
if (ELEM(NULL, ob, scene))
return OPERATOR_CANCELLED;
/* calculate the bones that now have motionpaths... */
// TODO: only make for the selected bones?
/* TODO: only make for the selected bones? */
ED_pose_recalculate_paths(scene, ob);
/* notifiers for updates */

View file

@ -1753,18 +1753,18 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
#endif
arc->angle = avg_angle;
if (avg_angle > threshold)
merging = 1;
if (merging) {
ReebNode *terminalNode = NULL;
ReebNode *middleNode = NULL;
ReebNode *newNode = NULL;
ReebNode *removedNode = NULL;
int merging = 0;
// Assign terminal and middle nodes
/* Assign terminal and middle nodes */
if (arc->head->degree == 1) {
terminalNode = arc->head;
middleNode = arc->tail;
@ -1773,31 +1773,31 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
terminalNode = arc->tail;
middleNode = arc->head;
}
// If middle node is a normal node, merge to terminal node
/* If middle node is a normal node, merge to terminal node */
if (middleNode->degree == 2) {
merging = 1;
newNode = terminalNode;
removedNode = middleNode;
}
// Otherwise, just plain remove of the arc
/* Otherwise, just plain remove of the arc */
else {
merging = 0;
newNode = middleNode;
removedNode = terminalNode;
}
// Merging arc
/* Merging arc */
if (merging) {
filterArc(rg, newNode, removedNode, arc, 1);
}
else {
// removing arc, so we need to decrease the degree of the remaining node
//newNode->degree--;
/* removing arc, so we need to decrease the degree of the remaining node
*newNode->degree--; */
NodeDegreeDecrement(rg, newNode);
}
// Reset nextArc, it might have changed
/* Reset nextArc, it might have changed */
nextArc = arc->next;
BLI_remlink(&rg->arcs, arc);

View file

@ -215,16 +215,16 @@ static void update_string(Curve *cu)
EditFont *ef = cu->editfont;
int len;
// Free the old curve string
/* Free the old curve string */
MEM_freeN(cu->str);
// Calculate the actual string length in UTF-8 variable characters
/* Calculate the actual string length in UTF-8 variable characters */
len = BLI_wstrlen_utf8(ef->textbuf);
// Alloc memory for UTF-8 variable char length string
/* Alloc memory for UTF-8 variable char length string */
cu->str = MEM_callocN(len + sizeof(wchar_t), "str");
// Copy the wchar to UTF-8
/* Copy the wchar to UTF-8 */
BLI_strncpy_wchar_as_utf8(cu->str, ef->textbuf, len + 1);
}
@ -362,8 +362,8 @@ static int paste_file(bContext *C, ReportList *reports, const char *filename)
strp = MEM_callocN(filelen + 4, "tempstr");
// fread() instead of read(), because windows read() converts text
// to DOS \r\n linebreaks, causing double linebreaks in the 3d text
/* fread() instead of read(), because windows read() converts text
* to DOS \r\n linebreaks, causing double linebreaks in the 3d text */
filelen = fread(strp, 1, filelen, fp);
fclose(fp);
strp[filelen] = 0;
@ -1452,12 +1452,12 @@ void make_editText(Object *obedit)
ef->oldstrinfo = MEM_callocN((MAXTEXT + 4) * sizeof(CharInfo), "oldstrbuf");
}
// Convert the original text to wchar_t
/* Convert the original text to wchar_t */
BLI_strncpy_wchar_from_utf8(ef->textbuf, cu->str, MAXTEXT + 4); /* length is bogus */
wcscpy(ef->oldstr, ef->textbuf);
cu->len = wcslen(ef->textbuf);
memcpy(ef->textbufinfo, cu->strinfo, (cu->len) * sizeof(CharInfo));
memcpy(ef->oldstrinfo, cu->strinfo, (cu->len) * sizeof(CharInfo));
@ -1467,8 +1467,8 @@ void make_editText(Object *obedit)
cu->curinfo = ef->textbufinfo[cu->pos - 1];
else
cu->curinfo = ef->textbufinfo[0];
// Convert to UTF-8
/* Convert to UTF-8 */
update_string(cu);
}

View file

@ -1727,17 +1727,17 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, wmEvent *event)
tGPsdata *p = op->customdata;
int estate = OPERATOR_PASS_THROUGH; /* default exit state - not handled, so let others have a share of the pie */
// if (event->type == NDOF_MOTION)
// return OPERATOR_PASS_THROUGH;
// -------------------------------
// [mce] Not quite what I was looking
// for, but a good start! GP continues to
// draw on the screen while the 3D mouse
// moves the viewpoint. Problem is that
// the stroke is converted to 3D only after
// it is finished. This approach should work
// better in tools that immediately apply
// in 3D space.
/* if (event->type == NDOF_MOTION)
* return OPERATOR_PASS_THROUGH;
* -------------------------------
* [mce] Not quite what I was looking
* for, but a good start! GP continues to
* draw on the screen while the 3D mouse
* moves the viewpoint. Problem is that
* the stroke is converted to 3D only after
* it is finished. This approach should work
* better in tools that immediately apply
* in 3D space. */
//printf("\tGP - handle modal event...\n");

View file

@ -160,9 +160,9 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
if (driver) {
/* set type of driver */
driver->type = DRIVER_TYPE_PYTHON;
/* set the expression */
// TODO: need some way of identifying variables used
/* TODO: need some way of identifying variables used */
BLI_strncpy_utf8(driver->expression, str, sizeof(driver->expression));
/* updates */
@ -187,12 +187,12 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
if (fcu && !driven) {
id = but->rnapoin.id.data;
// TODO: this should probably respect the keyingset only option for anim
/* TODO: this should probably respect the keyingset only option for anim */
if (autokeyframe_cfra_can_key(scene, id)) {
ReportList *reports = CTX_wm_reports(C);
short flag = ANIM_get_keyframing_flags(scene, 1);
fcu->flag &= ~FCURVE_SELECTED;
insert_keyframe(reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);

View file

@ -537,27 +537,27 @@ static void ui_draw_but_CHARTAB(uiBut *but)
glColor3ub(0, 0, 0);
for (y = 0; y < 6; y++) {
// Do not draw more than the category allows
/* Do not draw more than the category allows */
if (cs > charmax) break;
for (x = 0; x < 12; x++)
{
// Do not draw more than the category allows
/* Do not draw more than the category allows */
if (cs > charmax) break;
// Draw one grid cell
/* Draw one grid cell */
glBegin(GL_LINE_LOOP);
glVertex2f(sx, sy);
glVertex2f(ex, sy);
glVertex2f(ex, ey);
glVertex2f(sx, ey);
glEnd();
glEnd();
// Draw character inside the cell
/* Draw character inside the cell */
memset(wstr, 0, sizeof(wchar_t) * 2);
memset(ustr, 0, 16);
// Set the font to be either unicode or FO_BUILTIN_NAME
/* Set the font to be either unicode or FO_BUILTIN_NAME */
wstr[0] = cs;
if (strcmp(G.selfont->name, FO_BUILTIN_NAME)) {
BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr));
@ -580,17 +580,17 @@ static void ui_draw_but_CHARTAB(uiBut *but)
float dx, dy;
float px, py;
// Calculate the position
/* Calculate the position */
wid = FTF_GetStringWidth((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
FTF_GetBoundingBox((char *) ustr, &llx, &lly, &llz, &urx, &ury, &urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
dx = urx - llx;
dy = ury - lly;
// This isn't fully functional since the but->aspect isn't working like I suspected
/* This isn't fully functional since the but->aspect isn't working like I suspected */
px = sx + ((butw / but->aspect) - dx) / 2;
py = sy + ((buth / but->aspect) - dy) / 2;
// Set the position and draw the character
/* Set the position and draw the character */
ui_rasterpos_safe(px, py, but->aspect);
FTF_DrawString((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
}
@ -598,8 +598,8 @@ static void ui_draw_but_CHARTAB(uiBut *but)
ui_rasterpos_safe(sx + butw / 2, sy + buth / 2, but->aspect);
UI_DrawString(but->font, (char *) ustr, 0);
}
// Calculate the next position and character
/* Calculate the next position and character */
sx += butw; ex += butw;
cs++;
}
@ -1571,9 +1571,9 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wc
if (tmpibuf->rect_float)
IMB_rect_from_float(tmpibuf);
// XXX: for debug only
// tmpibuf->ftype = PNG;
// IMB_saveiff(tmpibuf, "sample.png", IB_rect);
/* XXX: for debug only
* tmpibuf->ftype = PNG;
* IMB_saveiff(tmpibuf, "sample.png", IB_rect); */
if (tmpibuf->rect)
scopes->track_preview = tmpibuf;

View file

@ -3478,13 +3478,13 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
else if (event->type == WHEELDOWNMOUSE) {
float *hsv = ui_block_hsv_get(but->block);
hsv[2] = CLAMPIS(hsv[2] - 0.05f, 0.0f, 1.0f);
ui_set_but_hsv(but); // converts to rgb
ui_set_but_hsv(but); /* converts to rgb */
ui_numedit_apply(C, block, but, data);
}
else if (event->type == WHEELUPMOUSE) {
float *hsv = ui_block_hsv_get(but->block);
hsv[2] = CLAMPIS(hsv[2] + 0.05f, 0.0f, 1.0f);
ui_set_but_hsv(but); // converts to rgb
ui_set_but_hsv(but); /* converts to rgb */
ui_numedit_apply(C, block, but, data);
}
else if (event->type == MOUSEMOVE) {
@ -4505,7 +4505,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
}
/* Keying Sets */
// TODO: check on modifyability of Keying Set when doing this
/* TODO: check on modifyability of Keying Set when doing this */
if (is_anim) {
uiItemS(layout);
@ -4529,8 +4529,8 @@ static int ui_but_menu(bContext *C, uiBut *but)
/* Property Operators */
//Copy Property Value
//Paste Property Value
/*Copy Property Value
*Paste Property Value */
if (length) {
uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset All to Default Values"),

View file

@ -1454,21 +1454,21 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
/* when you are outside parent button, safety there should be smaller */
// parent button to left
/* parent button to left */
if (midx < block->minx) block->safety.xmin = block->minx - 3;
else block->safety.xmin = block->minx - 40;
// parent button to right
/* parent button to right */
if (midx > block->maxx) block->safety.xmax = block->maxx + 3;
else block->safety.xmax = block->maxx + 40;
// parent button on bottom
/* parent button on bottom */
if (midy < block->miny) block->safety.ymin = block->miny - 3;
else block->safety.ymin = block->miny - 40;
// parent button on top
/* parent button on top */
if (midy > block->maxy) block->safety.ymax = block->maxy + 3;
else block->safety.ymax = block->maxy + 40;
// exception for switched pulldowns...
/* exception for switched pulldowns... */
if (dir1 && (dir1 & block->direction) == 0) {
if (dir2 == UI_RIGHT) block->safety.xmax = block->maxx + 3;
if (dir2 == UI_LEFT) block->safety.xmin = block->minx - 3;
@ -1862,7 +1862,7 @@ static void ui_update_block_buts_rgb(uiBlock *block, const float rgb[3])
*/
rgb_to_hsv_compat_v(rgb, hsv);
// this updates button strings, is hackish... but button pointers are on stack of caller function
/* this updates button strings, is hackish... but button pointers are on stack of caller function */
for (bt = block->buttons.first; bt; bt = bt->next) {
if (bt->rnaprop) {
@ -2130,8 +2130,8 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper
bt = uiDefButR_prop(block, NUMSLI, 0, IFACE_("B "), 0, -100, butwidth, UI_UNIT_Y, ptr, prop, 2, 0.0, 0.0, 0, 3, TIP_("Blue"));
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
// could use uiItemFullR(col, ptr, prop, -1, 0, UI_ITEM_R_EXPAND|UI_ITEM_R_SLIDER, "", ICON_NONE);
// but need to use uiButSetFunc for updating other fake buttons
/* could use uiItemFullR(col, ptr, prop, -1, 0, UI_ITEM_R_EXPAND|UI_ITEM_R_SLIDER, "", ICON_NONE);
* but need to use uiButSetFunc for updating other fake buttons */
/* HSV values */
uiBlockBeginAlign(block);

View file

@ -374,7 +374,7 @@ void uiStyleInit(void)
ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT);
}
// XXX, this should be moved into a style, but for now best only load the monospaced font once.
/* XXX, this should be moved into a style, but for now best only load the monospaced font once. */
if (blf_mono_font == -1)
blf_mono_font = BLF_load_mem_unique("monospace", (unsigned char *)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);

View file

@ -587,7 +587,7 @@ void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, co
uiItemL(row, "ID-Block:", ICON_NONE);
/* ID-Type Selector - just have a menu of icons */
// FIXME: the icon-only setting doesn't work when we supply a blank name
/* FIXME: the icon-only setting doesn't work when we supply a blank name */
uiItemFullR(row, ptr, propType, 0, 0, UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
/* ID-Block Selector - just use pointer widget... */
@ -622,7 +622,7 @@ void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propna
/* Path (existing string) Widget */
uiItemR(row, ptr, propname, 0, text, ICON_RNA);
// TODO: attach something to this to make allow searching of nested properties to 'build' the path
/* TODO: attach something to this to make allow searching of nested properties to 'build' the path */
}
/************************ Modifier Template *************************/
@ -741,7 +741,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_EXPAND);
block = uiLayoutGetBlock(row);
/* VIRTUAL MODIFIER */
// XXX this is not used now, since these cannot be accessed via RNA
/* XXX this is not used now, since these cannot be accessed via RNA */
BLI_snprintf(str, sizeof(str), "%s parent deform", md->name);
uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name");
@ -821,7 +821,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
uiBlockEndAlign(block);
uiBlockSetEmboss(block, UI_EMBOSSN);
// When Modifier is a simulation, show button to switch to context rather than the delete button.
/* When Modifier is a simulation, show button to switch to context rather than the delete button. */
if (modifier_can_delete(md) && !modifier_is_simulation(md))
uiItemO(row, "", ICON_X, "OBJECT_OT_modifier_remove");
if (modifier_is_simulation(md) == 1)
@ -908,7 +908,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
/* find modifier and draw it */
cageIndex = modifiers_getCageIndex(scene, ob, &lastCageIndex, 0);
// XXX virtual modifiers are not accesible for python
/* XXX virtual modifiers are not accesible for python */
vmd = modifiers_getVirtualModifierList(ob);
for (i = 0; vmd; i++, vmd = vmd->next) {
@ -945,20 +945,20 @@ static void do_constraint_panels(bContext *C, void *ob_pt, int event)
switch (event) {
case B_CONSTRAINT_TEST:
break; // no handling
break; /* no handling */
case B_CONSTRAINT_CHANGETARGET:
if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
if (ob->pose) ob->pose->flag |= POSE_RECALC; /* checks & sorts pose channels */
DAG_scene_sort(bmain, scene);
break;
default:
break;
}
// note: RNA updates now call this, commenting else it gets called twice.
// if there are problems because of this, then rna needs changed update functions.
//
// object_test_constraints(ob);
// if (ob->pose) BKE_pose_update_constraint_flags(ob->pose);
/* note: RNA updates now call this, commenting else it gets called twice.
* if there are problems because of this, then rna needs changed update functions.
*
* object_test_constraints(ob);
* if (ob->pose) BKE_pose_update_constraint_flags(ob->pose); */
if (ob->type == OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
@ -1984,14 +1984,14 @@ static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
RNA_property_boolean_set_index(&but->rnapoin, but->rnaprop, i, FALSE);
}
}
/* view3d layer change should update depsgraph (invisible object changed maybe) */
/* see view3d_header.c */
}
// TODO:
// - for now, grouping of layers is determined by dividing up the length of
// the array of layer bitflags
/* TODO:
* - for now, grouping of layers is determined by dividing up the length of
* the array of layer bitflags */
void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
PointerRNA *used_ptr, const char *used_propname, int active_layer)

View file

@ -1952,8 +1952,8 @@ void ui_draw_gradient(rcti *rect, const float hsv[3], const int type, const floa
int a;
float h = hsv[0], s = hsv[1], v = hsv[2];
float dx, dy, sx1, sx2, sy;
float col0[4][3]; // left half, rect bottom to top
float col1[4][3]; // right half, rect bottom to top
float col0[4][3]; /* left half, rect bottom to top */
float col1[4][3]; /* right half, rect bottom to top */
/* draw series of gouraud rects */
glShadeModel(GL_SMOOTH);
@ -2542,12 +2542,12 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
round_box_edges(&wtb, roundboxalign, rect, 5.0f);
ui_get_but_vectorf(but, col);
if (state & (UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN | UI_BUT_REDALERT)) {
// draw based on state - color for keyed etc
/* draw based on state - color for keyed etc */
widgetbase_draw(&wtb, wcol);
// inset to draw swatch color
/* inset to draw swatch color */
rect->xmin += SWATCH_KEYED_BORDER;
rect->xmax -= SWATCH_KEYED_BORDER;
rect->ymin += SWATCH_KEYED_BORDER;

View file

@ -1295,8 +1295,8 @@ void init_userdef_do_versions(void)
/* transform widget settings */
if (U.tw_hotspot == 0) {
U.tw_hotspot = 14;
U.tw_size = 20; // percentage of window size
U.tw_handlesize = 16; // percentage of widget radius
U.tw_size = 20; /* percentage of window size */
U.tw_handlesize = 16; /* percentage of widget radius */
}
if (U.pad_rot_angle == 0)
U.pad_rot_angle = 15;

View file

@ -1266,7 +1266,7 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_
}
/* check if mouse is in or past either handle */
// TODO: check if these extents are still valid or not
/* TODO: check if these extents are still valid or not */
in_max = ( (mouse >= (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse <= (sh_max + V2D_SCROLLER_HANDLE_SIZE)) );
in_min = ( (mouse <= (sh_min + V2D_SCROLLER_HANDLE_SIZE)) && (mouse >= (sh_min - V2D_SCROLLER_HANDLE_SIZE)) );
in_bar = ( (mouse < (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse > (sh_min + V2D_SCROLLER_HANDLE_SIZE)) );

View file

@ -329,7 +329,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
if (me == NULL || me->totpoly == 0) return;
if (mode == 0 || mode == 1) {
// XXX - Causes glitches, not sure why
/* XXX - Causes glitches, not sure why */
#if 0
if (!facesel_face_pick(C, me, mval, &index, 1))
return;

View file

@ -55,7 +55,7 @@ typedef struct BMBVHTree {
BMesh *bm;
BVHTree *tree;
float epsilon;
float maxdist; //for nearest point search
float maxdist; /* for nearest point search */
float uv[2];
/* stuff for topological vert search */

View file

@ -1498,25 +1498,25 @@ int mouse_mesh(bContext *C, const int mval[2], short extend, short deselect, sho
BMVert *eve = NULL;
BMEdge *eed = NULL;
BMFace *efa = NULL;
/* setup view context for argument to callbacks */
em_setup_viewcontext(C, &vc);
vc.mval[0] = mval[0];
vc.mval[1] = mval[1];
if (unified_findnearest(&vc, &eve, &eed, &efa)) {
// Deselect everything
/* Deselect everything */
if (extend == 0 && deselect == 0 && toggle == 0)
EDBM_flag_disable_all(vc.em, BM_ELEM_SELECT);
if (efa) {
if (extend) {
// set the last selected face
/* set the last selected face */
BM_active_face_set(vc.em->bm, efa);
// Work-around: deselect first, so we can guarantee it will
// be active even if it was already selected
/* Work-around: deselect first, so we can guarantee it will */
/* be active even if it was already selected */
BM_select_history_remove(vc.em->bm, efa);
BM_face_select_set(vc.em->bm, efa, FALSE);
BM_select_history_store(vc.em->bm, efa);
@ -1527,9 +1527,9 @@ int mouse_mesh(bContext *C, const int mval[2], short extend, short deselect, sho
BM_face_select_set(vc.em->bm, efa, FALSE);
}
else {
// set the last selected face
/* set the last selected face */
BM_active_face_set(vc.em->bm, efa);
if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
BM_select_history_store(vc.em->bm, efa);
BM_face_select_set(vc.em->bm, efa, TRUE);
@ -1542,8 +1542,8 @@ int mouse_mesh(bContext *C, const int mval[2], short extend, short deselect, sho
}
else if (eed) {
if (extend) {
// Work-around: deselect first, so we can guarantee it will
// be active even if it was already selected
/* Work-around: deselect first, so we can guarantee it will */
/* be active even if it was already selected */
BM_select_history_remove(vc.em->bm, eed);
BM_edge_select_set(vc.em->bm, eed, FALSE);
BM_select_history_store(vc.em->bm, eed);
@ -1566,8 +1566,8 @@ int mouse_mesh(bContext *C, const int mval[2], short extend, short deselect, sho
}
else if (eve) {
if (extend) {
// Work-around: deselect first, so we can guarantee it will
// be active even if it was already selected
/* Work-around: deselect first, so we can guarantee it will */
/* be active even if it was already selected */
BM_select_history_remove(vc.em->bm, eve);
BM_vert_select_set(vc.em->bm, eve, FALSE);
BM_select_history_store(vc.em->bm, eve);
@ -1588,9 +1588,9 @@ int mouse_mesh(bContext *C, const int mval[2], short extend, short deselect, sho
}
}
}
EDBM_selectmode_flush(vc.em);
/* change active material on object */
if (efa && efa->mat_nr != vc.obedit->actcol - 1) {
vc.obedit->actcol = efa->mat_nr + 1;

View file

@ -443,7 +443,7 @@ static int edbm_extrude_mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
nr = 3; // pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4");
else if (em->bm->totfacesel == 1)
nr = 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4");
else
else
nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3|Only Vertices%x4");
}
else if (em->selectmode & SCE_SELECT_EDGE) {

View file

@ -558,8 +558,8 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
float mat[4][4];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
object_add_generic_invoke_options(C, op); /* XXX these props don't get set right when only exec() is called */
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
@ -629,7 +629,7 @@ static int object_add_text_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
object_add_generic_invoke_options(C, op); /* XXX these props don't get set right when only exec() is called */
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
@ -669,18 +669,18 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
object_add_generic_invoke_options(C, op); /* XXX these props don't get set right when only exec() is called */
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
if ((obedit == NULL) || (obedit->type != OB_ARMATURE)) {
obedit = ED_object_add_type(C, OB_ARMATURE, loc, rot, TRUE, layer);
ED_object_enter_editmode(C, 0);
newob = 1;
}
else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
if (obedit == NULL) {
BKE_report(op->reports, RPT_ERROR, "Cannot create editmode armature");
return OPERATOR_CANCELLED;

View file

@ -462,7 +462,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
if (type == CONSTRAINT_OBTYPE_BONE) {
if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), ct->subtarget)) {
/* bone must exist in armature... */
// TODO: clear subtarget?
/* TODO: clear subtarget? */
curcon->flag |= CONSTRAINT_DISABLE;
}
else if (strcmp(pchan->name, ct->subtarget) == 0) {
@ -1518,16 +1518,16 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
/* do type-specific tweaking to the constraint settings */
switch (type) {
case CONSTRAINT_TYPE_PYTHON: // FIXME: this code is not really valid anymore
case CONSTRAINT_TYPE_PYTHON: /* FIXME: this code is not really valid anymore */
{
#ifdef WITH_PYTHON
char *menustr;
int scriptint = 0;
/* popup a list of usable scripts */
menustr = buildmenu_pyconstraints(NULL, &scriptint);
// XXX scriptint = pupmenu(menustr);
/* XXX scriptint = pupmenu(menustr); */
MEM_freeN(menustr);
/* only add constraint if a script was chosen */
if (scriptint) {
/* add constraint */

View file

@ -408,12 +408,12 @@ void ED_object_enter_editmode(bContext *C, int flag)
ScrArea *sa = CTX_wm_area(C);
View3D *v3d = NULL;
int ok = 0;
if (scene->id.lib) return;
if (sa && sa->spacetype == SPACE_VIEW3D)
v3d = sa->spacedata.first;
if ((flag & EM_IGNORE_LAYER) == 0) {
base = CTX_data_active_base(C); /* active layer checked here for view3d */
@ -428,12 +428,12 @@ void ED_object_enter_editmode(bContext *C, int flag)
if (ELEM3(NULL, base, base->object, base->object->data)) return;
ob = base->object;
if (BKE_object_obdata_is_libdata(ob)) {
error_libdata();
return;
}
if (flag & EM_WAITCURSOR) waitcursor(1);
ob->restore_mode = ob->mode;
@ -444,7 +444,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
ED_object_toggle_modes(C, ob->mode);
ob->mode = OB_MODE_EDIT;
if (ob->type == OB_MESH) {
BMEditMesh *em;
ok = 1;
@ -457,7 +457,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
/* order doesn't matter */
EDBM_mesh_normals_update(em);
BMEdit_RecalcTessellation(em);
BM_mesh_select_mode_flush(em->bm);
}
@ -482,48 +482,48 @@ void ED_object_enter_editmode(bContext *C, int flag)
scene->obedit = ob;
ED_armature_to_edit(ob);
/* to ensure all goes in restposition and without striding */
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); // XXX: should this be OB_RECALC_DATA?
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); /* XXX: should this be OB_RECALC_DATA? */
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_EDITMODE_ARMATURE, scene);
}
else if (ob->type == OB_FONT) {
scene->obedit = ob; // XXX for context
scene->obedit = ob; /* XXX for context */
ok = 1;
make_editText(ob);
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_EDITMODE_TEXT, scene);
}
else if (ob->type == OB_MBALL) {
scene->obedit = ob; // XXX for context
scene->obedit = ob; /* XXX for context */
ok = 1;
make_editMball(ob);
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_EDITMODE_MBALL, scene);
}
else if (ob->type == OB_LATTICE) {
scene->obedit = ob; // XXX for context
scene->obedit = ob; /* XXX for context */
ok = 1;
make_editLatt(ob);
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_EDITMODE_LATTICE, scene);
}
else if (ob->type == OB_SURF || ob->type == OB_CURVE) {
ok = 1;
scene->obedit = ob; // XXX for context
scene->obedit = ob; /* XXX for context */
make_editNurb(ob);
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_EDITMODE_CURVE, scene);
}
if (ok) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
scene->obedit = NULL; // XXX for context
scene->obedit = NULL; /* XXX for context */
ob->mode &= ~OB_MODE_EDIT;
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_OBJECT, scene);
}
if (flag & EM_DO_UNDO) ED_undo_push(C, "Enter Editmode");
if (flag & EM_WAITCURSOR) waitcursor(0);
}

View file

@ -397,7 +397,7 @@ static void object_hook_select(Object *ob, HookModifierData *hmd)
}
/* special poll operators for hook operators */
// TODO: check for properties window modifier context too as alternative?
/* TODO: check for properties window modifier context too as alternative? */
static int hook_op_edit_poll(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);

View file

@ -119,7 +119,7 @@ static void object_clear_rot(Object *ob)
if ((ob->protectflag & OB_LOCK_ROTZ) == 0)
ob->quat[3] = ob->dquat[3] = 0.0f;
// TODO: does this quat need normalizing now?
/* TODO: does this quat need normalizing now? */
}
else {
/* the flag may have been set for the other modes, so just ignore the extra flag... */
@ -133,7 +133,7 @@ static void object_clear_rot(Object *ob)
}
else {
/* perform clamping using euler form (3-components) */
// FIXME: deltas are not handled for these cases yet...
/* FIXME: deltas are not handled for these cases yet... */
float eul[3], oldeul[3], quat1[4] = {0};
if (ob->rotmode == ROT_MODE_QUAT) {

View file

@ -1007,7 +1007,7 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
}
}
bestIndex = -1;
// find the best change with an acceptable horizontal change
/* find the best change with an acceptable horizontal change */
for (i = 0; i < totweight; i++) {
if (fabs(changes[i][0]) > fabs(changes[i][1] * 2.0f)) {
bestIndex = i;
@ -1016,8 +1016,8 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
}
if (bestIndex != -1) {
wasChange = TRUE;
// it is a good place to stop if it tries to move the opposite direction
// (relative to the plane) of last time
/* it is a good place to stop if it tries to move the opposite direction
* (relative to the plane) of last time */
if (lastIndex != -1) {
if (wasUp != upDown[bestIndex]) {
wasChange = FALSE;

View file

@ -203,7 +203,7 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char
elbeemSimplifyChannelFloat(channel, &channelSize);
}
else {
// invalid, cant happen?
/* invalid, cant happen? */
}
fprintf(file, " CHANNEL %s =\n", str);
@ -651,16 +651,16 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
FluidsimSettings *domainSettings= fluidmd->fss;
FILE *fileCfg;
int dirExist = 0;
char newSurfdataPath[FILE_MAX]; // modified output settings
char newSurfdataPath[FILE_MAX]; /* modified output settings */
const char *suffixConfigTmp = FLUID_SUFFIX_CONFIG_TMP;
int outStringsChanged = 0;
// prepare names...
/* prepare names... */
const char *relbase= modifier_path_relbase(fsDomain);
BLI_strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR);
BLI_strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR); /* if 0'd out below, this value is never used! */
BLI_path_abs(targetDir, relbase); // fixed #frame-no
BLI_path_abs(targetDir, relbase); /* fixed #frame-no */
/* .tmp: don't overwrite/delete original file */
BLI_join_dirfile(targetFile, FILE_MAX, targetDir, suffixConfigTmp);

View file

@ -294,7 +294,7 @@ static int project_brush_radius(ViewContext *vc,
ED_view3d_global_to_vector(vc->rv3d, location, view);
// create a vector that is not orthogonal to view
/* create a vector that is not orthogonal to view */
if (fabsf(view[0]) < 0.1f) {
nonortho[0] = view[0] + 1.0f;
@ -312,19 +312,19 @@ static int project_brush_radius(ViewContext *vc,
nonortho[2] = view[2] + 1.0f;
}
// get a vector in the plane of the view
/* get a vector in the plane of the view */
cross_v3_v3v3(ortho, nonortho, view);
normalize_v3(ortho);
// make a point on the surface of the brush tagent to the view
/* make a point on the surface of the brush tagent to the view */
mul_v3_fl(ortho, radius);
add_v3_v3v3(offset, location, ortho);
// project the center of the brush, and the tangent point to the view onto the screen
/* project the center of the brush, and the tangent point to the view onto the screen */
project_float(vc->ar, location, p1);
project_float(vc->ar, offset, p2);
// the distance between these points is the size of the projected brush in pixels
/* the distance between these points is the size of the projected brush in pixels */
return len_v2v2(p1, p2);
}

View file

@ -1455,8 +1455,8 @@ static float project_paint_uvpixel_mask(
} /* otherwise no mask normal is needed, were within the limit */
}
// This only works when the opacity dosnt change while painting, stylus pressure messes with this
// so don't use it.
/* This only works when the opacity dosnt change while painting, stylus pressure messes with this
* so don't use it. */
// if (ps->is_airbrush==0) mask *= BKE_brush_alpha_get(ps->brush);
return mask;

View file

@ -489,15 +489,15 @@ static int actkeys_copy_exec(bContext *C, wmOperator *op)
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
/* copy keyframes */
if (ELEM(ac.datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
// FIXME...
/* FIXME... */
BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil mode");
return OPERATOR_CANCELLED;
}
else if (ac.datatype == ANIMCONT_MASK) {
// FIXME...
/* FIXME... */
BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for mask mode");
return OPERATOR_CANCELLED;
}

View file

@ -116,8 +116,8 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS);
xco -= UI_UNIT_X;
// Default panels
/* Default panels */
uiBlockBeginAlign(block);

View file

@ -351,11 +351,11 @@ void filelist_filter(FileList *filelist)
{
int num_filtered = 0;
int i, j;
if (!filelist->filelist)
return;
// How many files are left after filter ?
/* How many files are left after filter ? */
for (i = 0; i < filelist->numfiles; ++i) {
struct direntry *file = &filelist->filelist[i];
if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot) ) {
@ -428,7 +428,7 @@ void folderlist_popdir(struct ListBase *folderlist, char *dir)
folder = folderlist->last;
if (folder) {
// remove the current directory
/* remove the current directory */
MEM_freeN(folder->foldername);
BLI_freelinkN(folderlist, folder);
@ -438,7 +438,7 @@ void folderlist_popdir(struct ListBase *folderlist, char *dir)
BLI_strncpy(dir, prev_dir, FILE_MAXDIR);
}
}
// delete the folder next or use setdir directly before PREVIOUS OP
/* delete the folder next or use setdir directly before PREVIOUS OP */
}
void folderlist_pushdir(ListBase *folderlist, const char *dir)
@ -446,21 +446,21 @@ void folderlist_pushdir(ListBase *folderlist, const char *dir)
struct FolderList *folder, *previous_folder;
previous_folder = folderlist->last;
// check if already exists
/* check if already exists */
if (previous_folder && previous_folder->foldername) {
if (BLI_path_cmp(previous_folder->foldername, dir) == 0) {
return;
}
}
// create next folder element
/* create next folder element */
folder = (FolderList *)MEM_mallocN(sizeof(FolderList), "FolderList");
folder->foldername = (char *)MEM_mallocN(sizeof(char) * (strlen(dir) + 1), "foldername");
folder->foldername[0] = '\0';
BLI_strncpy(folder->foldername, dir, FILE_MAXDIR);
// add it to the end of the list
/* add it to the end of the list */
BLI_addtail(folderlist, folder);
}
@ -468,16 +468,16 @@ int folderlist_clear_next(struct SpaceFile *sfile)
{
struct FolderList *folder;
// if there is no folder_next there is nothing we can clear
/* if there is no folder_next there is nothing we can clear */
if (!sfile->folders_next)
return 0;
// if previous_folder, next_folder or refresh_folder operators are executed it doesn't clear folder_next
/* if previous_folder, next_folder or refresh_folder operators are executed it doesn't clear folder_next */
folder = sfile->folders_prev->last;
if ((!folder) || (BLI_path_cmp(folder->foldername, sfile->params->dir) == 0))
return 0;
// eventually clear flist->folders_next
/* eventually clear flist->folders_next */
return 1;
}

View file

@ -179,15 +179,15 @@ void fsmenu_insert_entry(struct FSMenu *fsmenu, FSMenuCategory category, const c
}
}
else {
// if we're bookmarking this, file should come
// before the last separator, only automatically added
// current dir go after the last sep.
/* if we're bookmarking this, file should come
* before the last separator, only automatically added
* current dir go after the last sep. */
if (save) {
break;
}
}
}
fsme = MEM_mallocN(sizeof(*fsme), "fsme");
fsme->path = BLI_strdup(path);
fsme->save = save;
@ -247,7 +247,7 @@ void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename)
}
fprintf(fp, "[Recent]\n");
nskip = fsmenu_get_nentries(fsmenu, FS_CATEGORY_RECENT) - FSMENU_RECENT_MAX;
// skip first entries if list too long
/* skip first entries if list too long */
for (fsme = fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip > 0); fsme = fsme->next, --nskip) {
/* pass */
}

View file

@ -260,8 +260,8 @@ void GRAPH_OT_view_all(wmOperatorType *ot)
/* api callbacks */
ot->exec = graphkeys_viewall_exec;
ot->poll = ED_operator_graphedit_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier...
ot->poll = ED_operator_graphedit_active; /* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... */
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@ -279,7 +279,7 @@ void GRAPH_OT_view_selected(wmOperatorType *ot)
/* api callbacks */
ot->exec = graphkeys_view_selected_exec;
ot->poll = ED_operator_graphedit_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier...
ot->poll = ED_operator_graphedit_active; /* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... */
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@ -1641,7 +1641,7 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op)
int f;
/* sanity check: ensure that there are enough F-Curves to work on in this group */
// TODO: also enforce assumption that there be a full set of keyframes at each position by ensuring that totvert counts are same?
/* TODO: also enforce assumption that there be a full set of keyframes at each position by ensuring that totvert counts are same? */
if (ELEM3(NULL, euf->fcurves[0], euf->fcurves[1], euf->fcurves[2])) {
/* report which components are missing */
BKE_reportf(op->reports, RPT_WARNING,
@ -1655,9 +1655,9 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op)
failed++;
continue;
}
/* simple method: just treat any difference between keys of greater than 180 degrees as being a flip */
// FIXME: there are more complicated methods that will be needed to fix more cases than just some
/* FIXME: there are more complicated methods that will be needed to fix more cases than just some */
for (f = 0; f < 3; f++) {
FCurve *fcu = euf->fcurves[f];
BezTriple *bezt, *prev = NULL;
@ -2217,10 +2217,10 @@ static int graph_fmodifier_copy_exec(bContext *C, wmOperator *op)
/* if this exists, call the copy F-Modifiers API function */
if (ale && ale->data) {
FCurve *fcu = (FCurve *)ale->data;
// TODO: when 'active' vs 'all' boolean is added, change last param!
/* TODO: when 'active' vs 'all' boolean is added, change last param! */
ok = ANIM_fmodifiers_copy_to_buf(&fcu->modifiers, 0);
/* free temp data now */
MEM_freeN(ale);
}
@ -2272,11 +2272,11 @@ static int graph_fmodifier_paste_exec(bContext *C, wmOperator *op)
/* paste modifiers */
for (ale = anim_data.first; ale; ale = ale->next) {
FCurve *fcu = (FCurve *)ale->data;
// TODO: do we want to replace existing modifiers? add user pref for that!
/* TODO: do we want to replace existing modifiers? add user pref for that! */
ok += ANIM_fmodifiers_paste_from_buf(&fcu->modifiers, 0);
}
/* clean up */
BLI_freelistN(&anim_data);

View file

@ -961,9 +961,9 @@ static void nearest_fcurve_vert_store(ListBase *matches, View2D *v2d, FCurve *fc
}
}
else if (fpt) {
// TODO...
/* TODO... */
}
}
}
/* helper for find_nearest_fcurve_vert() - build the list of nearest matches */
static void get_nearest_fcurve_verts_list(bAnimContext *ac, const int mval[2], ListBase *matches)

View file

@ -1660,7 +1660,7 @@ static int image_invert_exec(bContext *C, wmOperator *op)
int i;
if (ibuf == NULL) // TODO: this should actually never happen, but does for render-results -> cleanup
if (ibuf == NULL) /* TODO: this should actually never happen, but does for render-results -> cleanup */
return OPERATOR_CANCELLED;
/* TODO: make this into an IMB_invert_channels(ibuf,r,g,b,a) method!? */

View file

@ -140,9 +140,9 @@ static int mouse_nla_channels(bAnimContext *ac, float x, int channel_index, shor
}
else {
Base *b;
/* deselect all */
// TODO: should this deselect all other types of channels too?
/* TODO: should this deselect all other types of channels too? */
for (b = sce->base.first; b; b = b->next) {
b->flag &= ~SELECT;
b->object->flag = b->flag;
@ -268,8 +268,8 @@ static int mouse_nla_channels(bAnimContext *ac, float x, int channel_index, shor
if (x >= (v2d->cur.xmax - NLACHANNEL_BUTTON_WIDTH)) {
if (nlaedit_is_tweakmode_on(ac) == 0) {
/* 'push-down' action - only usable when not in TweakMode */
// TODO: make this use the operator instead of calling the function directly
// however, calling the operator requires that we supply the args, and that works with proper buttons only
/* TODO: make this use the operator instead of calling the function directly
* however, calling the operator requires that we supply the args, and that works with proper buttons only */
BKE_nla_action_pushdown(adt);
}
else {

View file

@ -63,9 +63,9 @@
/* ************************************ Motion Paths ************************************* */
// TODO:
// - options to draw paths with lines
// - include support for editing the path verts
/* TODO:
* - options to draw paths with lines
* - include support for editing the path verts */
/* Set up drawing environment for drawing motion paths */
void draw_motion_paths_init(View3D *v3d, ARegion *ar)

View file

@ -2118,7 +2118,7 @@ static void drawSelectedVertices__mapFunc(void *userData, int index, const float
if (!(mv->flag & ME_HIDE)) {
const char sel = mv->flag & SELECT;
// TODO define selected color
/* TODO define selected color */
if (sel) {
glColor3f(1.0f, 1.0f, 0.0f);
}

View file

@ -129,9 +129,9 @@ struct anim {
float frs_sec_base;
int x, y;
/* voor op nummer */
/* for number */
char name[1024];
/* voor sequence */
/* for sequence */
char first[1024];
/* movie */

View file

@ -4267,7 +4267,7 @@ static int foreach_parse_args(BPy_PropertyRNA *self, PyObject *args,
return -1;
}
*tot = PySequence_Size(*seq); // TODO - buffer may not be a sequence! array.array() is tho.
*tot = PySequence_Size(*seq); /* TODO - buffer may not be a sequence! array.array() is tho. */
if (*tot > 0) {
foreach_attr_type(self, *attr, raw_type, attr_tot, attr_signed);

View file

@ -2282,7 +2282,7 @@ static struct PyMethodDef Matrix_methods[] = {
{"invert", (PyCFunction) Matrix_invert, METH_NOARGS, Matrix_invert_doc},
{"inverted", (PyCFunction) Matrix_inverted, METH_NOARGS, Matrix_inverted_doc},
{"to_3x3", (PyCFunction) Matrix_to_3x3, METH_NOARGS, Matrix_to_3x3_doc},
// TODO. {"resize_3x3", (PyCFunction) Matrix_resize3x3, METH_NOARGS, Matrix_resize3x3_doc},
/* TODO. {"resize_3x3", (PyCFunction) Matrix_resize3x3, METH_NOARGS, Matrix_resize3x3_doc}, */
{"to_4x4", (PyCFunction) Matrix_to_4x4, METH_NOARGS, Matrix_to_4x4_doc},
{"resize_4x4", (PyCFunction) Matrix_resize_4x4, METH_NOARGS, Matrix_resize_4x4_doc},
{"rotate", (PyCFunction) Matrix_rotate, METH_O, Matrix_rotate_doc},

View file

@ -175,8 +175,8 @@ static void occ_shade(ShadeSample *ssamp, ObjectInstanceRen *obi, VlakRen *vlr,
/* cache for shadow */
shi->samplenr++;
shi->xs= 0; // TODO
shi->xs= 0; /* TODO */
shi->ys= 0;
shade_input_set_normals(shi);

View file

@ -174,7 +174,7 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b
DirectionToThetaPhi(sunsky->toSun, &sunsky->theta, &sunsky->phi);
sunsky->sunSolidAngle = 0.25 * M_PI * 1.39 * 1.39 / (150 * 150); // = 6.7443e-05
sunsky->sunSolidAngle = 0.25 * M_PI * 1.39 * 1.39 / (150 * 150); /* = 6.7443e-05 */
theta2 = sunsky->theta * sunsky->theta;
theta3 = theta2 * sunsky->theta;
@ -183,7 +183,7 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b
chi = (4.0f / 9.0f - T / 120.0f) * ((float)M_PI - 2.0f * sunsky->theta);
sunsky->zenith_Y = (4.0453f * T - 4.9710f) * tanf(chi) - 0.2155f * T + 2.4192f;
sunsky->zenith_Y *= 1000; // conversion from kcd/m^2 to cd/m^2
sunsky->zenith_Y *= 1000; /* conversion from kcd/m^2 to cd/m^2 */
if (sunsky->zenith_Y <= 0)
sunsky->zenith_Y = 1e-6;
@ -340,13 +340,13 @@ static void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3])
m = 1.0f / (cosf(theta) + 0.15f * powf(93.885f - theta / (float)M_PI * 180.0f, -1.253f));
for (i = 0; i < 3; i++) {
// Rayleigh Scattering
/* Rayleigh Scattering */
fTauR = expf(-m * 0.008735f * powf(fLambda[i], (float)(-4.08f)));
// Aerosal (water + dust) attenuation
/* Aerosal (water + dust) attenuation */
fTauA = exp(-m * fBeta * powf(fLambda[i], -fAlpha));
fTau[i] = fTauR * fTauA;
fTau[i] = fTauR * fTauA;
}
}
@ -457,23 +457,23 @@ void AtmospherePixleShader(struct SunSky *sunSky, float view[3], float s, float
sunDirection[0] = sunSky->toSun[0];
sunDirection[1] = sunSky->toSun[1];
sunDirection[2] = sunSky->toSun[2];
costheta = dot_v3v3(view, sunDirection); // cos(theta)
Phase_1 = 1 + (costheta * costheta); // Phase_1
costheta = dot_v3v3(view, sunDirection); /* cos(theta) */
Phase_1 = 1 + (costheta * costheta); /* Phase_1 */
VEC3OPF(sunSky->atm_BetaRay, sunSky->atm_BetaRay, *, sunSky->atm_BetaRayMultiplier);
VEC3OPF(sunSky->atm_BetaMie, sunSky->atm_BetaMie, *, sunSky->atm_BetaMieMultiplier);
VEC3OPV(sunSky->atm_BetaRM, sunSky->atm_BetaRay, +, sunSky->atm_BetaMie);
//e^(-(beta_1 + beta_2) * s) = E1
/* e^(-(beta_1 + beta_2) * s) = E1 */
VEC3OPF(E1, sunSky->atm_BetaRM, *, -s / (float)M_LN2);
E1[0] = exp(E1[0]);
E1[1] = exp(E1[1]);
E1[2] = exp(E1[2]);
copy_v3_v3(E, E1);
//Phase2(theta) = (1-g^2)/(1+g-2g*cos(theta))^(3/2)
/* Phase2(theta) = (1-g^2)/(1+g-2g*cos(theta))^(3/2) */
fTemp = 1 + sunSky->atm_HGg - 2 * sunSky->atm_HGg * costheta;
fTemp = fTemp * sqrtf(fTemp);
Phase_2 = (1 - sunSky->atm_HGg * sunSky->atm_HGg) / fTemp;
@ -491,8 +491,8 @@ void AtmospherePixleShader(struct SunSky *sunSky, float view[3], float s, float
VEC3OPF(I, I, *, sunSky->atm_InscatteringMultiplier);
VEC3OPF(E, E, *, sunSky->atm_ExtinctionMultiplier);
//scale to color sun
/* scale to color sun */
ComputeAttenuatedSunlight(sunSky->theta, sunSky->turbidity, sunColor);
VEC3OPV(E, E, *, sunColor);

View file

@ -81,12 +81,12 @@ int ocean_texture(Tex *tex, float *texvec, TexResult *texres)
if (omd->oceancache && omd->cached == TRUE) {
CLAMP(cfra, omd->bakestart, omd->bakeend);
cfra -= omd->bakestart; // shift to 0 based
cfra -= omd->bakestart; /* shift to 0 based */
BKE_ocean_cache_eval_uv(omd->oceancache, &ocr, cfra, u, v);
}
else { // non-cached
else { /* non-cached */
if (G.rendering)
BKE_ocean_eval_uv_catrom(omd->ocean, &ocr, u, v);

View file

@ -261,14 +261,14 @@ static void lightcache_filter2(VolumePrecache *vp)
}
#endif
BLI_INLINE int ms_I(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation
{
BLI_INLINE int ms_I(int x, int y, int z, int *n) /* has a pad of 1 voxel surrounding the core for boundary simulation */
{
/* different ordering to light cache */
return x*(n[1]+2)*(n[2]+2) + y*(n[2]+2) + z;
return x*(n[1]+2)*(n[2]+2) + y*(n[2]+2) + z;
}
BLI_INLINE int v_I_pad(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation
{
BLI_INLINE int v_I_pad(int x, int y, int z, int *n) /* has a pad of 1 voxel surrounding the core for boundary simulation */
{
/* same ordering to light cache, with padding */
return z*(n[1]+2)*(n[0]+2) + y*(n[0]+2) + x;
}
@ -526,10 +526,10 @@ static void *vol_precache_part(void *data)
/* convert from world->camera space for shading */
mul_v3_m4v3(cco, pa->viewmat, co);
i = BLI_VOXEL_INDEX(x, y, z, res);
// don't bother if the point is not inside the volume mesh
/* don't bother if the point is not inside the volume mesh */
if (!point_inside_obi(tree, obi, cco)) {
obi->volume_precache->data_r[i] = -1.0f;
obi->volume_precache->data_g[i] = -1.0f;
@ -563,7 +563,7 @@ static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Materi
shi->mask= 1;
shi->mat = ma;
shi->vlr = NULL;
memcpy(&shi->r, &shi->mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h
memcpy(&shi->r, &shi->mat->r, 23*sizeof(float)); /* note, keep this synced with render_types.h */
shi->har= shi->mat->har;
shi->obi= obi;
shi->obr= obi->obr;
@ -757,7 +757,8 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o
BLI_freelistN(&re->volume_precache_parts);
if (tree) {
//TODO: makeraytree_object creates a tree and saves it on OBI, if we free this tree we should also clear other pointers to it
/* TODO: makeraytree_object creates a tree and saves it on OBI,
* if we free this tree we should also clear other pointers to it */
//RE_rayobject_free(tree);
//tree= NULL;
}

View file

@ -253,9 +253,9 @@ static float metadensity(Object *ob, const float co[3])
/* element rotation transform */
float tp[3] = {ml->x - tco[0], ml->y - tco[1], ml->z - tco[2]};
quat_to_mat3(bmat, ml->quat);
transpose_m3(bmat); // rot.only, so inverse == transpose
transpose_m3(bmat); /* rot.only, so inverse == transpose */
mul_m3_v3(bmat, tp);
/* MB_BALL default */
switch (ml->type) {
case MB_ELIPSOID:
@ -263,14 +263,14 @@ static float metadensity(Object *ob, const float co[3])
break;
case MB_CUBE:
tp[2] = (tp[2] > ml->expz) ? (tp[2] - ml->expz) : ((tp[2] < -ml->expz) ? (tp[2] + ml->expz) : 0.f);
// no break, xy as plane
/* no break, xy as plane */
case MB_PLANE:
tp[1] = (tp[1] > ml->expy) ? (tp[1] - ml->expy) : ((tp[1] < -ml->expy) ? (tp[1] + ml->expy) : 0.f);
// no break, x as tube
/* no break, x as tube */
case MB_TUBE:
tp[0] = (tp[0] > ml->expx) ? (tp[0] - ml->expx) : ((tp[0] < -ml->expx) ? (tp[0] + ml->expx) : 0.f);
}
/* ml->rad2 is not set */
dist2 = 1.0f - (dot_v3v3(tp, tp) / (ml->rad * ml->rad));
if (dist2 > 0.f)

View file

@ -240,7 +240,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
copy_v3_v3_int(vd->resol, smd->domain->res);
totRes = vd_resol_size(vd);
// scaling heat values from -2.0-2.0 to 0.0-1.0
/* scaling heat values from -2.0-2.0 to 0.0-1.0 */
vd->dataset = MEM_mapallocN(sizeof(float) * (totRes), "smoke data");
@ -250,7 +250,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
vd->dataset[i] = (heat[i] + 2.0f) / 4.0f;
}
//vd->dataset = smoke_get_heat(smd->domain->fluid);
/* vd->dataset = smoke_get_heat(smd->domain->fluid); */
}
else if (vd->smoked_type == TEX_VD_SMOKEVEL) {
size_t totRes;
@ -260,7 +260,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
copy_v3_v3_int(vd->resol, smd->domain->res);
totRes = vd_resol_size(vd);
// scaling heat values from -2.0-2.0 to 0.0-1.0
/* scaling heat values from -2.0-2.0 to 0.0-1.0 */
vd->dataset = MEM_mapallocN(sizeof(float) * (totRes), "smoke data");
xvel = smoke_get_velocity_x(smd->domain->fluid);

View file

@ -1447,21 +1447,21 @@ void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2,
zxd= -(double)x0/(double)z0;
zyd= -(double)y0/(double)z0;
zy0= ((double)my2)*zyd + (double)xx1;
z1= 1.0f; // (u1 - u2)
z2= 0.0f; // (u2 - u3)
z1= 1.0f; /* (u1 - u2) */
z2= 0.0f; /* (u2 - u3) */
x0= y1*z2-z1*y2;
y0= z1*x2-x1*z2;
xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f;
xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f;
uxd= -(double)x0/(double)z0;
uyd= -(double)y0/(double)z0;
uy0= ((double)my2)*uyd + (double)xx1;
z1= -1.0f; // (v1 - v2)
z2= 1.0f; // (v2 - v3)
z1= -1.0f; /* (v1 - v2) */
z2= 1.0f; /* (v2 - v3) */
x0= y1*z2-z1*y2;
y0= z1*x2-x1*z2;
@ -1535,23 +1535,23 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
y1= v1[1]- v2[1];
y2= v2[1]- v3[1];
z1= 1.0f; // (u1 - u2)
z2= 0.0f; // (u2 - u3)
z1= 1.0f; /* (u1 - u2) */
z2= 0.0f; /* (u2 - u3) */
x0= y1*z2-z1*y2;
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f;
xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f;
uxd= -(double)x0/(double)z0;
uyd= -(double)y0/(double)z0;
uy0= ((double)my2)*uyd + (double)xx1;
z1= -1.0f; // (v1 - v2)
z2= 1.0f; // (v2 - v3)
z1= -1.0f; /* (v1 - v2) */
z2= 1.0f; /* (v2 - v3) */
x0= y1*z2-z1*y2;
y0= z1*x2-x1*z2;

View file

@ -315,7 +315,7 @@ static int wm_read_exotic(Scene *UNUSED(scene), const char *name)
char header[7];
int retval;
// make sure we're not trying to read a directory....
/* make sure we're not trying to read a directory.... */
len = strlen(name);
if (ELEM(name[len - 1], '/', '\\')) {

View file

@ -226,21 +226,21 @@ int WM_init_game(bContext *C)
Scene *scene = CTX_data_scene(C);
if (!scene) {
// XXX, this should not be needed.
/* XXX, this should not be needed. */
Main *bmain = CTX_data_main(C);
scene = bmain->scene.first;
}
win = wm->windows.first;
//first to get a valid window
/* first to get a valid window */
if (win)
CTX_wm_window_set(C, win);
sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_VIEW3D, 0);
ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
// if we have a valid 3D view
/* if we have a valid 3D view */
if (sa && ar) {
ARegion *arhide;

View file

@ -329,7 +329,7 @@ static void keymap_item_set_id(wmKeyMap *keymap, wmKeyMapItem *kmi)
kmi->id = keymap->kmi_id;
}
else {
kmi->id = -keymap->kmi_id; // User defined keymap entries have negative ids
kmi->id = -keymap->kmi_id; /* User defined keymap entries have negative ids */
}
}

View file

@ -331,12 +331,12 @@ unsigned int index_to_framebuffer(int index)
break;
case 24:
break;
default: // 18 bits...
default: /* 18 bits... */
i = ((i & 0x3F000) << 6) + ((i & 0xFC0) << 4) + ((i & 0x3F) << 2);
i |= 0x010101;
break;
}
return i;
}
@ -365,7 +365,7 @@ unsigned int index_to_framebuffer(int index)
break;
case 24:
break;
default: // 18 bits...
default: /* 18 bits... */
i = ((i & 0x3F000) << 6) + ((i & 0xFC0) << 4) + ((i & 0x3F) << 2);
i |= 0x030303;
break;

View file

@ -1346,7 +1346,7 @@ int main(int argc, const char **argv)
* WM_init() before #BPY_python_start() crashes Blender at startup.
*/
// TODO - U.pythondir
/* TODO - U.pythondir */
#else
printf("\n* WARNING * - Blender compiled without Python!\nthis is not intended for typical usage\n\n");
#endif