[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12838] trunk/blender: Merge from Harmonic Skeleton branch

Martin Poirier theeth at yahoo.com
Tue Dec 11 00:00:04 CET 2007


Hi,

That piece of hack was to compile ok on MSVC, it
should definitely be changed.

Change you try using this, see if it's better.

#ifdef WIN32
 #ifndef isnan
   #define isnan(n) _isnan(n)
 #endif
#endif

If it fixes it for you, feel free to commit.

Sorry for the breakage.

Martin

--- Joshua Leung <aligorith at gmail.com> wrote:

> Hi,
> 
> in BLI_arithb.h
> +#ifdef WIN32
> + #define isnan(n) _isnan(n)
> +#endif
> 
> This seems to be causing needless compiler warnings
> here,
> with mingw/gcc.
> 
> i.e.
> 
>    BLI_arithb.h  warning: "isnan" is redefined
>    math.h    warning: this is the location of the
> previous definition
> 
> Aligorith
> 
> 
> 
> On Dec 11, 2007 9:14 AM, Martin Poirier
> <theeth at yahoo.com> wrote:
> > Revision: 12838
> >         
>
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12838
> > Author:   theeth
> > Date:     2007-12-10 22:14:19 +0100 (Mon, 10 Dec
> 2007)
> >
> > Log Message:
> > -----------
> > Merge from Harmonic Skeleton branch
> >
> > This code adds a basic and simple skeleton
> generator.
> >
> > Examples and links are in the wiki, docs will come
> eventually:
>
http://wiki.blender.org/index.php/User:Theeth/skeletor
> >
> > In a nutshell, select a vertex at the top of the
> head and press "Generate Skeleton". UI Panel is in
> the Editing buttons in Edit Mode, tooltips and
> semi-useful.
> >
> > Modified Paths:
> > --------------
> >   
> trunk/blender/projectfiles_vc7/blender/blender.sln
> >   
>
trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj
> >   
> trunk/blender/source/blender/blenlib/BLI_arithb.h
> >   
>
trunk/blender/source/blender/blenloader/intern/readfile.c
> >   
>
trunk/blender/source/blender/include/BIF_editarmature.h
> >    trunk/blender/source/blender/include/butspace.h
> >   
>
trunk/blender/source/blender/makesdna/DNA_scene_types.h
> >   
> trunk/blender/source/blender/src/buttons_editing.c
> >    trunk/blender/source/blender/src/editarmature.c
> >
> > Added Paths:
> > -----------
> >    trunk/blender/source/blender/include/reeb.h
> >    trunk/blender/source/blender/src/reeb.c
> >
> > Modified:
> trunk/blender/projectfiles_vc7/blender/blender.sln
> >
>
===================================================================
> > ---
> trunk/blender/projectfiles_vc7/blender/blender.sln 
> 2007-12-10 21:04:48 UTC (rev 12837)
> > +++
> trunk/blender/projectfiles_vc7/blender/blender.sln 
> 2007-12-10 21:14:19 UTC (rev 12838)
> > @@ -248,8 +248,6 @@
> >                Debug = Debug
> >                Release = Release
> >        EndGlobalSection
> > -       GlobalSection(ProjectDependencies) =
> postSolution
> > -       EndGlobalSection
> >        GlobalSection(ProjectConfiguration) =
> postSolution
> >               
> {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin
> Debug.ActiveCfg = Blender Debug|Win32
> >               
> {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin
> Release.ActiveCfg = Blender Release|Win32
> >
> > Modified:
>
trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj
> >
>
===================================================================
> > ---
>
trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj
>    2007-12-10 21:04:48 UTC (rev 12837)
> > +++
>
trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj
>    2007-12-10 21:14:19 UTC (rev 12838)
> > @@ -476,6 +476,9 @@
> >                               
>
RelativePath="..\..\..\source\blender\src\prvicons.c">
> >                        </File>
> >                        <File
> > +                              
> RelativePath="..\..\..\source\blender\src\reeb.c">
> > +                       </File>
> > +                       <File
> >                               
>
RelativePath="..\..\..\source\blender\src\renderwin.c">
> >                        </File>
> >                        <File
> > @@ -888,6 +891,9 @@
> >                               
>
RelativePath="..\..\..\source\blender\include\playanim_ext.h">
> >                        </File>
> >                        <File
> > +                              
>
RelativePath="..\..\..\source\blender\include\reeb.h">
> > +                       </File>
> > +                       <File
> >                               
>
RelativePath="..\..\..\source\blender\include\transform.h">
> >                        </File>
> >                        <File
> >
> > Modified:
> trunk/blender/source/blender/blenlib/BLI_arithb.h
> >
>
===================================================================
> > ---
> trunk/blender/source/blender/blenlib/BLI_arithb.h  
> 2007-12-10 21:04:48 UTC (rev 12837)
> > +++
> trunk/blender/source/blender/blenlib/BLI_arithb.h  
> 2007-12-10 21:14:19 UTC (rev 12838)
> > @@ -54,6 +54,10 @@
> >  #define M_SQRT1_2      0.70710678118654752440
> >  #endif
> >
> > +#ifdef WIN32
> > +    #define isnan(n) _isnan(n)
> > +#endif
> > +
> >  #define MAT4_UNITY {{ 1.0, 0.0, 0.0, 0.0},\
> >                                        { 0.0, 1.0,
> 0.0, 0.0},\
> >                                        { 0.0, 0.0,
> 1.0, 0.0},\
> >
> > Modified:
>
trunk/blender/source/blender/blenloader/intern/readfile.c
> >
>
===================================================================
> > ---
>
trunk/blender/source/blender/blenloader/intern/readfile.c
>   2007-12-10 21:04:48 UTC (rev 12837)
> > +++
>
trunk/blender/source/blender/blenloader/intern/readfile.c
>   2007-12-10 21:14:19 UTC (rev 12838)
> > @@ -6652,7 +6652,7 @@
> >                                else
> >                                       
> wrld->ao_samp_method = WO_AOSAMP_HAMMERSLEY;
> >
> > -                              
> wrld->ao_adapt_thresh = 0.005;
> > +                              
> wrld->ao_adapt_thresh = 0.005f;
> >                        }
> >
> >                        for(la=main->lamp.first;
> la; la= la->id.next) {
> > @@ -6666,6 +6666,7 @@
> >                }
> >        }
> >        if(main->versionfile <= 245) {
> > +               Scene *sce;
> >                bScreen *sc;
> >                Object *ob;
> >                Image *ima;
> > @@ -6838,6 +6839,27 @@
> >                for(part=main->particle.first;
> part; part=part->id.next)
> >                        if(part->ren_child_nbr==0)
> >                               
> part->ren_child_nbr= part->child_nbr;
> > +               if (main->versionfile < 245 ||
> main->subversionfile < 11)
> > +               {
> > +                       /* initialize skeleton
> generation toolsettings */
> > +                       for(sce=main->scene.first;
> sce; sce = sce->id.next)
> > +                       {
> > +                              
> sce->toolsettings->skgen_resolution = 50;
> > +                              
> sce->toolsettings->skgen_threshold_internal     =
> 0.01f;
> > +                              
> sce->toolsettings->skgen_threshold_external     =
> 0.01f;
> > +                              
> sce->toolsettings->skgen_angle_limit                
>    = 45.0f;
> > +                              
> sce->toolsettings->skgen_length_ratio               
>    = 1.3f;
> > +                              
> sce->toolsettings->skgen_length_limit               
>    = 1.5f;
> > +                              
> sce->toolsettings->skgen_correlation_limit          
>    = 0.98f;
> > +                              
> sce->toolsettings->skgen_symmetry_limit             
>    = 0.1f;
> > +                              
> sce->toolsettings->skgen_postpro = SKGEN_SMOOTH;
> > +                              
> sce->toolsettings->skgen_postpro_passes = 1;
> > +                              
> sce->toolsettings->skgen_options =
>
SKGEN_FILTER_INTERNAL|SKGEN_FILTER_EXTERNAL|SKGEN_SUB_CORRELATION;
> > +                              
> sce->toolsettings->skgen_subdivisions[0] =
> SKGEN_SUB_CORRELATION;
> > +                              
> sce->toolsettings->skgen_subdivisions[1] =
> SKGEN_SUB_LENGTH;
> > +                              
> sce->toolsettings->skgen_subdivisions[2] =
> SKGEN_SUB_ANGLE;
> > +                       }
> > +               }
> >        }
> >
> >        if ((main->versionfile < 245) ||
> (main->versionfile == 245 && main->subversionfile <
> 2)) {
> >
> > Modified:
>
trunk/blender/source/blender/include/BIF_editarmature.h
> >
>
===================================================================
> > ---
>
trunk/blender/source/blender/include/BIF_editarmature.h
>     2007-12-10 21:04:48 UTC (rev 12837)
> > +++
>
trunk/blender/source/blender/include/BIF_editarmature.h
>     2007-12-10 21:14:19 UTC (rev 12838)
> > @@ -101,6 +101,8 @@
> >
> >  int            do_pose_selectbuffer(struct Base
> *base, unsigned int *buffer, short hits);
> >
> > +void generateSkeleton(void);
> > +
> >  void   mouse_armature(void);
> >  void   remake_editArmature(void);
> >  void   selectconnected_armature(void);
> > @@ -117,8 +119,8 @@
> >  void   hide_unselected_pose_bones(void);
> >  void   show_all_pose_bones(void);
> >
> > -int            bone_looper(Object *ob, struct
> Bone *bone, void *data,
> > -                               int
> (*bone_func)(Object *, struct Bone *, void *));
> > +int            bone_looper(struct Object *ob,
> struct Bone *bone, void *data,
> > +                               int
> (*bone_func)(struct Object *, struct Bone *, void
> *));
> >
> >  void   undo_push_armature(char *name);
> >  void   armature_bone_rename(struct bArmature
> *arm, char *oldname, char *newname);
> >
> > Modified:
> trunk/blender/source/blender/include/butspace.h
> >
>
===================================================================
> > ---
> trunk/blender/source/blender/include/butspace.h    
> 2007-12-10 21:04:48 UTC (rev 12837)
> > +++
> trunk/blender/source/blender/include/butspace.h    
> 2007-12-10 21:14:19 UTC (rev 12838)
> > @@ -420,6 +420,8 @@
> >  #define B_SETTFACE_RND         2082
> >  #define B_SETMCOL_RND          2083
> >
> > +#define B_GEN_SKELETON         2090
> > +
> >  /* *********************** */
> >  #define B_VGROUPBUTS           2100
> >
> >
> > Copied:
> trunk/blender/source/blender/include/reeb.h (from
> rev 12836,
>
branches/harmonic-skeleton/blender/source/blender/include/reeb.h)
> >
>
===================================================================
> > --- trunk/blender/source/blender/include/reeb.h   
>                      (rev 0)
> > +++ trunk/blender/source/blender/include/reeb.h
> 2007-12-10 21:14:19 UTC (rev 12838)
> > @@ -0,0 +1,127 @@
> > +/**
> > + * $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. The Blender
> > + * Foundation also sells licenses for use in
> proprietary software under
> > + * the Blender License.  See
> http://www.blender.org/BL/ for information
> > + * about this.
> > + *
> > + * 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., 59 Temple Place - Suite 330, Boston, MA 
> 02111-1307, USA.
> > + *
> > + * Contributor(s): Martin Poirier
> > + *
> > + * ***** END GPL LICENSE BLOCK *****
> > + */
> > +
> > +#ifndef REEB_H_
> > +#define REEB_H_
> > +
> > +#include "DNA_listBase.h"
> > +
> > +struct EdgeHash;
> > +struct ReebArc;
> > +struct ReebEdge;
> > +struct ReebNode;
> > +
> > +typedef struct ReebGraph {
> > +       ListBase arcs;
> > +       ListBase nodes;
> > +       int totnodes;
> > +       struct EdgeHash *emap;
> > +} ReebGraph;
> > +
> > +typedef struct EmbedBucket {
> > +       float val;
> > +       int       nv;
> > +       float p[3];
> > +} EmbedBucket;
> > +
> > +typedef struct ReebNode {
> > +       struct ReebNode *next, *prev;
> > +       struct ReebArc **arcs;
> > +       int index;
> > +       int degree;
> > +       float weight;
> > +       float p[3];
> > +       int flags;
> > +} ReebNode;
> > +
> > +typedef struct ReebEdge {
> > +       struct ReebEdge *next, *prev;
> > +       struct ReebArc  *arc;
> > +       struct ReebNode *v1, *v2;
> > +       struct ReebEdge *nextEdge;
> > +} ReebEdge;
> > +
> > +typedef struct ReebArc {
> > +       struct ReebArc *next, *prev;
> > +       ListBase edges;
> > +       struct ReebNode *v1, *v2;
> > +       struct EmbedBucket *buckets;
> > +       int     bcount;
> > +       int flags;
> > +} ReebArc;
> > +
> > +typedef struct ReebArcIterator {
> > +       struct ReebArc  *arc;
> > +       int index;
> > +       int start;
> > +       int end;
> > +       int stride;
> > +} ReebArcIterator;
> > +
> > +struct EditMesh;
> > +
> > +int weightToHarmonic(struct EditMesh *em);
> > +int weightFromDistance(struct EditMesh *em);
> > +int weightFromLoc(struct EditMesh *me, int axis);
> > +void weightToVCol(struct EditMesh *em);
> > +void renormalizeWeight(struct EditMesh *em, float
> newmax);
> > +
> > +ReebGraph * generateReebGraph(struct EditMesh
> *me, int subdivisions);
> > +void freeGraph(ReebGraph *rg);
> > +void exportGraph(ReebGraph *rg, int count);
> > +
> > +#define OTHER_NODE(arc, node) ((arc->v1 == node)
> ? arc->v2 : arc->v1)
> > +
> > +void initArcIterator(struct ReebArcIterator
> *iter, struct ReebArc *arc, struct ReebNode *head);
> > +void initArcIterator2(struct ReebArcIterator
> *iter, struct ReebArc *arc, int start, int end);
> > +struct EmbedBucket * nextBucket(struct
> ReebArcIterator *iter);
> > +
> > +/* Filtering */
> > +void filterNullReebGraph(ReebGraph *rg);
> > +int filterExternalReebGraph(ReebGraph *rg, float
> threshold);
> > +int filterInternalReebGraph(ReebGraph *rg, float
> threshold);
> > +
> > +/* Post-Build processing */
> > +void repositionNodes(ReebGraph *rg);
> > +void postprocessGraph(ReebGraph *rg, char mode);
> > +void removeNormalNodes(ReebGraph *rg);
> > +
> > +/* Graph processing */
> > +void buildAdjacencyList(ReebGraph *rg);
> > +
> > +void sortNodes(ReebGraph *rg);
> > +void sortArcs(ReebGraph *rg);
> > +
> > +int subtreeDepth(ReebNode *node, ReebArc
> *rootArc);
> > +int countConnectedArcs(ReebGraph *rg, ReebNode
> *node);
> > +int hasAdjacencyList(ReebGraph *rg);
> > +int    isGraphCyclic(ReebGraph *rg);
> > +
> > +/* Sanity check */
> > +void verifyBuckets(ReebGraph *rg);
> > +
> > +#endif /*REEB_H_*/
> >
> > Modified:
>
trunk/blender/source/blender/makesdna/DNA_scene_types.h
> >
>
===================================================================
> > ---
>
trunk/blender/source/blender/makesdna/DNA_scene_types.h
>     2007-12-10 21:04:48 UTC (rev 12837)
> > +++
>
trunk/blender/source/blender/makesdna/DNA_scene_types.h
>     2007-12-10 21:14:19 UTC (rev 12838)
> > @@ -364,7 +364,7 @@
> >        short uvcalc_flag;
> >
> >        short pad2;
> > -
> > +
> >        /* Image Paint (8 byte aligned please!) */
> >        struct ImagePaintSettings imapaint;
> >
> > @@ -385,7 +385,21 @@
> >        /* Multires */
> >        char multires_subdiv_type;
> >
> > -       char  pad4[2];
> > +       /* Skeleton generation */
> > +       short skgen_resolution;
> > +       float skgen_threshold_internal;
> > +       float skgen_threshold_external;
> > +       float skgen_length_ratio;
> > +       float skgen_length_limit;
> > +       float skgen_angle_limit;
> > +       float skgen_correlation_limit;
> > +       float skgen_symmetry_limit;
> > +       short skgen_options;
> > +       char  skgen_postpro;
> > +       char  skgen_postpro_passes;
> > +       char  skgen_subdivisions[3];
> > +
> > +       char pad3[5];
> >  } ToolSettings;
> >
> >  /* Used by all brushes to store their properties,
> which can be directly set
> >
> > @@ Diff output truncated at 10240 characters. @@
> >
> > _______________________________________________
> > Bf-blender-cvs mailing list
> > Bf-blender-cvs at blender.org
> >
>
http://lists.blender.org/mailman/listinfo/bf-blender-cvs
> >
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
>
http://lists.blender.org/mailman/listinfo/bf-committers
> 



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping


More information about the Bf-committers mailing list