Commit Graph

4697 Commits

Author SHA1 Message Date
Chris Want
3c1887036a Added (non-default) Makefile option to build blender with tweak mode.
To build with this option, set:

export NAN_TWEAK_MODE=true
2005-08-23 02:28:01 +00:00
Daniel Dunbar
4ad5cdf91e - subsurf getVertCos returned verts in wrong order since
shuffling of code... led to fun and crazy results (maybe
   less fun for les artiste)
2005-08-23 02:05:45 +00:00
Chris Want
d6b4392710 On windows/gcc (aka. FREE_WINDOWS), build the blenderplayer whenever
blender is configured to build with the gameengine.
2005-08-23 01:31:11 +00:00
Ton Roosendaal
50315dc100 Another painful editing issue solved!
Adding Ipos on a Constraint just was working totally insane. Here's how
it works now in the constraint Panel:

- Button "Show" will make the IpoWindow show the Constraint Ipo
 (it didn't before, when IpoWindow was not set to correct mode)

- Button "Key" will insert a key point on current frame (and show it in
  IpoWindow)

Note that both options will create an Action too, if not existed yet.
So, without opening an IpoWindow you can already animate Constraints.
(Todo: use the auto key option to always insert on changing slider)

And; selecting a Bone will update the Constraint IpoWindow too. Note
however, that when theres multiple Constraint Ipos on a Bone, it only
shows the first... will solve that later.
2005-08-22 21:58:55 +00:00
Daniel Dunbar
931d0fc235 - switch modifiers_isDeformedByArmature to also include
virtual modifiers
2005-08-22 20:25:54 +00:00
Daniel Dunbar
3d7ed80ed4 - added modifiers_isDeformedByArmature function 2005-08-22 20:24:59 +00:00
Erwin Coumans
43b59afebb more preparation for physics recording to ipo keyframes 2005-08-22 18:31:19 +00:00
Johnny Matthews
3b8e94ac6b This commit introduces 2 new filling methods for subdividing quads which have only 2 adjacent edges selected. Path, Fan and Innerverts. ATM whenever a call is made to any subdivide calling tool, you will be asked for the type by a pupmenu. This will be replaced (perhaps) by a panel setting... 2005-08-22 18:05:40 +00:00
Ton Roosendaal
a5bc9582cb Three little feats;
- Vpaint and Wpaint now use our own custom cursor, this was a very old
  plan anyway. It uses the 'knife' now, we need a good brush icon for it!
- On scaling bones in editmode, the deform distance info gets scaled now
  too when no "Envelope" draw mode was set.
- Disabled front buffer drawing of objects with CTRL+select in Edit Mode.
  Uses a regular redraw now (like for select in Object Mode btw)
2005-08-22 17:52:52 +00:00
Erwin Coumans
65a52fc419 - prepared for automatic game physics -> animation (ipo) conversion (this allows to use bullet for animation)
- default the m_edgecode to 65535, the wireframe was invisible. when is the edgecode available again ?
- added an extra condition, nearsensor is not yet working for bullet, but it crashed.
2005-08-22 15:47:56 +00:00
Ton Roosendaal
838d938522 Some fixes;
- Armature deform options "Envelope" and "Vertexgroup" didn't combine. One
  Vertexgroup added disabled all Envelopes
- "Clear" option in WPaint Panel now sends refresh to deform
- Same for Undo in Wpaint
2005-08-21 22:01:20 +00:00
Brecht Van Lommel
af935e597f Use new BLI_edgehash_* functions in unwrapper. 2005-08-21 21:39:44 +00:00
Ton Roosendaal
bfc5fedb79 Much wanted; Constraint "move up" and "move down" buttons, in the Panel! 2005-08-21 21:20:53 +00:00
Daniel Dunbar
dd7bcb94bf - sillyness... added drawMappedEdges for mesh
- revert to drawLooseEdges instead of general drawEdgesFlag
 - ditched TFace edge flags, done dynamically now which also
   means don't need to recalc surface on flag changes
 - added BLI_edgehash, guess what it does
2005-08-21 20:48:45 +00:00
Ton Roosendaal
5a381a5a12 Made weight-painting more bearable :)
- Hotkey CTRL+TAB toggles weightpaint on/off
- If Mesh has no vertex groups yet, it still accepts Weight Paint mode.
  Then, on a first painting stroke it creates a default group.
- When combining WeightPaint mode with Bone selecting, if you select a
  Bone without vertex group it draws Mesh dark blue. On a first painting
  stroke it then also creates a new group, with the Bone name.
2005-08-21 20:09:50 +00:00
Daniel Dunbar
d2f6ff1900 - bug fix, last edge wasn't flagged correctly on make_edges 2005-08-21 19:01:30 +00:00
Ton Roosendaal
6ad0c922af Control over Armature deform. Three new options are added for it;
Armature Panel
- "Vertex Groups"
- "Envelope"

Bones Panel
- "Mult"

The logic works as follows;
- Set "Vertex Groups" will enable vertex group based deform (default)
- Set "Envelope" will enable Bone Envelopes to deform
- Set both will apply Envelope deform on vertices without VertexGroups

- Set the per-Bone "Mult" option to have Envelopes work on top of a
  VertexGroup
- The per-Bone "Deform" option (was called "Skinnable") will dis/enable
  the Bone to deform for all situations.

The old convention was that, without any vertex groups, the Bones deformed
with bone-distances. I can't patch that... so you have to enable it by
hand in older files. Not too bad, since this option was unusable before
anyway. :)
2005-08-21 18:53:12 +00:00
Daniel Dunbar
a669c9d6d1 - edge draw experiment didn't turn out to be useful, removed and reverted
to old.
 - updated fasterdraw() to work with edges
2005-08-21 17:57:06 +00:00
Stephen Swaney
24c8bcf884 bugfix: #2924 Bugs in api2_2x/Material.c
- BPy_Material_methods[] "setFilter" calls Material_setFresnelMirrFac()
 - Material_setSpecSmooth() should be setting param[3], not param[2]

Contributed by Ken Hughes.  Thanks!
2005-08-21 15:16:16 +00:00
Stephen Swaney
bb5ae49992 A large collection of fixes from Ken Hughes including:
- corrections to constants
 - parameter type checking
 - correct use of METH_VARARGS vs METH_NOARGS
 - return objects instead of strings in Scene.getChildren() as per doc.
 - correct logical operators

Thanks, Ken!
2005-08-21 15:00:17 +00:00
Ton Roosendaal
4065cdb550 Temporal; make compiling happy. :) 2005-08-21 14:39:08 +00:00
Ton Roosendaal
9a105042fc At last! B-bones now deform. :)
This works pretty nice for better control over the curvature of any bone
deform. No need to give Bones (vgroups) large influence, just add a coupleof B-bone segments.

Two notes;
- The Bone property "Segments" defines if a deform happens as a 'B-bone'.
  The drawtype B-bone is just for display in 3d window.
- A B-bone also deforms (bends) in Rest-position, if there's a joint that
  creates a curved Bone. Therefore, best results you get by creating a
  rest-position with straight joints. Or, if you prefer a slightly bended
  restposition (for a spine or so), make sure the Mesh model is *not*
  curved, the B-bone will do this for you.

Also added: proper events on changing buttons for Bones, like "Segm" or
"Dist" etc.
2005-08-21 11:26:53 +00:00
Ton Roosendaal
4d58808512 MEM_alloc allocated in units of 8 for 32 bits systems, and units of 4 for
64 bits systems... weird bug. :)
It now only does a unit-of-4 check, for all systems. This will work fine,
since the malloc code will return aligned anyway, and the guarded alloc
system only stores ints in the headers. Also, the sizeof() call will
correctly do padding, so there's no risk of allocating too small blocks.
2005-08-21 10:05:50 +00:00
Daniel Dunbar
7804860cf6 - added mesh_strip_loose_faces, works in conjunction with make_edges
to get rid of faces with MFace.v3==0
 - change all Mesh's to have ->medge now. This is forced by make_edges
   on readfile, and in the various exotic important routines, and on
   conversion back in python.
 - make python NMesh structure always have medges now (needs testing)
 - with above two changes it is guarenteed that mf->v3 is never ==0
   in main blender code (i.e., all MFace's are actually triangles
   or quads) and so I went through and removed all the historic tests
   to deal with MFace.v3==0. Equals lots of deleting, I am in heaven!
 - removed MEdge edcode flag, no longer needed
 - added experimental replacement for edge flag system

Still are some inconsistencies in FACESELECT mode edge drawing to
be ironed out.

NOTE: This commit adds an experimental edge flag calc system, based
on 10-seconds-of-thought algorithm by yours truly. Would appreciate
feedback on how this system works, esp compared to old one and esp
on complex or interesting models.

To Use: New system is enabled by setting G.rt to a value between
1 and 1000 (Value of 0 uses old system). Value 1000 is reserved for
"auto" edge, which is more or less identical to old system but also
makes sure that at least 10% of edges are drawn (solves errors for
super subdivided meshes). Values between 1 and 999 act as percent
(out of 1000) of edges that should be drawn, starting with "most
interesting" edges first. Please try it and comment!
2005-08-21 07:19:20 +00:00
Johnny Matthews
d29f7c2c84 Some whitespace cleanup... 2005-08-21 03:37:38 +00:00
Johnny Matthews
185054bf5b Temp edge selection for edgeslide draw length now deselected properly at the end of edgeslide 2005-08-20 21:37:52 +00:00
Ton Roosendaal
7e4b62894e Fix for setting in perspective view mode the ALT+B clipping planes.
Fun: do exact camera viewborder to see camera volume!
2005-08-20 20:30:13 +00:00
Daniel Dunbar
fff5d816ab - bug fix, mirror modifier could duplicate edges on boundary in
certain cases
2005-08-20 20:04:32 +00:00
Ton Roosendaal
31a907cddc Left in a testing value for clipping... tsk! Did only three planes :) 2005-08-20 19:45:34 +00:00
Ton Roosendaal
dd5410162a New feature; User definable Clipping Planes.
Press ALT+B in 3d window, draw a rect, and it becomes a clipping
volume of 4 planes. You then can rotate the view anyway you like.
Works for each 3d window individually.

Disable it with another ALT+B press.

Commit is huge because it had to change all selection code as well.
The user-clipping planes are in 'eye space', the other clipping
happens in projected 'viewport space'.

Nice to notice is that the 'x=3200' convention (to denote a coordinate
is clipped) now is a define. Define value is still a number though... but
we now can get up to screens of 12000 pixels without issues!

Known issue; here it refuses to draw the 'object centers' or Lamp icons
within the clipping region. Can't find any reason for it... however, we
might move to non-pixmaps for it anyway.

Testing might reveil numerous issues, will be standby for it.

Curious? Check this http://www.blender.org/bf/rt4.jpg
2005-08-20 19:18:35 +00:00
Daniel Dunbar
ad5ac39ccc - another drawing bugfix, some normals were passed wrong 2005-08-20 18:49:08 +00:00
Daniel Dunbar
77be09dd2d - possible fix #2 for editmode face's draw black 2005-08-20 18:38:33 +00:00
Daniel Dunbar
6c001485fa - bug fix for stooooopid crash in mirror modifier 2005-08-20 18:25:11 +00:00
Daniel Dunbar
3da7c4c5c9 - possible fix for editmesh solid drawing black, I can't reproduce
so working a bit blind here
2005-08-20 18:14:04 +00:00
Johnny Matthews
f00b5c78d4 In edgeslide if Draw Edge Length is on, the rail edges will be temporarily selected so that actual new edge length can be seen. 2005-08-20 16:38:05 +00:00
Daniel Dunbar
bdd3477c10 - tweak virtual modifier display, now label "parent deform" and
don't display with edit buttons
2005-08-20 11:01:17 +00:00
Ton Roosendaal
29429d73f2 A couple of smaller fixes;
- Modifier Panel, name label for "Virtual" modifiers was too short
- On extrude Bones, "soft distance" now is always set based on length
  of the bone (also on CTRL+click, also when Envelope drawmode is not set)
- Added undo-push for "Apply Bone Envelopees to VertexGroup" in WeightPaint.
- Menu-buttons in floating panels sometimes gave drawing error
- InfoWindow buttons were always allocated & drawn, even when window was
  zero sized... waste of cpu, tsk!
2005-08-20 09:55:11 +00:00
Daniel Dunbar
74be13ba8b - agh! missed it again! for real this time, fix for proper updating
in image window
2005-08-20 09:17:20 +00:00
Daniel Dunbar
752dbf1e9a - made make_edge mark edges with LOOSEEDGE appropriately
- added user settable defaultEdgeData (for auto edge creation
   in CCGSubSurf)
 - bug fix, possible crash on meshes with loose edges but
   in mface not in medge
 - missed file in last commit, for proper updating in image
   window
2005-08-20 09:16:09 +00:00
Daniel Dunbar
1ac10f50f4 - bug fix, apply modifier removed modifier even on certain
errors
 - change drawimagespace to check and update object data if
   it needs a recalc. this fixes errors with a recalc being
   flushed but not actually being done before spaceimage
   redraws. Updates typically actually happen in draw loop,
   which is not a great design...
 - make shared vertexcol didn't flush update
2005-08-20 07:42:25 +00:00
Daniel Dunbar
a30740c196 - convert all DerivedMesh map functions to use index based
mapping (instead of Edit{Vert,Edge,Face} pointers)
 - dropped convertToDispListMeshMapped (whew, glad of it too)
 - added DerivedMesh drawMappedFaces function
 - dropped EM suffix for DerivedMesh functions, it was neither
   particularly correct nor descriptive
 - converted test_index_mface to test_index_face that also corrects
   MCol and TFace. Good thing we had three versions of this routine,
   you never know when one might burn down.
 - removed flipnorm_mesh, not used anymore (and was incorrect to
   boot)

 - Getting face select to work with modifiers turned out to be much
   more complicated than expected. Reworked mapping architecture for
   modifiers - basically elements in a DispListMesh are now required
   to be stored in an order that corresponds exactly to original
   ordering. MVert/MEdge/MFace all have a new flag ME_XXX_STEPINDEX
   that is set on each element that is set on the first derived element
   of each original element. I can't say the code to follow these
   requirements for subsurf is particularly transparent, but on the
   upside it is a reasonably consistent and simple system that is memory
   efficient and allows keeping the DispListMesh structure.

 - rewrote mirror modifier to be simpler/conform to new requirements
   for mapped DispListMesh structure. This also means that mirror interacts
   much better with incremental subsurf calculation (it used to recalc
   one entire side on any topology change, now it generally avoids that).

 - added EM_{init,free}_index_arrays and EM_get_{vert,edge,face}_for_index
   functions to handle mapping indices back into appropriate EditMesh
   structures.
 - bug fix, make edges didn't recalc object data
 - bug fix, initial image assignment to TFace's didn't recalc object data

 - new feature, added circle select support for FACESELECT
 - bug fix, creating new faces in editmode duplicated the TFACE active
   flag - but there should only be one active tface
 - bug fix, possible crash when deleting all faces in faceselect mode
   on mesh with tfaces...

Still todo: TFace edge drawing is still not always correct in face
mode, in particular with a mirror modifier when mesh has edges (and
no preceeding subsurf). Have not yet decided how to deal with this.
Best solution is probably to do switch to meshes all having MEdge's,
in which case I can get rid of TFace edge flags (and need to recalc
modifiers on tface selection change).
2005-08-20 03:08:23 +00:00
Jens Ole Wund
d81a5abf32 Moving functions and calls to have a cleaner situation for futre work (implicit solver .. n stuff) 2005-08-19 22:55:05 +00:00
Ton Roosendaal
6d60b0acfe More armature stuff;
- The "Skinnable" option for Bones now is taken into account for the
  Envelope drawmode. If not Skinnable, it also doesn't draw the soft
  deform area. Maybe bone should be hidden... dunno yet.
- Use CTRL+LMB in weightpaint mode to sample the weight in a mesh.
  Note; it returns the weight of the closest visible vertex, not of a
  Blended result.
- NKey Panel for Mesh edit now shows a menu with the VertexGroup name(s)
  of a selected Vertex, plus the Weight.

Fix:
- while scaling Bone points in editmode (Envelope drawtype), the Bone
  root scale was not copied from (or to) the parent tip. This was not
  visible (is not drawn) but deform did use it... causing weird errors.
  For those who saw this error today: just go into editmode, select all
  Bones, press Skey, enter. That fixes it :)
2005-08-19 21:37:29 +00:00
Ton Roosendaal
91e39a0ec3 CTRL+click now also allows Root-point extrude of Bones. 2005-08-19 16:15:51 +00:00
Ton Roosendaal
c8a5887daa Forgot hidden flag update in this file... 2005-08-19 12:39:43 +00:00
Ton Roosendaal
9e05d6efb5 Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;

http://www.blender3d.org/cms/Armature_Envelopes.647.0.html

Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).

Also part of this commit is:

- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
  keep the PoseMode hidden Bones separate from EditMode.
  (In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
  mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
  data. Sounds logical, but remember that VertexGroups are partial on a
  Mesh, partial on Object. Weird design decision though...
  Anyhoo, at this moment the only way to have Bone Envelopes deform, is
  by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
  depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
  set.
2005-08-19 12:35:15 +00:00
Erwin Coumans
92731af84f support for __MINGW32__ compiler, it doesn't have __forceinline 2005-08-18 17:32:25 +00:00
Chris Want
e0189e3a96 spack() is no longer used in the blender core, so I moved it to
this gameengine source file that depends on it.
2005-08-18 16:48:10 +00:00
Daniel Dunbar
da930194f9 - added code to draw loose edges in textured and fastshade views 2005-08-18 11:49:33 +00:00
Daniel Dunbar
8c41c00ff7 - added DerivedMesh.drawUVEdges function & implementations
- removed DerivedMesh.drawLooseEdges and replaced with much more
   general drawEdgesFlag function that draws based edge flags.
 - switch DerivedMesh.drawFacesTex to give user control over which
   faces are drawn
 - added object_uvs_changed and object_tface_flags_changed functions
   to do object recalc flag flush/redraw queueing and added calls
   in appropriate places
 - added various edge flags to mark TFace information. This is used
   by the drawEdgesFlag routine and was the best way I could come
   up with to deal with drawing TFace information from modifier stack.
   Unfortunate side effects are (1) uses a lot of MEdge flags (although
   not needed in file so thats fine) and (2) requires recalculation
   of modifier stack on UV selection changes. #2 is disappointing
   but I could not find a better solution.
 - update UV mesh shadow drawing to use modifier result. At the moment
   just uses the final result but probably should be integrated with
   the editmode cage option.
 - convert draw_tfaces3D to use drawEdgesFlag routine which cleaned
   up the code quite a bit.
 - convert draw_tface_mesh to draw using result of modifier stack.
   Same comment about which result actually gets draw in FACESELECT
   mode as for UV editor shadow drawing applies.

There is a still a bug in that selection is using the wrong
mesh to draw.
2005-08-18 11:31:20 +00:00