ClangFormat: format '#if 0' code
Previous cleanups didn't account for space after '#'.
This commit is contained in:
parent
223f931095
commit
a54bdd76cb
|
@ -98,8 +98,8 @@ void *mmap(void *UNUSED(start), size_t len, int prot, int flags, int fd, off_t o
|
|||
}
|
||||
|
||||
# if 0
|
||||
if ( fd == -1 ) {
|
||||
_set_errno( EBADF );
|
||||
if (fd == -1) {
|
||||
_set_errno(EBADF);
|
||||
return MAP_FAILED;
|
||||
}
|
||||
# endif
|
||||
|
|
|
@ -285,9 +285,15 @@ char *BKE_mesh_runtime_debug_info(Mesh *me_eval)
|
|||
# if 0
|
||||
const char *tstr;
|
||||
switch (me_eval->type) {
|
||||
case DM_TYPE_CDDM: tstr = "DM_TYPE_CDDM"; break;
|
||||
case DM_TYPE_CCGDM: tstr = "DM_TYPE_CCGDM"; break;
|
||||
default: tstr = "UNKNOWN"; break;
|
||||
case DM_TYPE_CDDM:
|
||||
tstr = "DM_TYPE_CDDM";
|
||||
break;
|
||||
case DM_TYPE_CCGDM:
|
||||
tstr = "DM_TYPE_CCGDM";
|
||||
break;
|
||||
default:
|
||||
tstr = "UNKNOWN";
|
||||
break;
|
||||
}
|
||||
BLI_dynstr_appendf(dynstr, " 'type': '%s',\n", tstr);
|
||||
# endif
|
||||
|
|
|
@ -2453,7 +2453,7 @@ static void update_flowsfluids(
|
|||
EmissionMap em_temp = {NULL};
|
||||
float sample_size = 1.0f / (float)(subframes + 1);
|
||||
# if 0
|
||||
float prev_frame_pos = sample_size * (float)(subframe+1);
|
||||
float prev_frame_pos = sample_size * (float)(subframe + 1);
|
||||
# endif
|
||||
float sdt = dt * sample_size;
|
||||
int hires_multiplier = 1;
|
||||
|
|
|
@ -391,27 +391,26 @@ void BKE_sound_load(struct Main *bmain, bSound *sound)
|
|||
|
||||
/* XXX unused currently */
|
||||
# if 0
|
||||
switch (sound->type)
|
||||
{
|
||||
switch (sound->type) {
|
||||
case SOUND_TYPE_FILE:
|
||||
# endif
|
||||
{
|
||||
char fullpath[FILE_MAX];
|
||||
{
|
||||
char fullpath[FILE_MAX];
|
||||
|
||||
/* load sound */
|
||||
PackedFile *pf = sound->packedfile;
|
||||
/* load sound */
|
||||
PackedFile *pf = sound->packedfile;
|
||||
|
||||
/* don't modify soundact->sound->name, only change a copy */
|
||||
BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
|
||||
BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id));
|
||||
/* don't modify soundact->sound->name, only change a copy */
|
||||
BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
|
||||
BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id));
|
||||
|
||||
/* but we need a packed file then */
|
||||
if (pf)
|
||||
sound->handle = AUD_Sound_bufferFile((unsigned char *)pf->data, pf->size);
|
||||
/* or else load it from disk */
|
||||
else
|
||||
sound->handle = AUD_Sound_file(fullpath);
|
||||
}
|
||||
/* but we need a packed file then */
|
||||
if (pf)
|
||||
sound->handle = AUD_Sound_bufferFile((unsigned char *)pf->data, pf->size);
|
||||
/* or else load it from disk */
|
||||
else
|
||||
sound->handle = AUD_Sound_file(fullpath);
|
||||
}
|
||||
/* XXX unused currently */
|
||||
# if 0
|
||||
break;
|
||||
|
@ -426,23 +425,23 @@ void BKE_sound_load(struct Main *bmain, bSound *sound)
|
|||
break;
|
||||
}
|
||||
# endif
|
||||
if (sound->flags & SOUND_FLAGS_MONO) {
|
||||
void *handle = AUD_Sound_rechannel(sound->handle, AUD_CHANNELS_MONO);
|
||||
AUD_Sound_free(sound->handle);
|
||||
sound->handle = handle;
|
||||
}
|
||||
|
||||
if (sound->flags & SOUND_FLAGS_CACHING) {
|
||||
sound->cache = AUD_Sound_cache(sound->handle);
|
||||
}
|
||||
|
||||
if (sound->cache)
|
||||
sound->playback_handle = sound->cache;
|
||||
else
|
||||
sound->playback_handle = sound->handle;
|
||||
|
||||
BKE_sound_update_sequencer(bmain, sound);
|
||||
if (sound->flags & SOUND_FLAGS_MONO) {
|
||||
void *handle = AUD_Sound_rechannel(sound->handle, AUD_CHANNELS_MONO);
|
||||
AUD_Sound_free(sound->handle);
|
||||
sound->handle = handle;
|
||||
}
|
||||
|
||||
if (sound->flags & SOUND_FLAGS_CACHING) {
|
||||
sound->cache = AUD_Sound_cache(sound->handle);
|
||||
}
|
||||
|
||||
if (sound->cache)
|
||||
sound->playback_handle = sound->cache;
|
||||
else
|
||||
sound->playback_handle = sound->handle;
|
||||
|
||||
BKE_sound_update_sequencer(bmain, sound);
|
||||
}
|
||||
}
|
||||
|
||||
AUD_Device *BKE_sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume)
|
||||
|
|
|
@ -1432,7 +1432,8 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3], int *r_looptri
|
|||
else if (efa->len == 3) {
|
||||
# if 0
|
||||
int j;
|
||||
BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, j) {
|
||||
BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, j)
|
||||
{
|
||||
looptris[i][j] = l;
|
||||
}
|
||||
i += 1;
|
||||
|
@ -1450,7 +1451,8 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3], int *r_looptri
|
|||
BMLoop *ltmp[4];
|
||||
int j;
|
||||
BLI_array_grow_items(looptris, 2);
|
||||
BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, j) {
|
||||
BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, j)
|
||||
{
|
||||
ltmp[j] = l;
|
||||
}
|
||||
|
||||
|
|
|
@ -190,10 +190,9 @@ static void bm_loop_customdata_merge(BMesh *bm,
|
|||
# if 0
|
||||
&&
|
||||
/* check if the data ends up diverged */
|
||||
(CustomData_data_equals(
|
||||
type,
|
||||
BM_ELEM_CD_GET_VOID_P(l_a_inner, offset),
|
||||
BM_ELEM_CD_GET_VOID_P(l_b_inner, offset)) == false)
|
||||
(CustomData_data_equals(type,
|
||||
BM_ELEM_CD_GET_VOID_P(l_a_inner, offset),
|
||||
BM_ELEM_CD_GET_VOID_P(l_b_inner, offset)) == false)
|
||||
# endif
|
||||
) {
|
||||
/* no need to allocate a temp block:
|
||||
|
|
|
@ -315,10 +315,13 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
|
|||
|
||||
# if 0
|
||||
for (ExecutionSystem::Operations::const_iterator it = system->m_operations.begin();
|
||||
it != system->m_operations.end(); ++it)
|
||||
{
|
||||
it != system->m_operations.end();
|
||||
++it) {
|
||||
NodeOperation *op = *it;
|
||||
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// OPERATION: %s\r\n", node->getbNode()->typeinfo->ui_name);
|
||||
len += snprintf(str + len,
|
||||
maxlen > len ? maxlen - len : 0,
|
||||
"// OPERATION: %s\r\n",
|
||||
node->getbNode()->typeinfo->ui_name);
|
||||
}
|
||||
# endif
|
||||
|
||||
|
|
|
@ -731,9 +731,11 @@ static void init_internal_icons(void)
|
|||
bbuf = IMB_loadiffname(iconfilestr, IB_rect, NULL);
|
||||
|
||||
if (bbuf && (bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H)) {
|
||||
printf("\n***WARNING***\n"
|
||||
"Icons file '%s' too small.\n"
|
||||
"Using built-in Icons instead\n", iconfilestr);
|
||||
printf(
|
||||
"\n***WARNING***\n"
|
||||
"Icons file '%s' too small.\n"
|
||||
"Using built-in Icons instead\n",
|
||||
iconfilestr);
|
||||
IMB_freeImBuf(bbuf);
|
||||
bbuf = NULL;
|
||||
}
|
||||
|
|
|
@ -1125,8 +1125,7 @@ static void ui_editsource_active_but_clear(void)
|
|||
static bool ui_editsource_uibut_match(uiBut *but_a, uiBut *but_b)
|
||||
{
|
||||
# if 0
|
||||
printf("matching buttons: '%s' == '%s'\n",
|
||||
but_a->drawstr, but_b->drawstr);
|
||||
printf("matching buttons: '%s' == '%s'\n", but_a->drawstr, but_b->drawstr);
|
||||
# endif
|
||||
|
||||
/* this just needs to be a 'good-enough' comparison so we can know beyond
|
||||
|
@ -1153,8 +1152,7 @@ void UI_editsource_active_but_test(uiBut *but)
|
|||
int lineno = -1;
|
||||
|
||||
# if 0
|
||||
printf("comparing buttons: '%s' == '%s'\n",
|
||||
but->drawstr, ui_editsource_info->but_orig.drawstr);
|
||||
printf("comparing buttons: '%s' == '%s'\n", but->drawstr, ui_editsource_info->but_orig.drawstr);
|
||||
# endif
|
||||
|
||||
PyC_FileAndNum_Safe(&fn, &lineno);
|
||||
|
|
|
@ -185,16 +185,18 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char
|
|||
}
|
||||
|
||||
fprintf(file, " CHANNEL %s =\n", str);
|
||||
for (i=0; i < channelSize; i++) {
|
||||
for (i = 0; i < channelSize; i++) {
|
||||
fprintf(file, " ");
|
||||
for (j=0;j <= entries;j++) { // also print time value
|
||||
fprintf(file, " %f ", channel[i*(entries + 1) + j]);
|
||||
if (j == entries-1) { fprintf(file, " "); }
|
||||
for (j = 0; j <= entries; j++) { // also print time value
|
||||
fprintf(file, " %f ", channel[i * (entries + 1) + j]);
|
||||
if (j == entries - 1) {
|
||||
fprintf(file, " ");
|
||||
}
|
||||
}
|
||||
fprintf(file, "\n");
|
||||
}
|
||||
|
||||
fprintf(file, " ;\n");
|
||||
fprintf(file, " ;\n");
|
||||
}
|
||||
# endif
|
||||
|
||||
|
|
|
@ -689,9 +689,9 @@ static int text_refresh_pyconstraints_exec(bContext *UNUSED(C), wmOperator *UNUS
|
|||
for (con = pchan->constraints.first; con; con = con->next) {
|
||||
if (con->type == CONSTRAINT_TYPE_PYTHON) {
|
||||
bPythonConstraint *data = con->data;
|
||||
if (data->text == text) BPY_pyconstraint_update(ob, con);
|
||||
if (data->text == text)
|
||||
BPY_pyconstraint_update(ob, con);
|
||||
update = 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -699,7 +699,8 @@ static int text_refresh_pyconstraints_exec(bContext *UNUSED(C), wmOperator *UNUS
|
|||
for (con = ob->constraints.first; con; con = con->next) {
|
||||
if (con->type == CONSTRAINT_TYPE_PYTHON) {
|
||||
bPythonConstraint *data = con->data;
|
||||
if (data->text == text) BPY_pyconstraint_update(ob, con);
|
||||
if (data->text == text)
|
||||
BPY_pyconstraint_update(ob, con);
|
||||
update = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -967,7 +967,7 @@ static void draw_rotation_guide(const RegionView3D *rv3d)
|
|||
immVertex3fv(pos, end);
|
||||
|
||||
# if 0
|
||||
color[3] = 0.2f + fabsf(rv3d->rot_angle); /* modulate opacity with angle */
|
||||
color[3] = 0.2f + fabsf(rv3d->rot_angle); /* modulate opacity with angle */
|
||||
/* ^^ neat idea, but angle is frame-rate dependent, so it's usually close to 0.2 */
|
||||
# endif
|
||||
|
||||
|
|
|
@ -49,7 +49,8 @@ extern "C" {
|
|||
extern int BLI_thread_is_main(void); /* Blender-specific function */
|
||||
}
|
||||
|
||||
static bool thread_is_main() {
|
||||
static bool thread_is_main()
|
||||
{
|
||||
/* "main" here means the GL context's thread */
|
||||
return BLI_thread_is_main();
|
||||
}
|
||||
|
|
|
@ -788,7 +788,8 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
|
|||
prop = RNA_def_property(srna, "max_spring_extensions", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "maxspringlen");
|
||||
RNA_def_property_range(prop, 1.0, 1000.0);
|
||||
RNA_def_property_ui_text(prop, "Maximum Spring Extension", "Maximum extension before spring gets cut");
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Maximum Spring Extension", "Maximum extension before spring gets cut");
|
||||
# endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1311,10 +1311,11 @@ static void rna_def_charinfo(BlenderRNA *brna)
|
|||
prop = RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_WRAP);
|
||||
RNA_def_property_ui_text(prop, "Wrap", "");
|
||||
RNA_def_property_update(prop, 0, "rna_Curve_update_data"); */
|
||||
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
|
||||
* /
|
||||
# endif
|
||||
|
||||
prop = RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE);
|
||||
prop = RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_SMALLCAPS);
|
||||
RNA_def_property_ui_text(prop, "Small Caps", "");
|
||||
RNA_def_property_ui_icon(prop, ICON_SMALL_CAPS, 0);
|
||||
|
|
|
@ -1518,12 +1518,12 @@ static void rna_def_fmodifier(BlenderRNA *brna)
|
|||
RNA_def_struct_refine_func(srna, "rna_FModifierType_refine");
|
||||
RNA_def_struct_ui_text(srna, "F-Modifier", "Modifier for values of F-Curve");
|
||||
|
||||
# if 0 /* XXX not used yet */
|
||||
/* name */
|
||||
# if 0 /* XXX not used yet */
|
||||
/* name */
|
||||
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_struct_name_property(srna, prop);
|
||||
RNA_def_property_ui_text(prop, "Name", "Short description of F-Curve Modifier");
|
||||
# endif /* XXX not used yet */
|
||||
# endif /* XXX not used yet */
|
||||
|
||||
/* type */
|
||||
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
|
||||
|
|
|
@ -1665,8 +1665,9 @@ static void rna_def_modifier_gpencilarmature(BlenderRNA *brna)
|
|||
prop = RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "multi", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Multi Modifier",
|
||||
"Use same input as previous modifier, and mix results using overall vgroup");
|
||||
prop,
|
||||
"Multi Modifier",
|
||||
"Use same input as previous modifier, and mix results using overall vgroup");
|
||||
RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update");
|
||||
# endif
|
||||
|
||||
|
|
|
@ -1030,7 +1030,8 @@ static void rna_MeshPoly_vertices_set(PointerRNA *ptr, const int *values)
|
|||
|
||||
/* disabling, some importers don't know the total material count when assigning materials */
|
||||
# if 0
|
||||
static void rna_MeshPoly_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
|
||||
static void rna_MeshPoly_material_index_range(
|
||||
PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
|
||||
{
|
||||
Mesh *me = rna_mesh(ptr);
|
||||
*min = 0;
|
||||
|
@ -3041,7 +3042,8 @@ static void rna_def_mesh(BlenderRNA *brna)
|
|||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
|
||||
RNA_def_property_editable_func(prop, "rna_Mesh_texspace_editable");
|
||||
RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_loc_get", "rna_Mesh_texspace_loc_set", NULL);
|
||||
RNA_def_property_float_funcs(
|
||||
prop, "rna_Mesh_texspace_loc_get", "rna_Mesh_texspace_loc_set", NULL);
|
||||
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
||||
# endif
|
||||
|
||||
|
|
|
@ -1049,8 +1049,10 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf(
|
|||
|
||||
# if 0 /* XXX Don't think we want this in modifier version... */
|
||||
if (BKE_object_pose_armature_get(ob_src)) {
|
||||
RNA_enum_items_add_value(&item, &totitem, rna_enum_dt_layers_select_src_items, DT_LAYERS_VGROUP_SRC_BONE_SELECT);
|
||||
RNA_enum_items_add_value(&item, &totitem, rna_enum_dt_layers_select_src_items, DT_LAYERS_VGROUP_SRC_BONE_DEFORM);
|
||||
RNA_enum_items_add_value(
|
||||
&item, &totitem, rna_enum_dt_layers_select_src_items, DT_LAYERS_VGROUP_SRC_BONE_SELECT);
|
||||
RNA_enum_items_add_value(
|
||||
&item, &totitem, rna_enum_dt_layers_select_src_items, DT_LAYERS_VGROUP_SRC_BONE_DEFORM);
|
||||
}
|
||||
# endif
|
||||
|
||||
|
@ -1373,16 +1375,28 @@ static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const c
|
|||
"Smooth, keep corners",
|
||||
"UVs are smoothed, corners on discontinuous boundary are kept sharp"},
|
||||
# if 0
|
||||
{SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS, "PRESERVE_CORNERS_AND_JUNCTIONS", 0,
|
||||
"Smooth, keep corners+junctions", "UVs are smoothed, corners on discontinuous boundary and "
|
||||
{SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS,
|
||||
"PRESERVE_CORNERS_AND_JUNCTIONS",
|
||||
0,
|
||||
"Smooth, keep corners+junctions",
|
||||
"UVs are smoothed, corners on discontinuous boundary and "
|
||||
"junctions of 3 or more regions are kept sharp"},
|
||||
{SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE, "PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE", 0,
|
||||
"Smooth, keep corners+junctions+concave", "UVs are smoothed, corners on discontinuous boundary, "
|
||||
{SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE,
|
||||
"PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE",
|
||||
0,
|
||||
"Smooth, keep corners+junctions+concave",
|
||||
"UVs are smoothed, corners on discontinuous boundary, "
|
||||
"junctions of 3 or more regions and darts and concave corners are kept sharp"},
|
||||
{SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES, "PRESERVE_BOUNDARIES", 0,
|
||||
"Smooth, keep corners", "UVs are smoothed, boundaries are kept sharp"},
|
||||
{SUBSURF_UV_SMOOTH_ALL, "PRESERVE_BOUNDARIES", 0,
|
||||
"Smooth all", "UVs and boundaries are smoothed"},
|
||||
{SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES,
|
||||
"PRESERVE_BOUNDARIES",
|
||||
0,
|
||||
"Smooth, keep corners",
|
||||
"UVs are smoothed, boundaries are kept sharp"},
|
||||
{SUBSURF_UV_SMOOTH_ALL,
|
||||
"PRESERVE_BOUNDARIES",
|
||||
0,
|
||||
"Smooth all",
|
||||
"UVs and boundaries are smoothed"},
|
||||
# endif
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
};
|
||||
|
@ -2956,9 +2970,9 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
|
|||
PropertyRNA *prop;
|
||||
# if 0
|
||||
static const EnumPropertyItem prop_mode_items[] = {
|
||||
{0, "VOLUME", 0, "Volume", "Bind to volume inside cage mesh"},
|
||||
{1, "SURFACE", 0, "Surface", "Bind to surface of cage mesh"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, "VOLUME", 0, "Volume", "Bind to volume inside cage mesh"},
|
||||
{1, "SURFACE", 0, "Surface", "Bind to surface of cage mesh"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
};
|
||||
# endif
|
||||
|
||||
|
@ -4109,7 +4123,8 @@ static void rna_def_modifier_screw(BlenderRNA *brna)
|
|||
# if 0
|
||||
prop = RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_ANGLE);
|
||||
RNA_def_property_ui_text(prop, "Object Angle", "Use the angle between the objects rather than the fixed angle");
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Object Angle", "Use the angle between the objects rather than the fixed angle");
|
||||
RNA_def_property_update(prop, 0, "rna_Modifier_update");
|
||||
# endif
|
||||
}
|
||||
|
@ -4643,8 +4658,11 @@ static void rna_def_modifier_ocean(BlenderRNA *brna)
|
|||
"Displace",
|
||||
"Displace existing geometry according to simulation"},
|
||||
# if 0
|
||||
{MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", 0, "Sim Only",
|
||||
"Leaves geometry unchanged, but still runs simulation (to be used from texture)"},
|
||||
{MOD_OCEAN_GEOM_SIM_ONLY,
|
||||
"SIM_ONLY",
|
||||
0,
|
||||
"Sim Only",
|
||||
"Leaves geometry unchanged, but still runs simulation (to be used from texture)"},
|
||||
# endif
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
};
|
||||
|
@ -5457,10 +5475,15 @@ static void rna_def_modifier_datatransfer(BlenderRNA *brna)
|
|||
RNA_def_property_update(prop, 0, "rna_Modifier_update");
|
||||
|
||||
# if 0
|
||||
prop = RNA_def_enum(srna, "layers_shapekey_select_src", rna_enum_dt_layers_select_src_items, DT_LAYERS_ALL_SRC,
|
||||
"Source Layers Selection", "Which layers to transfer, in case of multi-layers types");
|
||||
prop = RNA_def_enum(srna,
|
||||
"layers_shapekey_select_src",
|
||||
rna_enum_dt_layers_select_src_items,
|
||||
DT_LAYERS_ALL_SRC,
|
||||
"Source Layers Selection",
|
||||
"Which layers to transfer, in case of multi-layers types");
|
||||
RNA_def_property_enum_sdna(prop, NULL, "layers_select_src[DT_MULTILAYER_INDEX_SHAPEKEY]");
|
||||
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DataTransferModifier_layers_select_src_itemf");
|
||||
RNA_def_property_enum_funcs(
|
||||
prop, NULL, NULL, "rna_DataTransferModifier_layers_select_src_itemf");
|
||||
RNA_def_property_update(prop, 0, "rna_Modifier_update");
|
||||
# endif
|
||||
|
||||
|
@ -5498,10 +5521,15 @@ static void rna_def_modifier_datatransfer(BlenderRNA *brna)
|
|||
RNA_def_property_update(prop, 0, "rna_Modifier_update");
|
||||
|
||||
# if 0
|
||||
prop = RNA_def_enum(srna, "layers_shapekey_select_dst", rna_enum_dt_layers_select_dst_items, DT_LAYERS_NAME_DST,
|
||||
"Destination Layers Matching", "How to match source and destination layers");
|
||||
prop = RNA_def_enum(srna,
|
||||
"layers_shapekey_select_dst",
|
||||
rna_enum_dt_layers_select_dst_items,
|
||||
DT_LAYERS_NAME_DST,
|
||||
"Destination Layers Matching",
|
||||
"How to match source and destination layers");
|
||||
RNA_def_property_enum_sdna(prop, NULL, "layers_select_dst[DT_MULTILAYER_INDEX_SHAPEKEY]");
|
||||
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DataTransferModifier_layers_select_dst_itemf");
|
||||
RNA_def_property_enum_funcs(
|
||||
prop, NULL, NULL, "rna_DataTransferModifier_layers_select_dst_itemf");
|
||||
RNA_def_property_update(prop, 0, "rna_Modifier_update");
|
||||
# endif
|
||||
|
||||
|
|
|
@ -4990,7 +4990,7 @@ static void def_sh_script(StructRNA *srna)
|
|||
RNA_def_function_ui_description(func, "Find a socket by name");
|
||||
parm = RNA_def_string(func, "name", NULL, 0, "Socket name", "");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
/*parm =*/ RNA_def_boolean(func, "is_output", false, "Output", "Whether the socket is an output");
|
||||
/*parm =*/RNA_def_boolean(func, "is_output", false, "Output", "Whether the socket is an output");
|
||||
parm = RNA_def_pointer(func, "result", "NodeSocket", "", "");
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
|
@ -5001,7 +5001,7 @@ static void def_sh_script(StructRNA *srna)
|
|||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
parm = RNA_def_enum(func, "type", node_socket_type_items, SOCK_FLOAT, "Type", "");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
/*parm =*/ RNA_def_boolean(func, "is_output", false, "Output", "Whether the socket is an output");
|
||||
/*parm =*/RNA_def_boolean(func, "is_output", false, "Output", "Whether the socket is an output");
|
||||
parm = RNA_def_pointer(func, "result", "NodeSocket", "", "");
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
|
@ -5335,11 +5335,11 @@ static void def_cmp_image(StructRNA *srna)
|
|||
|
||||
# if 0
|
||||
static const EnumPropertyItem type_items[] = {
|
||||
{IMA_SRC_FILE, "IMAGE", 0, "Image", ""},
|
||||
{IMA_SRC_MOVIE, "MOVIE", "Movie", ""},
|
||||
{IMA_SRC_SEQUENCE, "SEQUENCE", "Sequence", ""},
|
||||
{IMA_SRC_GENERATED, "GENERATED", "Generated", ""},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{IMA_SRC_FILE, "IMAGE", 0, "Image", ""},
|
||||
{IMA_SRC_MOVIE, "MOVIE", "Movie", ""},
|
||||
{IMA_SRC_SEQUENCE, "SEQUENCE", "Sequence", ""},
|
||||
{IMA_SRC_GENERATED, "GENERATED", "Generated", ""},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
};
|
||||
# endif
|
||||
|
||||
|
@ -6891,9 +6891,11 @@ static void def_cmp_bokehblur(StructRNA *srna)
|
|||
prop = RNA_def_property(srna, "f_stop", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "custom3");
|
||||
RNA_def_property_range(prop, 0.0f, 128.0f);
|
||||
RNA_def_property_ui_text(prop, "F-stop",
|
||||
"Amount of focal blur, 128=infinity=perfect focus, half the value doubles "
|
||||
"the blur radius");
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"F-stop",
|
||||
"Amount of focal blur, 128=infinity=perfect focus, half the value doubles "
|
||||
"the blur radius");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||
# endif
|
||||
|
||||
|
|
|
@ -2521,8 +2521,10 @@ static void rna_def_object(BlenderRNA *brna)
|
|||
/* FIXME: this is not a single field any more! (drotAxis and drotAngle) */
|
||||
RNA_def_property_float_sdna(prop, NULL, "dquat");
|
||||
RNA_def_property_float_array_default(prop, rna_default_axis_angle);
|
||||
RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)",
|
||||
"Extra rotation added to the rotation of the object (when using Axis-Angle rotations)");
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Delta Rotation (Axis Angle)",
|
||||
"Extra rotation added to the rotation of the object (when using Axis-Angle rotations)");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
|
||||
# endif
|
||||
|
||||
|
|
|
@ -439,8 +439,8 @@ static void rna_Object_shape_key_remove(Object *ob,
|
|||
}
|
||||
|
||||
# if 0
|
||||
static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex,
|
||||
float weight, int assignmode)
|
||||
static void rna_Mesh_assign_verts_to_group(
|
||||
Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode)
|
||||
{
|
||||
if (ob->type != OB_MESH) {
|
||||
BKE_report(reports, RPT_ERROR, "Object should be of mesh type");
|
||||
|
|
|
@ -537,7 +537,7 @@ static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, Point
|
|||
if (ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) {
|
||||
Curve *cu = ob->data;
|
||||
cu->flag |= (CU_PATH | CU_3D);
|
||||
do_curvebuts(B_CU3D); /* all curves too */
|
||||
do_curvebuts(B_CU3D); /* all curves too */
|
||||
}
|
||||
# endif
|
||||
|
||||
|
|
|
@ -461,8 +461,10 @@ static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int ind
|
|||
|
||||
grp = BLI_findlink(&pose->agroups, index - 1);
|
||||
|
||||
if (grp) BLI_strncpy(value, grp->name, sizeof(grp->name));
|
||||
else value[0] = '\0';
|
||||
if (grp)
|
||||
BLI_strncpy(value, grp->name, sizeof(grp->name));
|
||||
else
|
||||
value[0] = '\0';
|
||||
}
|
||||
|
||||
static int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index)
|
||||
|
|
|
@ -1685,11 +1685,19 @@ int rna_property_override_diff_default(Main *bmain,
|
|||
|
||||
# if 0
|
||||
if (rna_path) {
|
||||
printf("Checking %s, %s [%d] vs %s [%d]; is_id: %d, diffing: %d; "
|
||||
"insert: %d (could be used: %d, do_create: %d)\n",
|
||||
rna_path, propname_a ? propname_a : "", idx_a, propname_b ? propname_b : "", idx_b,
|
||||
is_id, is_valid_for_diffing, is_valid_for_insertion,
|
||||
(RNA_property_override_flag(prop_a) & PROPOVERRIDE_STATIC_INSERTION) != 0, do_create);
|
||||
printf(
|
||||
"Checking %s, %s [%d] vs %s [%d]; is_id: %d, diffing: %d; "
|
||||
"insert: %d (could be used: %d, do_create: %d)\n",
|
||||
rna_path,
|
||||
propname_a ? propname_a : "",
|
||||
idx_a,
|
||||
propname_b ? propname_b : "",
|
||||
idx_b,
|
||||
is_id,
|
||||
is_valid_for_diffing,
|
||||
is_valid_for_insertion,
|
||||
(RNA_property_override_flag(prop_a) & PROPOVERRIDE_STATIC_INSERTION) != 0,
|
||||
do_create);
|
||||
}
|
||||
# endif
|
||||
|
||||
|
@ -3045,11 +3053,17 @@ void RNA_def_rna(BlenderRNA *brna)
|
|||
prop = RNA_def_property(srna, "structs", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_struct_type(prop, "Struct");
|
||||
RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next",
|
||||
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
||||
RNA_def_property_collection_funcs(prop,
|
||||
"rna_BlenderRNA_structs_begin",
|
||||
"rna_iterator_listbase_next",
|
||||
"rna_iterator_listbase_end",
|
||||
"rna_iterator_listbase_get",
|
||||
/* included for speed, can be removed */
|
||||
# if 0
|
||||
NULL, NULL, NULL, NULL);
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
# else
|
||||
"rna_BlenderRNA_structs_length",
|
||||
"rna_BlenderRNA_structs_lookup_int",
|
||||
|
|
|
@ -6080,7 +6080,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
|
|||
RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
|
||||
RNA_def_property_enum_items(prop, rna_enum_shading_type_items);
|
||||
/* XXX Label and tooltips are obviously wrong! */
|
||||
RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
|
||||
# endif
|
||||
|
||||
prop = RNA_def_property(srna, "use_sequencer_gl_textured_solid", PROP_BOOLEAN, PROP_NONE);
|
||||
|
@ -7314,7 +7315,8 @@ void RNA_def_scene(BlenderRNA *brna)
|
|||
# if 0 /* XXX: Is this actually needed? */
|
||||
prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_FRAME_DROP);
|
||||
RNA_def_property_ui_text(prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
# endif
|
||||
|
||||
|
@ -7455,8 +7457,10 @@ void RNA_def_scene(BlenderRNA *brna)
|
|||
# if 0 /* XXX: Is this actually needed? */
|
||||
prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
|
||||
RNA_def_property_ui_text(prop, "Audio Sync",
|
||||
"Play back and sync with audio clock, dropping frames if frame display is too slow");
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Audio Sync",
|
||||
"Play back and sync with audio clock, dropping frames if frame display is too slow");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
# endif
|
||||
|
||||
|
|
|
@ -729,7 +729,10 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr)
|
|||
static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
Sequence *seq = (Sequence *)(ptr->data);
|
||||
BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
|
||||
BLI_split_dirfile(value,
|
||||
seq->strip->dir,
|
||||
seq->strip->stripdata->name,
|
||||
sizeof(seq->strip->dir),
|
||||
sizeof(seq->strip->stripdata->name));
|
||||
}
|
||||
|
||||
|
@ -1954,8 +1957,8 @@ static void rna_def_effect_inputs(StructRNA *srna, int count)
|
|||
}
|
||||
|
||||
# if 0
|
||||
if (count == 3) { // not used by any effects (perhaps one day plugins?)
|
||||
prop = RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE);
|
||||
if (count == 3) { // not used by any effects (perhaps one day plugins?)
|
||||
prop = RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "seq3");
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
|
||||
RNA_def_property_ui_text(prop, "Input 3", "Third input for the effect strip");
|
||||
|
|
|
@ -1171,7 +1171,8 @@ static void rna_def_ui_layout(BlenderRNA *brna)
|
|||
|
||||
# if 0
|
||||
prop = RNA_def_property(srna, "keep_aspect", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_funcs(prop, "rna_UILayout_keep_aspect_get", "rna_UILayout_keep_aspect_set");
|
||||
RNA_def_property_boolean_funcs(
|
||||
prop, "rna_UILayout_keep_aspect_get", "rna_UILayout_keep_aspect_set");
|
||||
# endif
|
||||
|
||||
prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED);
|
||||
|
|
|
@ -878,30 +878,49 @@ void RNA_api_ui_layout(StructRNA *srna)
|
|||
api_ui_item_op_common(func);
|
||||
parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
parm = RNA_def_boolean(func, "value", false, "", "Value of the property to call the operator with");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); */
|
||||
parm = RNA_def_boolean(
|
||||
func, "value", false, "", "Value of the property to call the operator with");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
* /
|
||||
|
||||
func = RNA_def_function(srna, "operator_int", "uiItemIntO");
|
||||
func = RNA_def_function(srna, "operator_int", "uiItemIntO");
|
||||
api_ui_item_op_common(func);
|
||||
parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
parm = RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "",
|
||||
"Value of the property to call the operator with", INT_MIN, INT_MAX);
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); */
|
||||
parm = RNA_def_int(func,
|
||||
"value",
|
||||
0,
|
||||
INT_MIN,
|
||||
INT_MAX,
|
||||
"",
|
||||
"Value of the property to call the operator with",
|
||||
INT_MIN,
|
||||
INT_MAX);
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
* /
|
||||
|
||||
func = RNA_def_function(srna, "operator_float", "uiItemFloatO");
|
||||
func = RNA_def_function(srna, "operator_float", "uiItemFloatO");
|
||||
api_ui_item_op_common(func);
|
||||
parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
parm = RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "",
|
||||
"Value of the property to call the operator with", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); */
|
||||
parm = RNA_def_float(func,
|
||||
"value",
|
||||
0,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"",
|
||||
"Value of the property to call the operator with",
|
||||
-FLT_MAX,
|
||||
FLT_MAX);
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
* /
|
||||
|
||||
func = RNA_def_function(srna, "operator_string", "uiItemStringO");
|
||||
func = RNA_def_function(srna, "operator_string", "uiItemStringO");
|
||||
api_ui_item_op_common(func);
|
||||
parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
parm = RNA_def_string(func, "value", NULL, 0, "", "Value of the property to call the operator with");
|
||||
parm = RNA_def_string(
|
||||
func, "value", NULL, 0, "", "Value of the property to call the operator with");
|
||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||
# endif
|
||||
|
||||
|
|
|
@ -5128,7 +5128,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
|
|||
prop = RNA_def_boolean(srna, "use_ndof", true, "", "");
|
||||
# else
|
||||
prop = RNA_def_boolean(srna, "use_ndof", false, "", "");
|
||||
# endif /* WITH_INPUT_NDOF */
|
||||
# endif /* WITH_INPUT_NDOF */
|
||||
RNA_def_property_flag(prop, PROP_IDPROPERTY);
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla
|
|||
{
|
||||
#ifdef WITH_OCEANSIM
|
||||
# if 0
|
||||
const OceanModifierData *omd = (const OceanModifierData *) md;
|
||||
const OceanModifierData *omd = (const OceanModifierData *)md;
|
||||
# endif
|
||||
OceanModifierData *tomd = (OceanModifierData *)target;
|
||||
|
||||
|
|
|
@ -480,13 +480,15 @@ BLI_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s)
|
|||
BPH_mass_spring_get_motion_state(data, s->mn, x_mn, v);
|
||||
|
||||
BKE_sim_debug_data_add_dot(clmd->debug_data, x_kl, 0.9, 0.9, 0.9, "target", 7980, s->kl);
|
||||
BKE_sim_debug_data_add_line(clmd->debug_data, x_kl, x_mn, 0.8, 0.8, 0.8, "target", 7981, s->kl);
|
||||
BKE_sim_debug_data_add_line(
|
||||
clmd->debug_data, x_kl, x_mn, 0.8, 0.8, 0.8, "target", 7981, s->kl);
|
||||
|
||||
copy_v3_v3(d, s->target);
|
||||
BKE_sim_debug_data_add_vector(clmd->debug_data, x_kl, d, 0.8, 0.8, 0.2, "target", 7982, s->kl);
|
||||
BKE_sim_debug_data_add_vector(
|
||||
clmd->debug_data, x_kl, d, 0.8, 0.8, 0.2, "target", 7982, s->kl);
|
||||
|
||||
// copy_v3_v3(d, s->target_ij);
|
||||
// BKE_sim_debug_data_add_vector(clmd->debug_data, x, d, 1, 0.4, 0.4, "target", 7983, s->kl);
|
||||
// copy_v3_v3(d, s->target_ij);
|
||||
// BKE_sim_debug_data_add_vector(clmd->debug_data, x, d, 1, 0.4, 0.4, "target", 7983, s->kl);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -126,7 +126,7 @@ static void print_fvector(float m3[3])
|
|||
// long float vector float (*)[3]
|
||||
///////////////////////////
|
||||
/* print long vector on console: for debug output */
|
||||
DO_INLINE void print_lfvector(float(*fLongVector)[3], unsigned int verts)
|
||||
DO_INLINE void print_lfvector(float (*fLongVector)[3], unsigned int verts)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
for (i = 0; i < verts; i++) {
|
||||
|
@ -325,9 +325,9 @@ static void print_bfmatrix(fmatrix3x3 *m)
|
|||
|
||||
for (j = 0; j < 3; ++j) {
|
||||
for (i = 0; i < 3; ++i) {
|
||||
// if (t[k + i + (l + j) * size] != 0.0f) {
|
||||
// printf("warning: overwriting value at %d, %d\n", m[q].r, m[q].c);
|
||||
// }
|
||||
// if (t[k + i + (l + j) * size] != 0.0f) {
|
||||
// printf("warning: overwriting value at %d, %d\n", m[q].r, m[q].c);
|
||||
// }
|
||||
if (k == l) {
|
||||
t[k + i + (k + j) * size] += m[q].m[i][j];
|
||||
}
|
||||
|
@ -412,7 +412,6 @@ DO_INLINE void inverse_fmatrix(float to[3][3], float from[3][3])
|
|||
*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
# endif
|
||||
|
||||
|
@ -534,8 +533,7 @@ static void print_bfmatrix(fmatrix3x3 *m3)
|
|||
{
|
||||
unsigned int i = 0;
|
||||
|
||||
for (i = 0; i < m3[0].vcount + m3[0].scount; i++)
|
||||
{
|
||||
for (i = 0; i < m3[0].vcount + m3[0].scount; i++) {
|
||||
print_fmatrix(m3[i].m);
|
||||
}
|
||||
}
|
||||
|
@ -769,7 +767,7 @@ DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
|
|||
}
|
||||
|
||||
# if 0 /* this version of the CG algorithm does not work very well with partial constraints (where S has non-zero elements) */
|
||||
static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S)
|
||||
static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S)
|
||||
{
|
||||
// Solves for unknown X in equation AX=B
|
||||
unsigned int conjgrad_loopcount = 0, conjgrad_looplimit = 100;
|
||||
|
@ -831,7 +829,8 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
|
|||
del_lfvector(r);
|
||||
// printf("W/O conjgrad_loopcount: %d\n", conjgrad_loopcount);
|
||||
|
||||
return conjgrad_loopcount < conjgrad_looplimit; // true means we reached desired accuracy in given time - ie stable
|
||||
return conjgrad_loopcount <
|
||||
conjgrad_looplimit; // true means we reached desired accuracy in given time - ie stable
|
||||
}
|
||||
# endif
|
||||
|
||||
|
@ -937,22 +936,27 @@ DO_INLINE void BuildPPinv(fmatrix3x3 *lA, fmatrix3x3 *P, fmatrix3x3 *Pinv)
|
|||
unsigned int i = 0;
|
||||
|
||||
// Take only the diagonal blocks of A
|
||||
// #pragma omp parallel for private(i) if (lA[0].vcount > CLOTH_OPENMP_LIMIT)
|
||||
// #pragma omp parallel for private(i) if (lA[0].vcount > CLOTH_OPENMP_LIMIT)
|
||||
for (i = 0; i < lA[0].vcount; i++) {
|
||||
// block diagonalizer
|
||||
cp_fmatrix(P[i].m, lA[i].m);
|
||||
inverse_fmatrix(Pinv[i].m, P[i].m);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# if 0
|
||||
// version 1.3
|
||||
static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S, fmatrix3x3 *P, fmatrix3x3 *Pinv)
|
||||
static int cg_filtered_pre(lfVector *dv,
|
||||
fmatrix3x3 *lA,
|
||||
lfVector *lB,
|
||||
lfVector *z,
|
||||
fmatrix3x3 *S,
|
||||
fmatrix3x3 *P,
|
||||
fmatrix3x3 *Pinv)
|
||||
{
|
||||
unsigned int numverts = lA[0].vcount, iterations = 0, conjgrad_looplimit = 100;
|
||||
float delta0 = 0, deltaNew = 0, deltaOld = 0, alpha = 0;
|
||||
float conjgrad_epsilon = 0.0001; // 0.2 is dt for steps=5
|
||||
float conjgrad_epsilon = 0.0001; // 0.2 is dt for steps=5
|
||||
lfVector *r = create_lfvector(numverts);
|
||||
lfVector *p = create_lfvector(numverts);
|
||||
lfVector *s = create_lfvector(numverts);
|
||||
|
@ -978,8 +982,7 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
|
|||
double start = PIL_check_seconds_timer();
|
||||
# endif
|
||||
|
||||
while ((deltaNew > delta0) && (iterations < conjgrad_looplimit))
|
||||
{
|
||||
while ((deltaNew > delta0) && (iterations < conjgrad_looplimit)) {
|
||||
iterations++;
|
||||
|
||||
mul_bfmatrix_lfvector(s, lA, p);
|
||||
|
@ -1001,7 +1004,6 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
|
|||
add_lfvector_lfvectorS(p, h, p, deltaNew / deltaOld, numverts);
|
||||
|
||||
filter(p, S);
|
||||
|
||||
}
|
||||
|
||||
# ifdef DEBUG_TIME
|
||||
|
@ -1021,7 +1023,14 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
|
|||
# endif
|
||||
|
||||
// version 1.4
|
||||
static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S, fmatrix3x3 *P, fmatrix3x3 *Pinv, fmatrix3x3 *bigI)
|
||||
static int cg_filtered_pre(lfVector *dv,
|
||||
fmatrix3x3 *lA,
|
||||
lfVector *lB,
|
||||
lfVector *z,
|
||||
fmatrix3x3 *S,
|
||||
fmatrix3x3 *P,
|
||||
fmatrix3x3 *Pinv,
|
||||
fmatrix3x3 *bigI)
|
||||
{
|
||||
unsigned int numverts = lA[0].vcount, iterations = 0, conjgrad_looplimit = 100;
|
||||
float delta0 = 0, deltaNew = 0, deltaOld = 0, alpha = 0, tol = 0;
|
||||
|
@ -1084,8 +1093,7 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
|
|||
|
||||
tol = (0.01 * 0.2);
|
||||
|
||||
while ((deltaNew > delta0 * tol * tol) && (iterations < conjgrad_looplimit))
|
||||
{
|
||||
while ((deltaNew > delta0 * tol * tol) && (iterations < conjgrad_looplimit)) {
|
||||
iterations++;
|
||||
|
||||
mul_bfmatrix_lfvector(s, lA, p);
|
||||
|
@ -1107,7 +1115,6 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
|
|||
add_lfvector_lfvectorS(p, h, p, deltaNew / deltaOld, numverts);
|
||||
|
||||
filter(p, S);
|
||||
|
||||
}
|
||||
|
||||
# ifdef DEBUG_TIME
|
||||
|
@ -1542,13 +1549,18 @@ BLI_INLINE void dfdx_spring(float to[3][3], const float dir[3], float length, fl
|
|||
|
||||
/* unused */
|
||||
# if 0
|
||||
BLI_INLINE void dfdx_damp(float to[3][3], const float dir[3], float length, const float vel[3], float rest, float damping)
|
||||
BLI_INLINE void dfdx_damp(float to[3][3],
|
||||
const float dir[3],
|
||||
float length,
|
||||
const float vel[3],
|
||||
float rest,
|
||||
float damping)
|
||||
{
|
||||
// inner spring damping vel is the relative velocity of the endpoints.
|
||||
// return (I-outerprod(dir, dir)) * (-damping * -(dot(dir, vel)/Max(length, rest)));
|
||||
mul_fvectorT_fvector(to, dir, dir);
|
||||
sub_fmatrix_fmatrix(to, I, to);
|
||||
mul_fmatrix_S(to, (-damping * -(dot_v3v3(dir, vel) / MAX2(length, rest))));
|
||||
mul_fmatrix_S(to, (-damping * -(dot_v3v3(dir, vel) / MAX2(length, rest))));
|
||||
}
|
||||
# endif
|
||||
|
||||
|
@ -1618,8 +1630,7 @@ BLI_INLINE bool spring_length(Implicit_Data *data,
|
|||
# if 0
|
||||
if (length > L) {
|
||||
if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) &&
|
||||
( ((length - L) * 100.0f / L) > clmd->sim_parms->maxspringlen))
|
||||
{
|
||||
(((length - L) * 100.0f / L) > clmd->sim_parms->maxspringlen)) {
|
||||
// cut spring!
|
||||
s->flags |= CSPRING_FLAG_DEACTIVATE;
|
||||
return false;
|
||||
|
|
|
@ -867,13 +867,18 @@ BLI_INLINE void dfdx_spring(float to[3][3], const float dir[3], float length, fl
|
|||
|
||||
/* unused */
|
||||
# if 0
|
||||
BLI_INLINE void dfdx_damp(float to[3][3], const float dir[3], float length, const float vel[3], float rest, float damping)
|
||||
BLI_INLINE void dfdx_damp(float to[3][3],
|
||||
const float dir[3],
|
||||
float length,
|
||||
const float vel[3],
|
||||
float rest,
|
||||
float damping)
|
||||
{
|
||||
// inner spring damping vel is the relative velocity of the endpoints.
|
||||
// return (I-outerprod(dir, dir)) * (-damping * -(dot(dir, vel)/Max(length, rest)));
|
||||
mul_fvectorT_fvector(to, dir, dir);
|
||||
sub_fmatrix_fmatrix(to, I, to);
|
||||
mul_fmatrix_S(to, (-damping * -(dot_v3v3(dir, vel) / MAX2(length, rest))));
|
||||
mul_fmatrix_S(to, (-damping * -(dot_v3v3(dir, vel) / MAX2(length, rest))));
|
||||
}
|
||||
# endif
|
||||
|
||||
|
@ -940,8 +945,7 @@ BLI_INLINE bool spring_length(Implicit_Data *data,
|
|||
# if 0
|
||||
if (length > L) {
|
||||
if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) &&
|
||||
( ((length - L) * 100.0f / L) > clmd->sim_parms->maxspringlen))
|
||||
{
|
||||
(((length - L) * 100.0f / L) > clmd->sim_parms->maxspringlen)) {
|
||||
// cut spring!
|
||||
s->flags |= CSPRING_FLAG_DEACTIVATE;
|
||||
return false;
|
||||
|
|
|
@ -447,8 +447,8 @@ int main(int argc,
|
|||
/* TODO - U.pythondir */
|
||||
#else
|
||||
printf(
|
||||
"\n* WARNING * - Blender compiled without Python!\nthis is not intended for typical "
|
||||
"usage\n\n");
|
||||
"\n* WARNING * - Blender compiled without Python!\n"
|
||||
"this is not intended for typical usage\n\n");
|
||||
#endif
|
||||
|
||||
CTX_py_init_set(C, 1);
|
||||
|
|
|
@ -274,8 +274,7 @@ static bool parse_int_clamp(const char *str,
|
|||
* that parses a comma separated list of numbers.
|
||||
*/
|
||||
static int *parse_int_relative_clamp_n(
|
||||
const char *str, int pos, int neg, int min, int max,
|
||||
int *r_value_len, const char **r_err_msg)
|
||||
const char *str, int pos, int neg, int min, int max, int *r_value_len, const char **r_err_msg)
|
||||
{
|
||||
const char sep = ',';
|
||||
int len = 1;
|
||||
|
@ -293,19 +292,18 @@ static int *parse_int_relative_clamp_n(
|
|||
static const char *msg = "incorrect comma use";
|
||||
*r_err_msg = msg;
|
||||
goto fail;
|
||||
|
||||
}
|
||||
else if (parse_int_relative_clamp(str, str_end, pos, neg, min, max, &values[i], r_err_msg)) {
|
||||
i++;
|
||||
}
|
||||
else {
|
||||
goto fail; /* error message already set */
|
||||
goto fail; /* error message already set */
|
||||
}
|
||||
|
||||
if (str_end) { /* next */
|
||||
if (str_end) { /* next */
|
||||
str = str_end + 1;
|
||||
}
|
||||
else { /* finished */
|
||||
else { /* finished */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue