diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-02 06:57:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-02 06:57:36 +0400 |
commit | b64f35227033adf229a0fd2a717d856acb11973b (patch) | |
tree | f945547f4062d5a94a70436cd1cb3bd3af9729d4 /source | |
parent | 85242e9f6ce26c7c3dbb3d5f1a2745ac0ca4759a (diff) | |
parent | ec710a29297d5fa7c9065760dbef322b02bbec01 (diff) |
svn merge ^/trunk/blender -r43033:43062
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/edgehash.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_texture.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_templates.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 83 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 6 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_explode.c | 4 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_remesh.c | 45 |
9 files changed, 85 insertions, 67 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index e7f9e40ec3e..1c70e47a538 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -52,7 +52,7 @@ float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_d { float dist; - if(isect_ray_tri_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL)) + if(isect_ray_tri_epsilon_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL, FLT_EPSILON)) return dist; return FLT_MAX; diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index b710e5d496d..97eb66eb49a 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -52,7 +52,7 @@ static unsigned int _ehash_hashsizes[]= { /* ensure v0 is smaller */ #define EDGE_ORD(v0, v1) \ - if (v0 < v1) { \ + if (v0 > v1) { \ v0 ^= v1; \ v1 ^= v0; \ v0 ^= v1; \ diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index c0ccaeaea90..6927a78332f 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index 6027a272270..a733d45c20b 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index d95b7685d07..ab5c99a7597 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -585,9 +585,9 @@ extern StructRNA RNA_VoxelData; extern StructRNA RNA_VoxelDataTexture; extern StructRNA RNA_WarpModifier; extern StructRNA RNA_WaveModifier; -extern StructRNA RNA_WeightVGEditModifier; -extern StructRNA RNA_WeightVGMixModifier; -extern StructRNA RNA_WeightVGProximityModifier; +extern StructRNA RNA_VertexWeightEditModifier; +extern StructRNA RNA_VertexWeightMixModifier; +extern StructRNA RNA_VertexWeightProximityModifier; extern StructRNA RNA_Window; extern StructRNA RNA_WindowManager; extern StructRNA RNA_WipeSequence; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 90e68058d36..dc7400dd9ae 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -43,9 +43,14 @@ #define RNA_VERSION_DATE "FIXME-RNA_VERSION_DATE" #ifdef _WIN32 -#ifndef snprintf -#define snprintf _snprintf +# ifndef snprintf +# define snprintf _snprintf +# endif #endif + +/* so we can use __func__ everywhere */ +#if defined(_MSC_VER) +# define __func__ __FUNCTION__ #endif /* Replace if different */ @@ -448,11 +453,9 @@ static int rna_enum_bitmask(PropertyRNA *prop) static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp) { - if(prop->type == PROP_FLOAT && (prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA)) - if(strcmp(dp->dnatype, "float") != 0 && strcmp(dp->dnatype, "double") != 0) - return 1; - - return 0; + return ( (prop->type == PROP_FLOAT) && + (prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA) && + (IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) ); } static const char *rna_function_string(void *func) @@ -484,7 +487,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr if(!manualfunc) { if(!dp->dnastructname || !dp->dnaname) { - fprintf(stderr, "rna_def_property_get_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s (0): %s.%s has no valid dna info.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; return NULL; } @@ -495,7 +499,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr if(prop->type == PROP_FLOAT) { if(IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) { if(prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */ - fprintf(stderr, "rna_def_property_get_func1: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); + fprintf(stderr, "%s (1): %s.%s is a '%s' but wrapped as type '%s'.\n", + __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); DefRNA.error= 1; return NULL; } @@ -503,7 +508,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else if(prop->type == PROP_INT || prop->type == PROP_BOOLEAN || prop->type == PROP_ENUM) { if(IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) { - fprintf(stderr, "rna_def_property_get_func2: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); + fprintf(stderr, "%s (2): %s.%s is a '%s' but wrapped as type '%s'.\n", + __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); DefRNA.error= 1; return NULL; } @@ -724,7 +730,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr if(!manualfunc) { if(!dp->dnastructname || !dp->dnaname) { if(prop->flag & PROP_EDITABLE) { - fprintf(stderr, "rna_def_property_set_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s has no valid dna info.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; } return NULL; @@ -902,7 +909,8 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA if(prop->type == PROP_STRING) { if(!manualfunc) { if(!dp->dnastructname || !dp->dnaname) { - fprintf(stderr, "rna_def_property_length_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s has no valid dna info.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; return NULL; } @@ -924,7 +932,8 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA else if(prop->type == PROP_COLLECTION) { if(!manualfunc) { if(prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) { - fprintf(stderr, "rna_def_property_length_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s has no valid dna info.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; return NULL; } @@ -959,7 +968,8 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA * if(!manualfunc) { if(!dp->dnastructname || !dp->dnaname) { - fprintf(stderr, "rna_def_property_begin_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s has no valid dna info.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; return NULL; } @@ -1270,7 +1280,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) pprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)pprop->get); pprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)pprop->set); if(!pprop->type) { - fprintf(stderr, "rna_def_property_funcs: %s.%s, pointer must have a struct type.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s, pointer must have a struct type.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; } break; @@ -1298,20 +1309,24 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) if(!(prop->flag & PROP_IDPROPERTY)) { if(!cprop->begin) { - fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a begin function.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s, collection must have a begin function.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; } if(!cprop->next) { - fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a next function.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s, collection must have a next function.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; } if(!cprop->get) { - fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a get function.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s, collection must have a get function.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; } } if(!cprop->item_type) { - fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a struct type.\n", srna->identifier, prop->identifier); + fprintf(stderr, "%s: %s.%s, collection must have a struct type.\n", + __func__, srna->identifier, prop->identifier); DefRNA.error= 1; } break; @@ -2136,19 +2151,22 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->flag & PROP_ENUM_FLAG) { if(eprop->defaultvalue & ~totflag) { - fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default includes unused bits (%d).\n", srna->identifier, errnest, prop->identifier, eprop->defaultvalue & ~totflag); + fprintf(stderr, "%s: %s%s.%s, enum default includes unused bits (%d).\n", + __func__, srna->identifier, errnest, prop->identifier, eprop->defaultvalue & ~totflag); DefRNA.error= 1; } } else { if(!defaultfound) { - fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default is not in items.\n", srna->identifier, errnest, prop->identifier); + fprintf(stderr, "%s: %s%s.%s, enum default is not in items.\n", + __func__, srna->identifier, errnest, prop->identifier); DefRNA.error= 1; } } } else { - fprintf(stderr, "rna_generate_structs: %s%s.%s, enum must have items defined.\n", srna->identifier, errnest, prop->identifier); + fprintf(stderr, "%s: %s%s.%s, enum must have items defined.\n", + __func__, srna->identifier, errnest, prop->identifier); DefRNA.error= 1; } break; @@ -2262,7 +2280,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; - } + } case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s, ", rna_function_string(fprop->get), rna_function_string(fprop->set), rna_function_string(fprop->getarray), rna_function_string(fprop->setarray), rna_function_string(fprop->range)); @@ -2276,7 +2294,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; - } + } case PROP_STRING: { StringPropertyRNA *sprop= (StringPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), rna_function_string(sprop->length), rna_function_string(sprop->set), sprop->maxlength); @@ -2299,7 +2317,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(pprop->type) fprintf(f, "&RNA_%s\n", (const char*)pprop->type); else fprintf(f, "NULL\n"); break; - } + } case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring), rna_function_string(cprop->assignint)); @@ -2421,7 +2439,8 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) fprintf(f, "\t%s,\n", rna_function_string(srna->idproperties)); if(srna->reg && !srna->refine) { - fprintf(stderr, "rna_generate_struct: %s has a register function, must also have refine function.\n", srna->identifier); + fprintf(stderr, "%s: %s has a register function, must also have refine function.\n", + __func__, srna->identifier); DefRNA.error= 1; } @@ -2841,7 +2860,7 @@ static int rna_preprocess(const char *outfile) file = fopen(deffile, "w"); if(!file) { - printf ("Unable to open file: %s\n", deffile); + fprintf(stderr, "Unable to open file: %s\n", deffile); status = 1; } else { @@ -2869,7 +2888,7 @@ static int rna_preprocess(const char *outfile) file = fopen(deffile, "w"); if(!file) { - printf ("Unable to open file: %s\n", deffile); + fprintf(stderr, "Unable to open file: %s\n", deffile); status = 1; } else { @@ -2898,7 +2917,7 @@ static int rna_preprocess(const char *outfile) file = fopen(deffile, "w"); if(!file) { - printf ("Unable to open file: %s\n", deffile); + fprintf(stderr, "Unable to open file: %s\n", deffile); status = 1; } else { @@ -2928,18 +2947,18 @@ int main(int argc, char **argv) int totblock, return_status = 0; if(argc<2) { - printf("Usage: %s outdirectory/\n", argv[0]); + fprintf(stderr, "Usage: %s outdirectory/\n", argv[0]); return_status = 1; } else { - printf("Running makesrna, program versions %s\n", RNA_VERSION_DATE); + fprintf(stderr, "Running makesrna, program versions %s\n", RNA_VERSION_DATE); makesrna_path= argv[0]; return_status= rna_preprocess(argv[1]); } totblock= MEM_get_memory_blocks_in_use(); if(totblock!=0) { - printf("Error Totblock: %d\n",totblock); + fprintf(stderr, "Error Totblock: %d\n",totblock); MEM_set_error_callback(mem_error_cb); MEM_printmemlist(); } diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index caf43793996..53944f7ec5c 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1628,6 +1628,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname) { PropertyDefRNA *dp; + FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; StructRNA *srna= DefRNA.laststruct; if(!DefRNA.preprocess) { @@ -1652,6 +1653,11 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons } } } + + if(dp->dnatype && strcmp(dp->dnatype, "char") == 0) { + fprop->hardmin= fprop->softmin= 0.0f; + fprop->hardmax= fprop->softmax= 1.0f; + } } rna_def_property_sdna(prop, structname, propname); diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index cc017738bd0..6b75f678c36 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -798,8 +798,8 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, /* float timestep; */ int *facepa=emd->facepa; int totdup=0,totvert=0,totface=0,totpart=0; - int i, v, mindex=0; - unsigned int ed_v1, ed_v2; + int i, v; + unsigned int ed_v1, ed_v2, mindex=0; MTFace *mtface = NULL, *mtf; totface= dm->getNumTessFaces(dm); diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c index 17e84e28c5f..8e7c13f16e6 100644 --- a/source/blender/modifiers/intern/MOD_remesh.c +++ b/source/blender/modifiers/intern/MOD_remesh.c @@ -1,27 +1,24 @@ /* -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2011 by Nicholas Bishop. -* -* ***** END GPL LICENSE BLOCK ***** -* -*/ + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2011 by Nicholas Bishop. + * + * ***** END GPL LICENSE BLOCK ***** + */ /** \file blender/modifiers/intern/MOD_remesh.c * \ingroup modifiers @@ -152,7 +149,7 @@ static DerivedMesh *applyModifier(ModifierData *md, DualConInput input; DerivedMesh *result; DualConFlags flags = 0; - DualConMode mode; + DualConMode mode = 0; rmd = (RemeshModifierData*)md; |