diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-07-20 08:01:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-07-20 08:01:03 +0300 |
commit | fe2f43a15c648e13fbc5fa4ba24cea41b3671427 (patch) | |
tree | b5f6ec72ba191e8b9b9ec802426e73bd247b3705 /source/blender | |
parent | 59eb71afa1d11ab0a1d5f741debc6989ec511ff9 (diff) |
Cleanup: use '#if 0' for disabling multiple lines
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/boids.c | 75 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 38 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_add.c | 6 | ||||
-rw-r--r-- | source/blender/io/collada/BCAnimationSampler.cpp | 10 | ||||
-rw-r--r-- | source/blender/io/collada/TransformReader.cpp | 8 | ||||
-rw-r--r-- | source/blender/io/collada/collada_utils.cpp | 12 | ||||
-rw-r--r-- | source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc | 25 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 11 | ||||
-rw-r--r-- | source/blender/simulation/intern/SIM_mass_spring.cpp | 36 | ||||
-rw-r--r-- | source/blender/simulation/intern/hair_volume.cpp | 35 |
10 files changed, 149 insertions, 107 deletions
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index e69173cc1d5..c57adae485f 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -823,11 +823,13 @@ static boid_rule_cb boid_rules[] = { rule_follow_leader, rule_average_speed, rule_fight, - // rule_help, - // rule_protect, - // rule_hide, - // rule_follow_path, - // rule_follow_wall, +#if 0 + rule_help, + rule_protect, + rule_hide, + rule_follow_path, + rule_follow_wall, +#endif }; static void set_boid_values(BoidValues *val, BoidSettings *boids, ParticleData *pa) @@ -1069,11 +1071,13 @@ static BoidState *get_boid_state(BoidSettings *boids, ParticleData *pa) return state; } -// static int boid_condition_is_true(BoidCondition *cond) -//{ -// /* TODO */ -// return 0; -//} + +#if 0 /* TODO */ +static int boid_condition_is_true(BoidCondition *cond) +{ + return 0; +} +#endif /* determines the velocity the boid wants to have */ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) @@ -1085,7 +1089,6 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) BoidParticle *bpa = pa->boid; ParticleSystem *psys = bbd->sim->psys; int rand; - // BoidCondition *cond; if (bpa->data.health <= 0.0f) { pa->alive = PARS_DYING; @@ -1093,15 +1096,17 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) return; } - // planned for near future - // cond = state->conditions.first; - // for (; cond; cond=cond->next) { - // if (boid_condition_is_true(cond)) { - // pa->boid->state_id = cond->state_id; - // state = get_boid_state(boids, pa); - // break; /* only first true condition is used */ - // } - //} + /* Planned for near future. */ +#if 0 + BoidCondition *cond = state->conditions.first; + for (; cond; cond = cond->next) { + if (boid_condition_is_true(cond)) { + pa->boid->state_id = cond->state_id; + state = get_boid_state(boids, pa); + break; /* only first true condition is used */ + } + } +#endif zero_v3(bbd->wanted_co); bbd->wanted_speed = 0.0f; @@ -1507,20 +1512,22 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) } case eBoidMode_Climbing: { boid_climb(boids, pa, ground_co, ground_nor); - // float nor[3]; - // copy_v3_v3(nor, ground_nor); - - ///* gather apparent gravity to r_ve */ - // madd_v3_v3fl(pa->r_ve, ground_nor, -1.0); - // normalize_v3(pa->r_ve); - - ///* raise boid it's size from surface */ - // mul_v3_fl(nor, pa->size * boids->height); - // add_v3_v3v3(pa->state.co, ground_co, nor); - - ///* remove normal component from velocity */ - // project_v3_v3v3(v, pa->state.vel, ground_nor); - // sub_v3_v3v3(pa->state.vel, pa->state.vel, v); +#if 0 + float nor[3]; + copy_v3_v3(nor, ground_nor); + + /* Gather apparent gravity to r_ve. */ + madd_v3_v3fl(pa->r_ve, ground_nor, -1.0); + normalize_v3(pa->r_ve); + + /* Raise boid it's size from surface. */ + mul_v3_fl(nor, pa->size * boids->height); + add_v3_v3v3(pa->state.co, ground_co, nor); + + /* Remove normal component from velocity. */ + project_v3_v3v3(v, pa->state.vel, ground_nor); + sub_v3_v3v3(pa->state.vel, pa->state.vel, v); +#endif break; } case eBoidMode_OnLand: { diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 8a7bc375ea9..b368650eaca 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -655,8 +655,10 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Tex *tx; ParticleSettings *part; Object *ob; - // PTCacheID *pid; - // ListBase pidlist; +#if 0 + PTCacheID *pid; + ListBase pidlist; +#endif bSound *sound; Sequence *seq; @@ -766,12 +768,15 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* set old pointcaches to have disk cache flag */ for (ob = bmain->objects.first; ob; ob = ob->id.next) { - // BKE_ptcache_ids_from_object(&pidlist, ob); +#if 0 + BKE_ptcache_ids_from_object(&pidlist, ob); - // for (pid = pidlist.first; pid; pid = pid->next) - // pid->cache->flag |= PTCACHE_DISK_CACHE; + for (pid = pidlist.first; pid; pid = pid->next) { + pid->cache->flag |= PTCACHE_DISK_CACHE; + } - // BLI_freelistN(&pidlist); + BLI_freelistN(&pidlist); +#endif } /* type was a mixed flag & enum. move the 2d flag elsewhere */ @@ -789,18 +794,23 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Tex *tex; Scene *sce; ToolSettings *ts; - // PTCacheID *pid; - // ListBase pidlist; +#if 0 + PTCacheID *pid; + ListBase pidlist; +#endif for (ob = bmain->objects.first; ob; ob = ob->id.next) { - // BKE_ptcache_ids_from_object(&pidlist, ob); +#if 0 + BKE_ptcache_ids_from_object(&pidlist, ob); - // for (pid = pidlist.first; pid; pid = pid->next) { - // if (BLI_listbase_is_empty(pid->ptcaches)) - // pid->ptcaches->first = pid->ptcaches->last = pid->cache; - //} + for (pid = pidlist.first; pid; pid = pid->next) { + if (BLI_listbase_is_empty(pid->ptcaches)) { + pid->ptcaches->first = pid->ptcaches->last = pid->cache; + } + } - // BLI_freelistN(&pidlist); + BLI_freelistN(&pidlist); +#endif if (ob->totcol && ob->matbits == NULL) { int a; diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index 880d27e1615..ad71f4d9da7 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -361,8 +361,10 @@ static bool add_vertex_extrude(const bContext *C, } } - // print_v2("", tangent_point); - // printf("%d\n", point_index); +#if 0 + print_v2("", tangent_point); + printf("%d\n", point_index); +#endif mask_spline_add_point_at_index(spline, point_index); diff --git a/source/blender/io/collada/BCAnimationSampler.cpp b/source/blender/io/collada/BCAnimationSampler.cpp index 02a4e1f3167..d2bde193c0a 100644 --- a/source/blender/io/collada/BCAnimationSampler.cpp +++ b/source/blender/io/collada/BCAnimationSampler.cpp @@ -161,10 +161,12 @@ void BCAnimationSampler::update_animation_curves(BCAnimation &animation, BCSample &BCAnimationSampler::sample_object(Object *ob, int frame_index, bool for_opensim) { BCSample &ob_sample = sample_data.add(ob, frame_index); - // if (export_settings.get_apply_global_orientation()) { - // const BCMatrix &global_transform = export_settings.get_global_transform(); - // ob_sample.get_matrix(global_transform); - //} +#if 0 + if (export_settings.get_apply_global_orientation()) { + const BCMatrix &global_transform = export_settings.get_global_transform(); + ob_sample.get_matrix(global_transform); + } +#endif if (ob->type == OB_ARMATURE) { bPoseChannel *pchan; diff --git a/source/blender/io/collada/TransformReader.cpp b/source/blender/io/collada/TransformReader.cpp index 81b0ffc340a..d23f8da2570 100644 --- a/source/blender/io/collada/TransformReader.cpp +++ b/source/blender/io/collada/TransformReader.cpp @@ -103,9 +103,11 @@ void TransformReader::dae_rotate_to_mat4(COLLADAFW::Transformation *tm, float m[ COLLADABU::Math::Vector3 &axis = ro->getRotationAxis(); const float angle = (float)DEG2RAD(ro->getRotationAngle()); const float ax[] = {(float)axis[0], (float)axis[1], (float)axis[2]}; - // float quat[4]; - // axis_angle_to_quat(quat, axis, angle); - // quat_to_mat4(m, quat); +#if 0 + float quat[4]; + axis_angle_to_quat(quat, axis, angle); + quat_to_mat4(m, quat); +#endif axis_angle_to_mat4(m, ax, angle); } diff --git a/source/blender/io/collada/collada_utils.cpp b/source/blender/io/collada/collada_utils.cpp index 9967a526971..60c4a9bad13 100644 --- a/source/blender/io/collada/collada_utils.cpp +++ b/source/blender/io/collada/collada_utils.cpp @@ -1216,8 +1216,10 @@ static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree, { bNodeSocket *to_socket = (bNodeSocket *)BLI_findlink(&to_node->inputs, to_index); - //bNodeSocket *socket = ntreeAddSocketInterfaceFromSocket(ntree, to_node, to_socket); - //return socket; +# if 0 + bNodeSocket *socket = ntreeAddSocketInterfaceFromSocket(ntree, to_node, to_socket); + return socket; +# endif bNodeSocket *gsock = ntreeAddSocketInterfaceFromSocket(ntree, to_node, to_socket); bNode *inputGroup = ntreeFindType(ntree, NODE_GROUP_INPUT); @@ -1235,8 +1237,10 @@ static bNodeSocket *bc_group_add_output_socket(bNodeTree *ntree, { bNodeSocket *from_socket = (bNodeSocket *)BLI_findlink(&from_node->outputs, from_index); - //bNodeSocket *socket = ntreeAddSocketInterfaceFromSocket(ntree, to_node, to_socket); - //return socket; +# if 0 + bNodeSocket *socket = ntreeAddSocketInterfaceFromSocket(ntree, to_node, to_socket); + return socket; +# endif bNodeSocket *gsock = ntreeAddSocketInterfaceFromSocket(ntree, from_node, from_socket); bNode *outputGroup = ntreeFindType(ntree, NODE_GROUP_OUTPUT); diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc index 3b20ac9f110..82f8444d43e 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc @@ -91,19 +91,20 @@ bool GpencilExporterPDF::write() { /* Support unicode character paths on Windows. */ HPDF_STATUS res = 0; - /* TODO: It looks libharu does not support unicode. */ - //#ifdef WIN32 - // char filename_cstr[FILE_MAX]; - // BLI_strncpy(filename_cstr, filename_, FILE_MAX); - // - // UTF16_ENCODE(filename_cstr); - // std::wstring wstr(filename_cstr_16); - // res = HPDF_SaveToFile(pdf_, wstr.c_str()); - // - // UTF16_UN_ENCODE(filename_cstr); - //#else + + /* TODO: It looks `libharu` does not support unicode. */ +#if 0 /* `ifdef WIN32` */ + char filename_cstr[FILE_MAX]; + BLI_strncpy(filename_cstr, filename_, FILE_MAX); + + UTF16_ENCODE(filename_cstr); + std::wstring wstr(filename_cstr_16); + res = HPDF_SaveToFile(pdf_, wstr.c_str()); + + UTF16_UN_ENCODE(filename_cstr); +#else res = HPDF_SaveToFile(pdf_, filename_); - //#endif +#endif return (res == 0) ? true : false; } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e6f3e509469..5b1a8f06c60 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -7424,10 +7424,13 @@ static PyObject *pyrna_srna_Subtype(StructRNA *srna) PyObject *metaclass; const char *idname = RNA_struct_identifier(srna); - /* Remove __doc__ for now. */ - // const char *descr = RNA_struct_ui_description(srna); - // if (!descr) descr = "(no docs)"; - // "__doc__", descr + /* Remove `__doc__` for now because we don't need it to generate docs. */ +#if 0 + const char *descr = RNA_struct_ui_description(srna); + if (!descr) { + descr = "(no docs)"; + } +#endif if (RNA_struct_idprops_check(srna) && !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type)) { diff --git a/source/blender/simulation/intern/SIM_mass_spring.cpp b/source/blender/simulation/intern/SIM_mass_spring.cpp index b79731ab330..f9a22276363 100644 --- a/source/blender/simulation/intern/SIM_mass_spring.cpp +++ b/source/blender/simulation/intern/SIM_mass_spring.cpp @@ -1052,18 +1052,22 @@ static void cloth_continuum_step(ClothModifierData *clmd, float dt) SIM_hair_volume_grid_interpolate(grid, x, &gdensity, gvel, gvel_smooth, NULL, NULL); - // BKE_sim_debug_data_add_circle( - // clmd->debug_data, x, gdensity, 0.7, 0.3, 1, - // "grid density", i, j, 3111); +# if 0 + BKE_sim_debug_data_add_circle( + clmd->debug_data, x, gdensity, 0.7, 0.3, 1, + "grid density", i, j, 3111); +# endif if (!is_zero_v3(gvel) || !is_zero_v3(gvel_smooth)) { float dvel[3]; sub_v3_v3v3(dvel, gvel_smooth, gvel); - // BKE_sim_debug_data_add_vector( - // clmd->debug_data, x, gvel, 0.4, 0, 1, - // "grid velocity", i, j, 3112); - // BKE_sim_debug_data_add_vector( - // clmd->debug_data, x, gvel_smooth, 0.6, 1, 1, - // "grid velocity", i, j, 3113); +# if 0 + BKE_sim_debug_data_add_vector( + clmd->debug_data, x, gvel, 0.4, 0, 1, + "grid velocity", i, j, 3112); + BKE_sim_debug_data_add_vector( + clmd->debug_data, x, gvel_smooth, 0.6, 1, 1, + "grid velocity", i, j, 3113); +# endif BKE_sim_debug_data_add_vector( clmd->debug_data, x, dvel, 0.4, 1, 0.7, "grid velocity", i, j, 3114); # if 0 @@ -1074,12 +1078,14 @@ static void cloth_continuum_step(ClothModifierData *clmd, float dt) interp_v3_v3v3(col, col0, col1, CLAMPIS(gdensity * clmd->sim_parms->density_strength, 0.0, 1.0)); - // BKE_sim_debug_data_add_circle( - // clmd->debug_data, x, gdensity * clmd->sim_parms->density_strength, 0, 1, 0.4, - // "grid velocity", i, j, 3115); - // BKE_sim_debug_data_add_dot( - // clmd->debug_data, x, col[0], col[1], col[2], - // "grid velocity", i, j, 3115); +# if 0 + BKE_sim_debug_data_add_circle( + clmd->debug_data, x, gdensity * clmd->sim_parms->density_strength, 0, 1, 0.4, + "grid velocity", i, j, 3115); + BKE_sim_debug_data_add_dot( + clmd->debug_data, x, col[0], col[1], col[2], + "grid velocity", i, j, 3115); +# endif BKE_sim_debug_data_add_circle( clmd->debug_data, x, 0.01f, col[0], col[1], col[2], "grid velocity", i, j, 3115); } diff --git a/source/blender/simulation/intern/hair_volume.cpp b/source/blender/simulation/intern/hair_volume.cpp index 4966fa2510d..348c8683be9 100644 --- a/source/blender/simulation/intern/hair_volume.cpp +++ b/source/blender/simulation/intern/hair_volume.cpp @@ -112,9 +112,11 @@ BLI_INLINE int hair_grid_interp_weights( uvw[1] = (vec[1] - gmin[1]) * scale - (float)j; uvw[2] = (vec[2] - gmin[2]) * scale - (float)k; - // BLI_assert(0.0f <= uvw[0] && uvw[0] <= 1.0001f); - // BLI_assert(0.0f <= uvw[1] && uvw[1] <= 1.0001f); - // BLI_assert(0.0f <= uvw[2] && uvw[2] <= 1.0001f); +#if 0 + BLI_assert(0.0f <= uvw[0] && uvw[0] <= 1.0001f); + BLI_assert(0.0f <= uvw[1] && uvw[1] <= 1.0001f); + BLI_assert(0.0f <= uvw[2] && uvw[2] <= 1.0001f); +#endif return offset; } @@ -350,7 +352,7 @@ BLI_INLINE int hair_grid_weights( weights[6] = dist_tent_v3f3(uvw, (float)i, (float)(j + 1), (float)(k + 1)); weights[7] = dist_tent_v3f3(uvw, (float)(i + 1), (float)(j + 1), (float)(k + 1)); - // BLI_assert(fabsf(weights_sum(weights) - 1.0f) < 0.0001f); + // BLI_assert(fabsf(weights_sum(weights) - 1.0f) < 0.0001f); return offset; } @@ -488,9 +490,10 @@ BLI_INLINE void hair_volume_add_segment_2D(HairGrid *grid, BKE_sim_debug_data_add_dot(x2w, 0.1, 0.1, 0.7, "grid", 649, debug_i, j, k); BKE_sim_debug_data_add_line(wloc, x2w, 0.3, 0.8, 0.3, "grid", 253, debug_i, j, k); BKE_sim_debug_data_add_line(wloc, x3w, 0.8, 0.3, 0.3, "grid", 254, debug_i, j, k); - // BKE_sim_debug_data_add_circle( - // x2w, len_v3v3(wloc, x2w), 0.2, 0.7, 0.2, - // "grid", 255, i, j, k); +# if 0 + BKE_sim_debug_data_add_circle( + x2w, len_v3v3(wloc, x2w), 0.2, 0.7, 0.2, "grid", 255, i, j, k); +# endif } } # endif @@ -1003,9 +1006,10 @@ bool SIM_hair_volume_solve_divergence(HairGrid *grid, if (!is_margin) { float dvel[3]; sub_v3_v3v3(dvel, vert->velocity_smooth, vert->velocity); - // BKE_sim_debug_data_add_vector( - // grid->debug_data, wloc, dvel, 1, 1, 1, - // "grid", 5566, i, j, k); +# if 0 + BKE_sim_debug_data_add_vector( + grid->debug_data, wloc, dvel, 1, 1, 1, "grid", 5566, i, j, k); +# endif } if (!is_margin) { @@ -1015,11 +1019,12 @@ bool SIM_hair_volume_solve_divergence(HairGrid *grid, float col[3]; interp_v3_v3v3(col, col0, colp, d); - // if (d > 0.05f) { - // BKE_sim_debug_data_add_dot( - // grid->debug_data, wloc, col[0], col[1], col[2], - // "grid", 5544, i, j, k); - // } +# if 0 + if (d > 0.05f) { + BKE_sim_debug_data_add_dot( + grid->debug_data, wloc, col[0], col[1], col[2], "grid", 5544, i, j, k); + } +# endif } } } |