[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15686] branches/soc-2008-mxcurioni/source /blender/freestyle: soc-2008-mxcurioni: filled and tested StrokeVertex class
Revision: 15686 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15686 Author: mxcurioni Date: 2008-07-22 10:15:21 +0200 (Tue, 22 Jul 2008) Log Message: --- soc-2008-mxcurioni: filled and tested StrokeVertex class Modified Paths: -- branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.cpp branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.h branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/StrokeVertex.cpp branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/StrokeVertex.h branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D.cpp Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript === --- branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 2008-07-22 00:27:40 UTC (rev 15685) +++ branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 2008-07-22 08:15:21 UTC (rev 15686) @@ -68,7 +68,7 @@ prefix + '/IntegrationType.cpp', prefix + '/Interface0D.cpp', prefix + '/Interface0D/CurvePoint.cpp', - # prefix + '/Interface0D/CurvePoint/StrokeVertex.cpp', + prefix + '/Interface0D/CurvePoint/StrokeVertex.cpp', prefix + '/Interface0D/SVertex.cpp', prefix + '/Interface0D/ViewVertex.cpp', prefix + '/Interface1D.cpp', Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.cpp === --- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.cpp 2008-07-22 00:27:40 UTC (rev 15685) +++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.cpp 2008-07-22 08:15:21 UTC (rev 15686) @@ -75,6 +75,13 @@ return py_n; } +PyObject * BPy_StrokeAttribute_from_StrokeAttribute( StrokeAttribute sa ) { + PyObject *py_sa = StrokeAttribute_Type.tp_new( StrokeAttribute_Type, 0, 0 ); + ((BPy_StrokeAttribute *) py_sa)-sa = new StrokeAttribute( sa ); + + return py_sa; +} + /// #ifdef __cplusplus Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.h === --- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.h 2008-07-22 00:27:40 UTC (rev 15685) +++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.h 2008-07-22 08:15:21 UTC (rev 15686) @@ -10,6 +10,7 @@ #include Interface0D/SVertex.h #include Interface1D/FEdge.h #include Nature.h +#include StrokeAttribute.h #ifdef __cplusplus extern C { @@ -27,11 +28,12 @@ PyObject * Vector_from_Vec3f( Vec3f v ); PyObject * Vector_from_Vec3r( Vec3r v ); +PyObject * BPy_FEdge_from_FEdge( FEdge fe ); PyObject * BPy_Id_from_Id( Id id ); -PyObject * BPy_SVertex_from_SVertex( SVertex sv ); -PyObject * BPy_FEdge_from_FEdge( FEdge fe ); PyObject * BPy_Interface0D_from_Interface0D( Interface0D if0D ); PyObject * BPy_Nature_from_Nature( unsigned short n ); +PyObject * BPy_StrokeAttribute_from_StrokeAttribute( StrokeAttribute sa ); +PyObject * BPy_SVertex_from_SVertex( SVertex sv ); /// Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/StrokeVertex.cpp === --- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/StrokeVertex.cpp 2008-07-22 00:27:40 UTC (rev 15685) +++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/StrokeVertex.cpp 2008-07-22 08:15:21 UTC (rev 15686) @@ -1,6 +1,7 @@ #include StrokeVertex.h #include ../../Convert.h +#include ../../StrokeAttribute.h #ifdef __cplusplus extern C { @@ -11,10 +12,36 @@ /*--- Python API function prototypes for StrokeVertex instance ---*/ static int StrokeVertex___init__(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds); +static PyObject * StrokeVertex_x( BPy_StrokeVertex *self ); +static PyObject * StrokeVertex_y( BPy_StrokeVertex *self ); +static PyObject * StrokeVertex_getPoint( BPy_StrokeVertex *self ); +static PyObject * StrokeVertex_attribute( BPy_StrokeVertex
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15687] trunk/blender/source/blender: == Grease Pencil ==
Revision: 15687 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15687 Author: aligorith Date: 2008-07-22 11:53:25 +0200 (Tue, 22 Jul 2008) Log Message: --- == Grease Pencil == Grease Pencil is a tool which allows you to draw freehand in some views, allowing you to annotate/scribble over the contents of that view in either 2d or 3d. This facilitates many easier communication and planning abilities. To use, simply enable it from the View menu (choose 'Grease Pencil...' and click 'Use Grease Pencil'). Then, click+drag using the left-mouse button and the shift-key held to draw a stroke. For more information, check the following page on the wiki: http://wiki.blender.org/index.php/User:Aligorith/247_Grease_Pencil Modified Paths: -- trunk/blender/source/blender/blenkernel/BKE_global.h trunk/blender/source/blender/blenloader/intern/readfile.c trunk/blender/source/blender/blenloader/intern/writefile.c trunk/blender/source/blender/include/BDR_drawaction.h trunk/blender/source/blender/include/BIF_editaction.h trunk/blender/source/blender/include/BIF_space.h trunk/blender/source/blender/include/BSE_editaction_types.h trunk/blender/source/blender/include/transform.h trunk/blender/source/blender/makesdna/DNA_action_types.h trunk/blender/source/blender/makesdna/DNA_space_types.h trunk/blender/source/blender/makesdna/DNA_view3d_types.h trunk/blender/source/blender/makesdna/intern/makesdna.c trunk/blender/source/blender/src/drawaction.c trunk/blender/source/blender/src/drawnode.c trunk/blender/source/blender/src/drawseq.c trunk/blender/source/blender/src/drawview.c trunk/blender/source/blender/src/editaction.c trunk/blender/source/blender/src/editnode.c trunk/blender/source/blender/src/header_action.c trunk/blender/source/blender/src/header_node.c trunk/blender/source/blender/src/header_seq.c trunk/blender/source/blender/src/header_view3d.c trunk/blender/source/blender/src/interface.c trunk/blender/source/blender/src/space.c trunk/blender/source/blender/src/transform_conversions.c trunk/blender/source/blender/src/transform_generics.c Added Paths: --- trunk/blender/source/blender/include/BDR_gpencil.h trunk/blender/source/blender/include/BIF_drawgpencil.h trunk/blender/source/blender/makesdna/DNA_gpencil_types.h trunk/blender/source/blender/src/drawgpencil.c trunk/blender/source/blender/src/editaction_gpencil.c trunk/blender/source/blender/src/gpencil.c Modified: trunk/blender/source/blender/blenkernel/BKE_global.h === --- trunk/blender/source/blender/blenkernel/BKE_global.h2008-07-22 08:15:21 UTC (rev 15686) +++ trunk/blender/source/blender/blenkernel/BKE_global.h2008-07-22 09:53:25 UTC (rev 15687) @@ -175,6 +175,7 @@ #define G_WEIGHTPAINT (1 15) #define G_TEXTUREPAINT (1 16) /* #define G_NOFROZEN (1 17) also removed */ +#define G_GREASEPENCIL (1 17) #define G_DRAWEDGES(1 18) #define G_DRAWCREASES (1 19) #define G_DRAWSEAMS (1 20) @@ -265,3 +266,4 @@ #endif + Modified: trunk/blender/source/blender/blenloader/intern/readfile.c === --- trunk/blender/source/blender/blenloader/intern/readfile.c 2008-07-22 08:15:21 UTC (rev 15686) +++ trunk/blender/source/blender/blenloader/intern/readfile.c 2008-07-22 09:53:25 UTC (rev 15687) @@ -69,6 +69,7 @@ #include DNA_effect_types.h #include DNA_fileglobal_types.h #include DNA_group_types.h +#include DNA_gpencil_types.h #include DNA_ipo_types.h #include DNA_image_types.h #include DNA_key_types.h @@ -3698,6 +3699,32 @@ /* READ SCREEN * */ +/* relinks grease-pencil data for 3d-view(s) - used for direct_link */ +static void link_gpencil(FileData *fd, bGPdata *gpd) +{ + bGPDlayer *gpl; + bGPDframe *gpf; + bGPDstroke *gps; + + /* relink layers */ + link_list(fd, gpd-layers); + + for (gpl= gpd-layers.first; gpl; gpl= gpl-next) { + /* relink frames */ + link_list(fd, gpl-frames); + gpl-actframe= newdataadr(fd, gpl-actframe); + + for (gpf= gpl-frames.first; gpf; gpf= gpf-next) { + /* relink strokes (and their points) */ + link_list(fd, gpf-strokes); + + for (gps= gpf-strokes.first; gps; gps= gps-next) { + gps-points= newdataadr(fd, gps-points); + } + } + } +} + /* note: file read without screens option G_FILE_NO_UI; check lib pointers in call below */ static void lib_link_screen(FileData *fd, Main *main) @@ -3709,23 +3736,23 @@
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15688] branches/soc-2008-jaguarandi/ source/blender: *BVHTreeFromMesh api changed..
Revision: 15688 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15688 Author: jaguarandi Date: 2008-07-22 13:50:50 +0200 (Tue, 22 Jul 2008) Log Message: --- *BVHTreeFromMesh api changed.. it now stores all information like defaults callbacks to raycast and nearest surface (just to make it easier to use) *Fixed button size of Above surface Modified Paths: -- branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_shrinkwrap.h branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c branches/soc-2008-jaguarandi/source/blender/src/buttons_editing.c Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_shrinkwrap.h === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_shrinkwrap.h 2008-07-22 09:53:25 UTC (rev 15687) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_shrinkwrap.h 2008-07-22 11:50:50 UTC (rev 15688) @@ -61,11 +61,46 @@ void space_transform_apply_normal (const SpaceTransform *data, float *co); void space_transform_invert_normal(const SpaceTransform *data, float *co); +/* BVH from mesh */ +#include BLI_kdopbvh.h +struct DerivedMesh; +struct MVert; +struct MFace; + +//struct that kepts basic information about a BVHTree build from a mesh +typedef struct BVHTreeFromMesh +{ + struct BVHTree *tree; + + //Callbacks + BVHTree_NearestPointCallback nearest_callback; + BVHTree_RayCastCallback raycast_callback; + + //Mesh represented on this BVH + struct DerivedMesh *mesh; + struct MVert *vert; + struct MFace *face; + + //radius for sphere cast + float sphere_radius; + +} BVHTreeFromMesh; + +// Builds a bvh tree where nodes are the vertexs of the given mesh. And configures BVHMesh if one given. +struct BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); + +// Builds a bvh tree where nodes are the faces of the given mesh. And configures BVHMesh if one is given. +struct BVHTree* bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); + + + + /* Shrinkwrap stuff */ struct Object; struct DerivedMesh; struct ShrinkwrapModifierData; +struct BVHTree; @@ -75,6 +110,9 @@ struct Object *ob; //object we are applying shrinkwrap to struct DerivedMesh *original; //mesh before shrinkwrap (TODO clean this variable.. we don't really need it) + struct BVHTree *original_tree; //BVHTree build with the original mesh (to be used on kept volume) + struct BVHMeshCallbackUserdata *callback; + struct DerivedMesh *final; //initially a copy of original mesh.. mesh thats going to be shrinkwrapped struct DerivedMesh *target; //mesh we are shrinking to Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-07-22 09:53:25 UTC (rev 15687) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-07-22 11:50:50 UTC (rev 15688) @@ -104,7 +104,7 @@ else return mesh_get_derived_final(ob, dataMask); } - + /* ray - triangle */ #define ISECT_EPSILON 1e-6 static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) @@ -167,39 +167,25 @@ /* - * BVH tree from mesh vertices + * BVH Tree from Mesh */ -typedef struct BVHMeshCallbackUserdata -{ - //Mesh represented on this BVH - DerivedMesh *mesh; - MVert *vert; - MFace *face; +//callbacks +static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest); +static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); - //radius for sphere cast - float sphere_radius; - -} BVHMeshCallbackUserdata; - - -static void bvhtree_meshcallbackdata_init(BVHMeshCallbackUserdata *data, DerivedMesh *mesh, float cast_radius) -{ - data-mesh = mesh; - data-vert = mesh-getVertDataArray(mesh, CD_MVERT); - data-face = mesh-getFaceDataArray(mesh, CD_MFACE); - data-sphere_radius = cast_radius; -} - /* * Builds a bvh tree.. where nodes are the vertexs of the given mesh */ -static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon, int tree_type, int axis) +BVHTree* bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) { int i; int numVerts= mesh-getNumVerts(mesh); MVert *vert =
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15690] branches/apricot/source: Apricot Branch: GLSL
Revision: 15690 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15690 Author: blendix Date: 2008-07-22 16:33:10 +0200 (Tue, 22 Jul 2008) Log Message: --- Apricot Branch: GLSL Added support for some world settings, updated docs. * Ambient color * Exposure/Range * Mist (implementation should be optimized) http://www.blender.org/development/current-projects/changes-since-246/realtime-glsl-materials/ Modified Paths: -- branches/apricot/source/blender/gpu/GPU_draw.h branches/apricot/source/blender/gpu/intern/gpu_material.c branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp Modified: branches/apricot/source/blender/gpu/GPU_draw.h === --- branches/apricot/source/blender/gpu/GPU_draw.h 2008-07-22 12:02:57 UTC (rev 15689) +++ branches/apricot/source/blender/gpu/GPU_draw.h 2008-07-22 14:33:10 UTC (rev 15690) @@ -46,7 +46,11 @@ * shared with the game engine, where there were previously * duplicates of some of these functions. */ -/* Initialize */ +/* Initialize + * - sets the default Blender opengl state, if in doubt, check + * the contents of this function + * - this is called when starting Blender, for opengl rendering, + * and for switching back from the game engine for example. */ void GPU_state_init(void); @@ -94,7 +98,8 @@ void GPU_set_linear_mipmap(int linear); void GPU_paint_set_mipmap(int mipmap); -/* Image opengl free and update */ +/* Image updates and free + * - these deal with images bound as opengl textures */ void GPU_paint_update_image(struct Image *ima, int x, int y, int w, int h); void GPU_update_images_framechange(void); Modified: branches/apricot/source/blender/gpu/intern/gpu_material.c === --- branches/apricot/source/blender/gpu/intern/gpu_material.c 2008-07-22 12:02:57 UTC (rev 15689) +++ branches/apricot/source/blender/gpu/intern/gpu_material.c 2008-07-22 14:33:10 UTC (rev 15690) @@ -42,6 +42,7 @@ #include DNA_scene_types.h #include DNA_texture_types.h #include DNA_view3d_types.h +#include DNA_world_types.h #include BKE_colortools.h #include BKE_DerivedMesh.h @@ -1000,9 +1001,11 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr) { + GPUMaterial *mat= shi-gpumat; + GPUNodeLink *emit, *ulinfac, *ulogfac, *mistfac; Material *ma= shi-mat; - GPUMaterial *mat= shi-gpumat; - GPUNodeLink *emit; + World *world= mat-scene-world; + float linfac, logfac, misttype; memset(shr, 0, sizeof(*shr)); @@ -1037,6 +1040,29 @@ shr-combined = shr-diff; shr-alpha = shi-alpha; + if(world) { + /* exposure correction */ + if(world-exp!=0.0f || world-range!=1.0f) { + linfac= 1.0 + pow((2.0*world-exp + 0.5), -10); + logfac= log((linfac-1.0)/linfac)/world-range; + + GPU_link(mat, set_value, GPU_uniform(linfac), ulinfac); + GPU_link(mat, set_value, GPU_uniform(logfac), ulogfac); + + GPU_link(mat, shade_exposure_correct, shr-combined, + ulinfac, ulogfac, shr-combined); + GPU_link(mat, shade_exposure_correct, shr-spec, + ulinfac, ulogfac, shr-spec); + } + + /* ambient color */ + if(world-ambr!=0.0f || world-ambg!=0.0f || world-ambb!=0.0f) { + if(GPU_link_changed(shi-amb) || ma-amb != 0.0f) + GPU_link(mat, shade_maddf, shr-combined, GPU_uniform(ma-amb), + GPU_uniform(world-ambr), shr-combined); + } + } + if(ma-mode MA_RAMP_COL) ramp_diffuse_result(shi, shr-combined); if(ma-mode MA_RAMP_SPEC) ramp_spec_result(shi, shr-spec); @@ -1044,6 +1070,17 @@ GPU_link(mat, shade_add, shr-combined, shr-spec, shr-combined); } + if(world (world-mode WO_MIST) !(ma-mode MA_NOMIST)) { + misttype = world-mistype; + + GPU_link(mat, shade_mist_factor, GPU_builtin(GPU_VIEW_POSITION), + GPU_uniform(world-miststa), GPU_uniform(world-mistdist), + GPU_uniform(misttype), GPU_uniform(world-misi), mistfac); + + GPU_link(mat, mix_blend, mistfac, GPU_uniform(world-horr), + shr-combined,
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15691] branches/soc-2008-quorn/intern/ ghost/intern/GHOST_SystemWin32.cpp: Bugfix: Pasting non-text data ( or trying to retrieve non-text data from t
Revision: 15691 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15691 Author: quorn Date: 2008-07-22 16:56:02 +0200 (Tue, 22 Jul 2008) Log Message: --- Bugfix: Pasting non-text data (or trying to retrieve non-text data from the clipboard) crashed blender on Windows. Modified Paths: -- branches/soc-2008-quorn/intern/ghost/intern/GHOST_SystemWin32.cpp Modified: branches/soc-2008-quorn/intern/ghost/intern/GHOST_SystemWin32.cpp === --- branches/soc-2008-quorn/intern/ghost/intern/GHOST_SystemWin32.cpp 2008-07-22 14:33:10 UTC (rev 15690) +++ branches/soc-2008-quorn/intern/ghost/intern/GHOST_SystemWin32.cpp 2008-07-22 14:56:02 UTC (rev 15691) @@ -919,6 +919,8 @@ if ( OpenClipboard(NULL) ) { HANDLE hData = GetClipboardData( CF_TEXT ); + if (hData == NULL) + return NULL; buffer = (char*)GlobalLock( hData ); temp_buff = (char*) malloc(strlen(buffer)+1); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15692] branches/soc-2008-quorn/intern/ ghost/intern/GHOST_SystemWin32.cpp: Bug fix for the bug fix.
Revision: 15692 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15692 Author: quorn Date: 2008-07-22 17:31:22 +0200 (Tue, 22 Jul 2008) Log Message: --- Bug fix for the bug fix. Wasn't closing the clipboard before returning. Thanks b333rt for catching this. Modified Paths: -- branches/soc-2008-quorn/intern/ghost/intern/GHOST_SystemWin32.cpp Modified: branches/soc-2008-quorn/intern/ghost/intern/GHOST_SystemWin32.cpp === --- branches/soc-2008-quorn/intern/ghost/intern/GHOST_SystemWin32.cpp 2008-07-22 14:56:02 UTC (rev 15691) +++ branches/soc-2008-quorn/intern/ghost/intern/GHOST_SystemWin32.cpp 2008-07-22 15:31:22 UTC (rev 15692) @@ -917,10 +917,12 @@ char *buffer; char *temp_buff; - if ( OpenClipboard(NULL) ) { + if ( IsClipboardFormatAvailable(CF_TEXT) OpenClipboard(NULL) ) { HANDLE hData = GetClipboardData( CF_TEXT ); - if (hData == NULL) + if (hData == NULL) { + CloseClipboard(); return NULL; + } buffer = (char*)GlobalLock( hData ); temp_buff = (char*) malloc(strlen(buffer)+1); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15694] branches/soc-2008-nicholasbishop/ source/blender/blenkernel/intern/modifier.c: Added a copy function for the multires modifier, so duplicating
Revision: 15694 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15694 Author: nicholasbishop Date: 2008-07-22 18:38:50 +0200 (Tue, 22 Jul 2008) Log Message: --- Added a copy function for the multires modifier, so duplicating a mesh with multires works now. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c 2008-07-22 15:52:55 UTC (rev 15693) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c 2008-07-22 16:38:50 UTC (rev 15694) @@ -7211,6 +7211,15 @@ mmd-lvl = mmd-totlvl = 1; } +static void multiresModifier_copyData(ModifierData *md, ModifierData *target) +{ + MultiresModifierData *mmd = (MultiresModifierData*) md; + MultiresModifierData *tmmd = (MultiresModifierData*) target; + + tmmd-totlvl = mmd-totlvl; + tmmd-lvl = mmd-lvl; +} + static DerivedMesh *multiresModifier_applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { @@ -7547,6 +7556,7 @@ mti-type = eModifierTypeType_Constructive; mti-flags = eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_RequiresOriginalData; mti-initData = multiresModifier_initData; + mti-copyData = multiresModifier_copyData; mti-applyModifier = multiresModifier_applyModifier; typeArrInit = 0; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15695] trunk/blender/source/gameengine/ Ketsji/KX_GameObject.cpp: BGE patch: update KX_GameObject::getChildren() to use CListValue instead of python
Revision: 15695 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15695 Author: ben2610 Date: 2008-07-22 18:44:35 +0200 (Tue, 22 Jul 2008) Log Message: --- BGE patch: update KX_GameObject::getChildren() to use CListValue instead of python list (allows name search keep refcount consistent) Modified Paths: -- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp === --- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-07-22 16:38:50 UTC (rev 15694) +++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-07-22 16:44:35 UTC (rev 15695) @@ -1306,18 +1306,18 @@ } -static void walk_children(SG_Node* node, PyObject *list, bool recursive) +static void walk_children(SG_Node* node, CListValue* list, bool recursive) { NodeList children = node-GetSGChildren(); for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit) { SG_Node* childnode = (*childit); - KX_GameObject* childobj = (KX_GameObject*)childnode-GetSGClientObject(); + CValue* childobj = (CValue*)childnode-GetSGClientObject(); if (childobj != NULL) // This is a GameObject { // add to the list - PyList_Append(list, (PyObject *)childobj); + list-Add(childobj-AddRef()); } // if the childobj is NULL then this may be an inverse parent link @@ -1330,14 +1330,14 @@ PyObject* KX_GameObject::PyGetChildren(PyObject* self) { - PyObject * list = PyList_New(0); + CListValue* list = new CListValue(); walk_children(m_pSGNode, list, 0); return list; } PyObject* KX_GameObject::PyGetChildrenRecursive(PyObject* self) { - PyObject * list = PyList_New(0); + CListValue* list = new CListValue(); walk_children(m_pSGNode, list, 1); return list; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15696] branches/soc-2008-nicholasbishop/ source/blender: Added a reshape button to the multires modifier.
Revision: 15696 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15696 Author: nicholasbishop Date: 2008-07-22 19:03:44 +0200 (Tue, 22 Jul 2008) Log Message: --- Added a reshape button to the multires modifier. It copies the vertices from another selected mesh into the current level. Allows indirect editing of multires levels other than the base in editmode, and more importantly allows for editing multires levels in other programs. Of course, vertex order and overall topology must match. Additionally, the copy is only exact for the first and last level. All other levels will do the usual catmull-clark subdivision. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-07-22 16:44:35 UTC (rev 15695) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-07-22 17:03:44 UTC (rev 15696) @@ -131,6 +131,7 @@ void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob); void multiresModifier_setLevel(void *mmd_v, void *ob_v); +int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src); void multires_displacer_init(MultiresDisplacer *d, struct DerivedMesh *dm, const int face_index, const int invert); Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-07-22 16:44:35 UTC (rev 15695) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-07-22 17:03:44 UTC (rev 15696) @@ -1365,8 +1365,28 @@ } } +/* Returns 0 on success, 1 if the src's totvert doesn't match */ +int multiresModifier_reshape(MultiresModifierData *mmd, Object *dst, Object *src) +{ + Mesh *src_me = get_mesh(src); + DerivedMesh *mrdm = dst-derivedFinal; + if(mrdm mrdm-getNumVerts(mrdm) == src_me-totvert) { + MVert *mvert = CDDM_get_verts(mrdm); + int i; + for(i = 0; i src_me-totvert; ++i) + VecCopyf(mvert[i].co, src_me-mvert[i].co); + mrdm-needsFree = 1; + mrdm-release(mrdm); + dst-derivedFinal = NULL; + + return 0; + } + + return 1; +} + static void multiresModifier_update(DerivedMesh *dm) { MDisps *mdisps; Modified: branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c === --- branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c 2008-07-22 16:44:35 UTC (rev 15695) +++ branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c 2008-07-22 17:03:44 UTC (rev 15696) @@ -1671,6 +1671,27 @@ } } +static void multiresModifier_reshape_button(void *mmd_v, void *ob_v) +{ + MultiresModifierData *mmd = mmd_v; + if(mmd ob_v) { + Base *base = FIRSTBASE; + if(base base-object != ob_v) { + Object *src = base-object; + if(src-type == OB_MESH) { + if(multiresModifier_reshape(mmd, ob_v, src)) + error(Vertex count mismatch); + else + BIF_undo_push(Multires reshape); + } + else + error(Second selection not a mesh); + } + else + error(Second selection required); + } +} + static int modifier_is_fluid_particles(ModifierData *md) { if(md-type == eModifierType_ParticleSystem) { if(((ParticleSystemModifierData *)md)-psys-part-type == PART_FLUID) @@ -1841,7 +1862,7 @@ } else if (md-type==eModifierType_Explode) { height = 94; } else if (md-type==eModifierType_Multires) { - height = 48; + height = 72; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, , x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ); @@ -2471,6 +2492,10 @@ but =
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15697] branches/harmonic-skeleton/source/ blender: First draft for control bones repositioning.
Revision: 15697 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15697 Author: theeth Date: 2008-07-22 19:44:06 +0200 (Tue, 22 Jul 2008) Log Message: --- First draft for control bones repositioning. All bones marked as no deform are repositioned after the retarget based on their linked bone (linked bone is constraint owner if control bone is a target, parent bone if not). Arithb: Function to make a quat between two normalized vectors Modified Paths: -- branches/harmonic-skeleton/source/blender/blenlib/BLI_arithb.h branches/harmonic-skeleton/source/blender/blenlib/intern/arithb.c branches/harmonic-skeleton/source/blender/src/autoarmature.c Modified: branches/harmonic-skeleton/source/blender/blenlib/BLI_arithb.h === --- branches/harmonic-skeleton/source/blender/blenlib/BLI_arithb.h 2008-07-22 17:03:44 UTC (rev 15696) +++ branches/harmonic-skeleton/source/blender/blenlib/BLI_arithb.h 2008-07-22 17:44:06 UTC (rev 15697) @@ -262,6 +262,7 @@ void Vec2Copyf(float *v1, float *v2); void AxisAngleToQuat(float *q, float *axis, float angle); +void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]); void vectoquat(float *vec, short axis, short upflag, float *q); float VecAngle2(float *v1, float *v2); Modified: branches/harmonic-skeleton/source/blender/blenlib/intern/arithb.c === --- branches/harmonic-skeleton/source/blender/blenlib/intern/arithb.c 2008-07-22 17:03:44 UTC (rev 15696) +++ branches/harmonic-skeleton/source/blender/blenlib/intern/arithb.c 2008-07-22 17:44:06 UTC (rev 15697) @@ -1335,6 +1335,18 @@ } } +void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]) +{ + float axis[3]; + float angle; + + Crossf(axis, v1, v2); + + angle = NormalizedVecAngle2(v1, v2); + + AxisAngleToQuat(q, axis, angle); +} + void AxisAngleToQuat(float *q, float *axis, float angle) { float nor[3]; Modified: branches/harmonic-skeleton/source/blender/src/autoarmature.c === --- branches/harmonic-skeleton/source/blender/src/autoarmature.c 2008-07-22 17:03:44 UTC (rev 15696) +++ branches/harmonic-skeleton/source/blender/src/autoarmature.c 2008-07-22 17:44:06 UTC (rev 15697) @@ -37,7 +37,9 @@ #include PIL_time.h #include DNA_ID.h +#include DNA_action_types.h #include DNA_armature_types.h +#include DNA_constraint_types.h #include DNA_mesh_types.h #include DNA_meshdata_types.h #include DNA_object_types.h @@ -55,6 +57,7 @@ #include BKE_global.h #include BKE_utildefines.h +#include BKE_constraint.h #include BIF_editarmature.h #include BIF_space.h @@ -87,6 +90,12 @@ struct RigNode *head; ReebGraph *link_mesh; + + ListBase controls; + + GHash *bones_map; + + Object *ob; } RigGraph; typedef struct RigNode { @@ -130,6 +139,13 @@ EditBone *bone; } RigEdge; +typedef struct RigControl { + struct RigControl *next, *prev; + EditBone *bone; + EditBone *parent; + float offset[3]; +} RigControl; + /***/ static void RIG_calculateEdgeAngle(RigEdge *edge_first, RigEdge *edge_second); @@ -196,6 +212,8 @@ } BLI_freelistN(rg-nodes); + BLI_ghash_free(((RigGraph*)rg)-bones_map, NULL, NULL); + MEM_freeN(rg); } @@ -208,6 +226,8 @@ rg-head = NULL; + rg-bones_map = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp); + rg-free_arc = RIG_freeRigArc; rg-free_node = NULL; @@ -226,6 +246,17 @@ return arc; } +static RigControl *newRigControl(RigGraph *rg) +{ + RigControl *ctrl; + + ctrl = MEM_callocN(sizeof(RigControl), rig control); + + BLI_addtail(rg-controls, ctrl); + + return ctrl; +} + static RigNode *newRigNodeHead(RigGraph *rg, RigArc *arc, float p[3]) { RigNode *node; @@ -308,39 +339,121 @@ edge_first-angle = saacos(Inpf(vec_first, vec_second)); } -/***/ +/ CONTROL BONES / -static void RIG_arcFromBoneChain(RigGraph *rg, ListBase *list, EditBone *root_bone, RigNode *starting_node) +static void RIG_addControlBone(RigGraph *rg, EditBone *bone) { - EditBone *bone, *last_bone = NULL; - RigArc *arc; - int contain_head = 0; - - arc = newRigArc(rg); - - if (starting_node == NULL) + RigControl *ctrl =
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15699] branches/soc-2008-nicholasbishop/ source/blender/blenkernel/intern: Fixed rendering multires meshes.
Revision: 15699 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15699 Author: nicholasbishop Date: 2008-07-22 19:54:21 +0200 (Tue, 22 Jul 2008) Log Message: --- Fixed rendering multires meshes. Also removed some more old multires code formerly used in rendering. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/DerivedMesh.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/DerivedMesh.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/DerivedMesh.c 2008-07-22 17:49:15 UTC (rev 15698) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/DerivedMesh.c 2008-07-22 17:54:21 UTC (rev 15699) @@ -71,7 +71,6 @@ #include BKE_material.h #include BKE_modifier.h #include BKE_mesh.h -#include BKE_multires.h #include BKE_object.h #include BKE_subsurf.h #include BKE_texture.h @@ -2575,93 +2574,11 @@ return ob-derivedDeform; } -/* Move to multires Pin level, returns a copy of the original vertex coords. */ -float *multires_render_pin(Object *ob, Mesh *me, int *orig_lvl) -{ - float *vert_copy= NULL; - - if(me-mr !(me-mr-flag MULTIRES_NO_RENDER)) { - MultiresLevel *lvl= NULL; - int i; - - /* Make sure all mesh edits are properly stored in the multires data*/ - multires_update_levels(me, 1); - - /* Copy the highest level of multires verts */ - *orig_lvl= me-mr-current; - lvl= multires_level_n(me-mr, BLI_countlist(me-mr-levels)); - vert_copy= MEM_callocN(sizeof(float)*3*lvl-totvert, multires vert_copy); - for(i=0; ilvl-totvert; ++i) - VecCopyf(vert_copy[i*3], me-mr-verts[i].co); - - /* Goto the pin level for multires */ - me-mr-newlvl= me-mr-pinlvl; - multires_set_level(ob, me, 1); - } - - return vert_copy; -} - -/* Propagate the changes to render level - fails if mesh topology changed */ -void multires_render_final(Object *ob, Mesh *me, DerivedMesh **dm, float *vert_copy, - const int orig_lvl, CustomDataMask dataMask) -{ - if(me-mr !(me-mr-flag MULTIRES_NO_RENDER)) { - if((*dm)-getNumVerts(*dm) == me-totvert - (*dm)-getNumFaces(*dm) == me-totface) { - MultiresLevel *lvl= multires_level_n(me-mr, BLI_countlist(me-mr-levels)); - DerivedMesh *old= NULL; - MVert *vertdup= NULL; - int i; - - /* Copy the verts into the mesh */ - vertdup= (*dm)-dupVertArray(*dm); - (*dm)-release(*dm); - for(i=0; ime-totvert; ++i) - me-mvert[i]= vertdup[i]; - /* Free vertdup after use*/ - MEM_freeN(vertdup); - /* Go to the render level */ - me-mr-newlvl= me-mr-renderlvl; - multires_set_level(ob, me, 1); - (*dm)= getMeshDerivedMesh(me, ob, NULL); - - /* Some of the data in dm is referenced externally, so make a copy */ - old= *dm; - (*dm)= CDDM_copy(old); - old-release(old); - - if(dataMask CD_MASK_ORCO) - add_orco_dm(ob, *dm, NULL); - - /* Restore the original verts */ - me-mr-newlvl= BLI_countlist(me-mr-levels); - multires_set_level(ob, me, 1); - for(i=0; ilvl-totvert; ++i) - VecCopyf(me-mvert[i].co, vert_copy[i*3]); - } - - if(vert_copy) - MEM_freeN(vert_copy); - - me-mr-newlvl= orig_lvl; - multires_set_level(ob, me, 1); - } -} - -/* Multires note - if mesh has multires enabled, mesh is first set to the Pin level, - where all modifiers are applied, then if the topology hasn't changed, the changes - from modifiers are propagated up to the Render level. */ DerivedMesh *mesh_create_derived_render(Object *ob, CustomDataMask dataMask) { DerivedMesh *final; - Mesh *me= get_mesh(ob); - float *vert_copy= NULL; - int orig_lvl= 0; - vert_copy= multires_render_pin(ob, me, orig_lvl); mesh_calc_modifiers(ob, NULL, NULL, final, 1, 1, 0, dataMask); - multires_render_final(ob, me, final, vert_copy, orig_lvl, dataMask);
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15700] trunk/blender/projectfiles_vc7/ blender: Update MSVC project files
Revision: 15700 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15700 Author: ben2610 Date: 2008-07-22 20:11:32 +0200 (Tue, 22 Jul 2008) Log Message: --- Update MSVC project files Modified Paths: -- trunk/blender/projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj Modified: trunk/blender/projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj === --- trunk/blender/projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj 2008-07-22 17:54:21 UTC (rev 15699) +++ trunk/blender/projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj 2008-07-22 18:11:32 UTC (rev 15700) @@ -472,6 +472,9 @@ RelativePath=..\..\..\source\blender\makesdna\DNA_fileglobal_types.h /File File + RelativePath=..\..\..\source\blender\makesdna\DNA_gpencil_types.h + /File + File RelativePath=..\..\..\source\blender\makesdna\DNA_group_types.h /File File Modified: trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj === --- trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj2008-07-22 17:54:21 UTC (rev 15699) +++ trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj2008-07-22 18:11:32 UTC (rev 15700) @@ -182,6 +182,9 @@ RelativePath=..\..\..\source\blender\src\drawdeps.c /File File + RelativePath=..\..\..\source\blender\src\drawgpencil.c + /File + File RelativePath=..\..\..\source\blender\src\drawimage.c /File File @@ -233,6 +236,9 @@ RelativePath=..\..\..\source\blender\src\editaction.c /File File + RelativePath=..\..\..\source\blender\src\editaction_gpencil.c + /File + File RelativePath=..\..\..\source\blender\src\editarmature.c /File File @@ -350,6 +356,9 @@ RelativePath=..\..\..\source\blender\src\glutil.c /File File + RelativePath=..\..\..\source\blender\src\gpencil.c + /File + File RelativePath=..\..\..\source\blender\src\hddaudio.c /File File @@ -618,6 +627,9 @@ RelativePath=..\..\..\source\blender\include\BDR_editobject.h /File File + RelativePath=..\..\..\source\blender\include\BDR_gpencil.h + /File + File RelativePath=..\..\..\source\blender\include\BDR_imagepaint.h /File File @@ -636,6 +648,9 @@ RelativePath=..\..\..\source\blender\include\BIF_cursors.h /File File + RelativePath=..\..\..\source\blender\include\BIF_drawgpencil.h + /File + File RelativePath=..\..\..\source\blender\include\BIF_drawimage.h /File File ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15702] trunk/blender/source: BGE patch: Add min/max parameters to orientation constraint actuator
Revision: 15702 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15702 Author: ben2610 Date: 2008-07-23 01:05:06 +0200 (Wed, 23 Jul 2008) Log Message: --- BGE patch: Add min/max parameters to orientation constraint actuator The min/max parameters define a minimum/maximum angle that the object axis can have with the reference direction without being constrainted. The angle is expressed in degree and is limited to 0-180 range. The min/max parameters define a conical free zone around the reference direction. If the object axis is outside that free zone, the actuator will tend to put it back using as a temporary reference direction the vector that is exactly at min or max degree of the reference direction (depending if the axis angle is below the minimum or above the maximum) and is located in the plane formed by the axis and the reference direction. With a low damping value, this is equivalent to clamping the axis orientation within min/max degree of the reference direction. Backward compatibility corresponds to the absence of free zone: min = max = 0. Modified Paths: -- trunk/blender/source/blender/src/buttons_logic.c trunk/blender/source/gameengine/Converter/KX_ConvertActuators.cpp trunk/blender/source/gameengine/Ketsji/KX_ConstraintActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_ConstraintActuator.h Modified: trunk/blender/source/blender/src/buttons_logic.c === --- trunk/blender/source/blender/src/buttons_logic.c2008-07-22 18:48:28 UTC (rev 15701) +++ trunk/blender/source/blender/src/buttons_logic.c2008-07-22 23:05:06 UTC (rev 15702) @@ -2062,7 +2062,7 @@ coa-time = 0; uiDefButS(block, MENU, 1, str, xco+10, yco-65, 70, 19, coa-flag, 0.0, 0.0, 0, 0, ); - uiDefButS(block, NUM, 0, Damp:, xco+10, yco-45, 70, 19, coa-damp, 0.0, 100.0, 0, 0, ); + uiDefButS(block, NUM, 0, damp, xco+10, yco-45, 70, 19, coa-damp, 0.0, 100.0, 0, 0, Damping factor: time constant (in frame) of low pass filter); uiDefBut(block, LABEL, 0, Min, xco+80, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ); uiDefBut(block, LABEL, 0, Max, xco+80+(width-90)/2, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ); @@ -2084,7 +2084,7 @@ str= Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32; uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, coa-mode, 0.0, 0.0, 0, 0, Set the direction of the ray); - uiDefButS(block, NUM, 0, Damp:, xco+10, yco-45, 70, 19, coa-damp, 0.0, 100.0, 0, 0, ); + uiDefButS(block, NUM, 0, damp, xco+10, yco-45, 70, 19, coa-damp, 0.0, 100.0, 0, 0, Damping factor: time constant (in frame) of low pass filter); uiDefBut(block, LABEL, 0, Range, xco+80, yco-45, (width-115)/2, 19, NULL, 0.0, 0.0, 0, 0, Set the maximum length of ray); uiDefButBitS(block, TOG, ACT_CONST_DISTANCE, B_REDR, Dist,xco+80+(width-115)/2, yco-45, (width-115)/2, 19, coa-flag, 0.0, 0.0, 0, 0, Force distance of object to point of impact of ray); @@ -2124,7 +2124,7 @@ str= Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4; uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, coa-mode, 0.0, 0.0, 0, 0, Select the axis to be aligned along the reference direction); - uiDefButS(block, NUM, 0, Damp:, xco+10, yco-45, 70, 19, coa-damp, 0.0, 100.0, 0, 0, ); + uiDefButS(block, NUM, 0, damp, xco+10, yco-45, 70, 19, coa-damp, 0.0, 100.0, 0, 0, Damping factor: time constant (in frame) of low pass filter); uiDefBut(block, LABEL, 0, X, xco+80, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ); uiDefBut(block, LABEL, 0, Y, xco+80+(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ); uiDefBut(block, LABEL, 0, Z, xco+80+2*(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ); @@ -2133,7 +2133,9 @@ uiDefButF(block, NUM, 0, , xco+80+(width-115)/3, yco-65, (width-115)/3, 19, coa-maxrot[1], -2000.0, 2000.0, 10, 0, Y component of reference direction); uiDefButF(block, NUM, 0, , xco+80+2*(width-115)/3, yco-65, (width-115)/3, 19, coa-maxrot[2], -2000.0, 2000.0, 10, 0, Z component of reference
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15703] branches/soc-2008-nicholasbishop/ source/blender: Fix joining of multires meshes.
Revision: 15703 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15703 Author: nicholasbishop Date: 2008-07-23 01:48:18 +0200 (Wed, 23 Jul 2008) Log Message: --- Fix joining of multires meshes. The resulting mesh always has all the displacements -- if the mesh being joined to didn't have multires, it will once it's joined with a multires mesh. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c branches/soc-2008-nicholasbishop/source/blender/src/meshtools.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-07-22 23:05:06 UTC (rev 15702) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-07-22 23:48:18 UTC (rev 15703) @@ -129,6 +129,7 @@ struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, struct DerivedMesh*, struct Mesh *, int, int); +void multiresModifier_join(struct Object *ob); void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob); void multiresModifier_setLevel(void *mmd_v, void *ob_v); int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src); Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-07-22 23:05:06 UTC (rev 15702) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-07-22 23:48:18 UTC (rev 15703) @@ -34,7 +34,9 @@ #include DNA_meshdata_types.h #include DNA_modifier_types.h #include DNA_object_types.h +#include DNA_scene_types.h #include DNA_vec_types.h +#include DNA_view3d_types.h #include BIF_editmesh.h @@ -47,6 +49,7 @@ #include BKE_depsgraph.h #include BKE_DerivedMesh.h #include BKE_global.h +#include BKE_modifier.h #include BKE_multires.h #include BKE_subsurf.h @@ -813,6 +816,69 @@ static const int multires_tri_tot[] = {3, 7, 19, 61, 217, 817, 3169, 12481, 49537, 197377, 787969, 3148801, 12589057}; static const int multires_side_tot[] = {2, 3, 5, 9, 17, 33, 65, 129, 257, 513,1025,2049,4097}; +void multiresModifier_join(Object *ob) +{ + Base *base = NULL; + int highest_lvl = 0; + + /* First find the highest level of subdivision */ + base = FIRSTBASE; + while(base) { + if(TESTBASELIB_BGMODE(base) base-object-type==OB_MESH) { + ModifierData *md; + for(md = base-object-modifiers.first; md; md = md-next) { + if(md-type == eModifierType_Multires) { + int totlvl = ((MultiresModifierData*)md)-totlvl; + if(totlvl highest_lvl) + highest_lvl = totlvl; + + /* Ensure that all updates are processed */ + multires_force_update(base-object); + } + } + } + base = base-next; + } + + /* No multires meshes selected */ + if(highest_lvl == 0) + return; + + /* Subdivide all the displacements to the highest level */ + base = FIRSTBASE; + while(base) { + if(TESTBASELIB_BGMODE(base) base-object-type==OB_MESH) { + ModifierData *md = NULL; + MultiresModifierData *mmd = NULL; + + for(md = base-object-modifiers.first; md; md = md-next) { + if(md-type == eModifierType_Multires) + mmd = (MultiresModifierData*)md; + } + + /* If the object didn't have multires enabled, give it a new modifier */ + if(!mmd) { + ModifierData *md = base-object-modifiers.first; + + while(md modifierType_getInfo(md-type)-type == eModifierTypeType_OnlyDeform) + md = md-next; + + mmd = (MultiresModifierData*)modifier_new(eModifierType_Multires); + BLI_insertlinkbefore(base-object-modifiers, md, mmd); + } + + if(mmd) { +
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15704] trunk/blender/source/blender/ python/api2_2x/doc/Ipo.py: Updated some out of date documentation of Object Ipo curve names
Revision: 15704 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15704 Author: broken Date: 2008-07-23 04:31:56 +0200 (Wed, 23 Jul 2008) Log Message: --- Updated some out of date documentation of Object Ipo curve names Modified Paths: -- trunk/blender/source/blender/python/api2_2x/doc/Ipo.py Modified: trunk/blender/source/blender/python/api2_2x/doc/Ipo.py === --- trunk/blender/source/blender/python/api2_2x/doc/Ipo.py 2008-07-22 23:48:18 UTC (rev 15703) +++ trunk/blender/source/blender/python/api2_2x/doc/Ipo.py 2008-07-23 02:31:56 UTC (rev 15704) @@ -250,7 +250,7 @@ OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var, Disp. 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ, - dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ, + dRotX, dRotY, dRotZ, ScaleX, ScaleY, ScaleZ, dScaleX, dScaleY, dScaleZ, Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping, RDamp, Perm. 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt. @@ -289,7 +289,7 @@ OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var, Disp. 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ, - dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ, + dRotX, dRotY, dRotZ, ScaleX, ScaleY, ScaleZ, dScaleX, dScaleY, dScaleZ, Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping, RDamp, Perm. 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs