[Bf-blender-cvs] [fe2f43a15c6] master: Cleanup: use '#if 0' for disabling multiple lines
Campbell Barton
noreply at git.blender.org
Tue Jul 20 07:02:45 CEST 2021
Commit: fe2f43a15c648e13fbc5fa4ba24cea41b3671427
Author: Campbell Barton
Date: Tue Jul 20 15:01:03 2021 +1000
Branches: master
https://developer.blender.org/rBfe2f43a15c648e13fbc5fa4ba24cea41b3671427
Cleanup: use '#if 0' for disabling multiple lines
===================================================================
M source/blender/blenkernel/intern/boids.c
M source/blender/blenloader/intern/versioning_250.c
M source/blender/editors/mask/mask_add.c
M source/blender/io/collada/BCAnimationSampler.cpp
M source/blender/io/collada/TransformReader.cpp
M source/blender/io/collada/collada_utils.cpp
M source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
M source/blender/python/intern/bpy_rna.c
M source/blender/simulation/intern/SIM_mass_spring.cpp
M source/blender/simulation/intern/hair_volume.cpp
===================================================================
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(
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list