Commit Graph

26 Commits

Author SHA1 Message Date
Campbell Barton 0bab23633a remove inline loops in a few places
replace with defgroup_find_name() and BLI_findstring()
2010-08-22 14:15:28 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Campbell Barton 95bfbd470e vertex group sort operator, access from the vgroup panel, sintels mesh has 144 vertex groups which got quite tedious to look through. 2010-02-02 21:43:26 +00:00
Campbell Barton 246bcf48ad weight panel editing now supports mirroring
- use mirror when the option is enabled in editmode.
- fliped group names are used when they exist.
- only the setting that is edited will be applied to the mirrored verts group.
- copy value is applied to all mirrored verts of the selection.
- normalize normalizes all vgroups and mirrors.

utility functions defvert_sync and defvert_sync_mapped, similar to defvert_copy but does not remove existing groups and optionally creates groups as needed.
defvert_sync_mapped uses a an int array for mapping the flipped values.
2010-01-26 17:07:47 +00:00
Campbell Barton e307f6c6a0 rename defgroup functions to be more consistant.
* no functional changes *
2010-01-26 13:50:17 +00:00
Campbell Barton 33623ba3a3 panel for adjusting the active vertex groups weights 2010-01-25 23:12:02 +00:00
Campbell Barton c7dfa96aea bugfix [#20639] BF25_SVN_25888 and below - OBJ and 3DS import fails
blender supports type changing for textures in a way that python doesnt.
add a new general function.

Example usage:
 tex = bpy.data.textures.new("Foo")
 tex.type = 'IMAGE'
 tex = tex.recast_type()

Macro to give the number of users accounting for fake user.
 ID_REAL_USERS(id)
Use this so you can remove a datablock if it has a fake users as well as apply transformations to it in the 3D view.

Move api function bpy.data.add_texture() --> bpy.data.textures.new()/remove()
2010-01-17 20:06:34 +00:00
Campbell Barton ace8d45c1c - particle drawing was using invalid memory with weights.
- particle set weight operator (Shift + K) and from the menu.
- mirror vertex groups operator can also flip weight group names.

a number of utility functions for weight groups added
 int *get_defgroup_flip_map(struct Object *ob);
 void flip_vertexgroup_name (char *name_r, const char *name, int strip_number); // moved from modifier.c 
 void copy_defvert (struct MDeformVert *dvert_r, const struct MDeformVert *dvert);
 void flip_defvert (struct MDeformVert *dvert, int *flip_map);
2010-01-15 17:28:00 +00:00
Campbell Barton 08bbda5005 - Stopping jobs on undo wasnt fixing undo/redo while with render previews as it was supposed to: needed WM_jobs_stop_all rather then WM_jobs_stop because it ends the thread rather then just setting 'stop'.
- gpl header + warning fix
2009-11-04 20:50:09 +00:00
Joshua Leung 88b30a740a A bit of cleanup of warnings (gcc).
Warnings still exist in the following places:
* places (exotic.c, etc.) where format strings still use 'longs' but datatype is uintptr_t (i.e. resulting from the win64 changes)
* shrinkwrap.c - a few "incompatable type" warnings
2008-08-22 12:10:02 +00:00
Andre Susano Pinto e57c5ef56c Fixed non_recursive BVHbuild with openmp
CHanged the BENCH functions to use: gettimeofday (wall time) instead of clock (cpu time)
This was to test if the openmp was working right.
2008-08-06 15:46:38 +00:00
Andre Susano Pinto 37a017b18a *Added vertex groups on simple deform
*Fixed a few UI things

*Make SimpleDeform and Shrinkwrap to use vertexgroup_get_vertex_weight, a similar function
 "static float vert_weight(MDeformVert *dvert, int group)"  existed on modifier.c, changed
it a bit and moved into BKE_deform.h
2008-07-04 19:56:31 +00:00
Chris Want 5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Joshua Leung 400d77bbe2 == Constraints - Geometry Targets ==
It is now possible to use the geometry of Meshes and/or Lattices as the target of a constraint. All you need to do, is to create a new Vertex-Group and assign all the points that you wish to use as the target, then type that name into the VG: field for the relevant constraints.

One of the cases where this is beneficial is when you need to copy the location of a vertex. Now you don't need to make extra vertex-parents for that.

Additional Notes:
* The code takes the average of the locations of the nominated vertices, and puts that in world-space for constraint solving (and regular space-conversion stuff).
* Currently, rotation and scaling of points is not taken into account. The rotation/scaling used is from the object's matrix. Hopefully, this will only be a temporary problem (will be fixed soon)
2007-08-17 11:23:48 +00:00
Joshua Leung 01335fc7bb Bugfix:
Previous versions of Blender allowed Vertex Groups to be nameless, which
shouldn't be allowed. This caused problems with rigs from previous versions of Blender being loaded in 2.43+ versions, as the new VGroup feature for the
Armature modifier mis-identified these nameless group(s) as being the Vertex Group
to be used. As well as the checks done when renaming VGroups (from another commit), files created prior to and in 2.43 will have all such groups given default
names.

Code notes:
* I've moved the unique_vertexgroup_name function from src to blenkernel like for
 constraints
* Formatting in deform.c tidied up a bit
2007-04-27 11:16:35 +00:00
Daniel Dunbar 93aeb6b318 - added make_orco_curf, even does keys!
- removed {lattice,curve}_modifier functions
 - changed render code to use displist for curve rendering
   instead of making its own. required adding a bevelSplitFlag
   field to DispList. I also fixed the bevel face splitting
   which did not work correctly in many situations.
 - changed so all curve data creation happens in makeDispListCurveTypes,
   includes making bevel list and filling polys
 - changed render code to use displist for surface rendering
 - removed Curve.orco variable, built as needed now
 - removed stupid BLI_setScanFill* functions... why use a function
   argument when you can use a global and two functions! Why indeed.
   (this fixed crash when reloading a file with filled curves and
   toggling editmode)
 - bug fix, setting curve width!=1 disabled simple bevel for no
   apparent reason
 - cleaned up lots and lots of curve/displist code (fun example:
   "if(dl->type==DL_INDEX3 || dl->type==DL_INDEX3)"). Hmmm!
 - switched almost all lattice calls to go through lattice_deform_verts,
   only exception left is particles
 - added DBG_show_shared_render_faces function in render, just
   helps to visualize which verts are shared while testing (no
   user interface).
 - renamed some curve bevel buttons and rewrote tooltips to be
   more obvious
 - made CU_FAST work without dupfontbase hack

Also by the way I wrote down some notes on how curve code
works, nothing spiffy but it is at:

http://wiki.blender.org/bin/view.pl/Blenderdev/CurveNotes
2005-08-14 06:08:41 +00:00
Daniel Dunbar 75bcb4cd98 - added modifiers_getVirtualModifierList, returns pointer to first modifier
but including "virtual" modifiers (for example, an object skel-parented
   to a lattice has a virtual first lattice modifier)
 - removed mesh_modifier(), all functionality has been incorporated into
   modifier stack (well, keys still don't exist as a modifier, but I am
   not sure if they should).
 - added interface option to convert a virtual modifier into a real modifier
 - added option to parent to lattice object or lattice with deform
 - bug fix, patch of hook indices patched all hooks (oops) not just ones
   for edited mesh

NOTE: Files saved with 2.38 that include an object parented to a lattice
will not load correctly, because it will look like the object is parented
only to the object (i.e. without deform). Can be simply fixed by reparenting
or adding a lattice modifier. Older files are handled automatically.
2005-08-11 03:31:33 +00:00
Daniel Dunbar 9030e5f686 - added eModifierTypeFlag_RequiresOriginalData for modifiers that
can only follow deform (for example, they store mesh vertex
   indices)
 - added ModifierType.foreachObjectLink for iterating over Object
   links inside modifier data (used for file load, relinking, etc)
 - switched various modifiers_ functions to take object argument
   instead of ListBase
 - added user editable name field to modifiers
 - bug fix, duplicate and make single user didn't relink object
   pointers in modifier data
 - added modifiers to outliner, needs icon
 - added armature, hook, and softbody modifiers (softbody doesn't
   do anything atm). added conversion of old hooks to modifiers.

NOTE-THE-FIRST: User name field is not initialized on loading 2.38 files
so if you have saved stuff with a cvs blender you will see blank names.

NOTE-THE-SECOND: Since modifiers aren't evaluated yet for non-Mesh
objects, hooks for lattices and curves are broken. Don't updated if
you actually, say, *use* Blender.

NOTE-THE-THIRD: Old hooks used a quirky weighting system during
deformation which can't be extended to modifiers. On the upside,
I doubt anyone relied on the old quirky system and the new system
makes much more sense. (Although the way falloff works is still
quite stupid I think).
2005-08-10 22:05:52 +00:00
Daniel Dunbar 09b5272639 - split mesh_deform off from object_deform
- changed mesh_modifier, sbObjectStep, object_deform to take vertexCo
   argument instead of operating on mesh
 - fixed bug where a derived mesh would not be returned in editmode
 - removed object_wave, replaced by init_wave_deform and calc_wave_deform
 - moved cached DerivedMesh to Object, not Mesh... fixes heisenbugs
   with linked objects
2005-07-19 02:36:21 +00:00
Daniel Dunbar 726aea881c - convert mesh_modifier to return deformed verts instead of
leaving in a DL_VERTS type displist (and modifying mesh)
 - removed DL_VERTS displist type (woot woot)
 - makeDispListMesh now puts deformed verts in object->derivedDeform
 - switch over other system parts to new deformed vert storage,
   still kinda hacky and maybe some inconsistencies... will be
   sorted out soon enough.
 - moved build_particle_system to makeDispListMesh... this may have
   adverse side effects, needs to be sorted out with depgraph system
2005-07-17 17:41:03 +00:00
Daniel Dunbar 5c87aefa4b - integrated get_mvert_weight and color_temperature
into drawobject.c (just used for calculating weight
   map)
 - removed two_sided (replace with glLightModeli calls)
 - huge rewrite of drawobject.c for meshes, extracting simple
   drawing functions and then reworking to bring some order
   and clarity back to the code.

   A lot was changed here so it is likely I missed a few
   things in testing although I tried to be very careful.
   Please let me know if you find any changes in drawing.
2005-03-26 17:29:37 +00:00
Brecht Van Lommel 5161998bbe Softbody commit broke compilation of blenderplayer. There was a dependancy
from blenkernel/ to src/. Moved the offending functions to blenkernel...
2005-01-12 23:57:33 +00:00
Ton Roosendaal 37f57288cb Lot of code... 2 new features:
1) Curve deform
http://www.blender3d.org/cms/Curve_Deform.392.0.html
Works simple as expected, but keep track of the rotation axis
in F7 buttons (Track X Y Z)
Only Mesh deform supported now.

Code changes:
- centralized deformation calls in curve_modifiers() mesh_modifiers()
etcetera. Here also other effects can be added like wave. Now the
evaluation order is fixed, but should become optional. It also doesnt
use the Displist anymore as deform-input. That latter part is unfinished
yet.
This code also is used for Hooks and will be needed for softbody

- made convention stricter that displists are being checked on in
drawobject(), this to prevent routines to make new displists recursively
(like armature does). Now a freedisplist() is sufficient to signal that
a new displaylist should be made.

2) Object Hooks
http://www.blender3d.org/cms/Object_Hooks.391.0.html
Support for Hooks is added to Mesh, Lattice, Curve and Surface objects.
For Armatures this would require some more work & research.
Main goal for this feature is to provide quick & simple access to the
underlying geometry in Objects on Object level, supporting hierarchies and
Ipos etc.
2004-09-14 19:03:11 +00:00
Kent Mein f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00
Kent Mein b9a19f1ea7 Did all of the .h's in source
(adding)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

also the Makefile.in's were from previous patch adding
the system depend stuff to configure.ac

Kent
--
mein@cs.umn.edu
2002-11-25 11:16:17 +00:00
Hans Lambermont 12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00