Commit Graph

3654 Commits

Author SHA1 Message Date
bbb83af14c - converted write_videoscape_mesh to use mesh_get_derived_deform 2005-07-17 01:23:43 +00:00
67d58c0f45 - added DirectMesh.getVert{Co,No} functions
- added mesh_get_derived_deform function (always returns a DerivedMesh
   corresponding to deformed (but not subdivided) mesh). used in places
   where original mesh is to be displayed but with deformed coordinates
   (vpaint for example).
 - added DirectMesh.getVert{Co,No} implementations for MeshDerivedMesh
 - updated vpaint to use mesh_get_derived_deform
2005-07-17 01:18:59 +00:00
7c9422111b another file behind the #USE_BULLET 2005-07-16 22:13:20 +00:00
Alexander Ewering
851d4016f8 Reverted to good line endings 2005-07-16 22:02:59 +00:00
2d73b31aff preparation for bullet physics 2005-07-16 21:47:54 +00:00
3166974a67 - switch M_NMesh_GetRawFromObject to always get mesh data from
DerivedMesh (needs testing)
 - added needsFree argument to mesh_get_derived_final
2005-07-16 21:20:44 +00:00
d2fb9ae533 - added dontFreeNors flag to DispListMesh as well
- changed mesh_get_derived_render to always return a DerivedMesh (even if
   no subsurf)
 - changed init_render_mesh to always get the mesh data through a
   DerivedMesh
2005-07-16 21:16:05 +00:00
6dd382f966 - added dontFreeVerts and dontFreeOther flags to displistmesh for
situations where data can be shared easily.
 - added convertDisplistToMesh function for regular mesh DerivedMesh
   interface (how many times can *you* use mesh in one sentence?)
 - do_puno was uninitialized in init_render_mesh
 - added mesh_get_derived_final (temporary), difference from
   mesh_get_derived is it always returns a derived mesh, even if
   no subsurf.
2005-07-16 21:03:28 +00:00
0d806074b3 - remove call to mesh_modifier from init_render_mesh, shouldn't
be needed anymore
2005-07-16 20:42:20 +00:00
e67ba0ae33 More armature goodies;
The B-Bones!
(where the B can be read as 'block' or 'bezier' or 'b-spline')

- set option on/off in edit buttons, armature panel
- scaling of B-bones only works in editmode, use ALT+S to make bones fatter
  or thinner. Also works for constrainted transform
- In pose mode, you now have a buttons panel with per-bone settings too
  Here you can find the "segments" button, which allows bones to
  interpolate between previous/next bones, including roll.
- Buttons to control interpolation ("In" and "Out" are disabled, doesn't
  work satisfying yet

NOTE: this doesn't give deform yet! Main purpose for now is to test if this
drawing method serves to animate/pose armatures well.
Still need to review proper interpolation methods... maybe bezier is too
limited.
2005-07-16 19:07:02 +00:00
502c34ee49 added Bullet physics binding files 2005-07-16 10:15:31 +00:00
1921a356be Added type for Bullet collision detection and physics engine.
This will improve collision detection and physics for the game engine (Ketsji).
Bullet uses optionally uses the ODE quickstep solver.

Hope this commit doesn't break everything.
2005-07-16 09:55:22 +00:00
Alexander Ewering
3be3e68e2f Fix radiosity "Collect Meshes" to ignore TFaces set to "Invisible".
I hope this doesn't break anything - works fine here.
2005-07-16 01:06:55 +00:00
8d2176bfeb - removed makeDispList, set_displist_onlyzero
- appropriate callers of makeDispList replaced with depgraph calls
 - unappropriate places just killed... small chance this gives some
   errors in corner cases if dep graph isn't notified (example, font
   family displists) but these can be tracked down as they show up.
 - still a large number of callers of makeDispListCurveTypes, but
   makeDispListMesh has just a few.
2005-07-15 20:56:55 +00:00
10d865df25 - remove calls to showkeypos from exit editmode functions, should be
handled by DAG update now. (ton: please confirm)
2005-07-15 18:15:56 +00:00
e0dd08dc52 Part #2 to vert color fix in new subdivide, Please check UV and Vertcolor with new subdivide.
Was checking for a condition < 0 should have been > 1
2005-07-15 18:13:21 +00:00
8c2df5ddd1 - missed a space in header title text 2005-07-15 17:57:40 +00:00
0be013010f - decided it made more sense to make a key_get_active function, switched
to that in editmesh as well as for edit{curve,lattice}
 - added a G.editModeTitleExtra string that gets displayed in header info
   string in editmode. currently used to display "(Key)" when editing a
   key (before there was not UI level display of this info).
2005-07-15 17:55:19 +00:00
5263d588c1 - removed unused actkey field from struct Key 2005-07-15 17:35:10 +00:00
925c024653 - more signedness warning fixes in editsima
- added mesh_get_active_key and replaced code in editmesh to use this
 - removed obsolete code in object_deform
2005-07-15 17:31:58 +00:00
e85355b710 Part #1 of the fix for UV colors in new subdivide code
UV colors on Tri's should go right now when subdivivded,
for Quads, 3 of the for points should be right. Still working on the 4th.
2005-07-15 16:12:34 +00:00
573f86bc3c - remove some redundant drawing code
- mousewheel zooming in drawipo used uninitialized var (MSVC run time
   error).
2005-07-15 15:00:08 +00:00
2501bc1ad6 - static'd several functions in key.c, just for readability 2005-07-15 14:50:48 +00:00
6f264a0e5b BPY Support for Deform Parenting and Vertex Parenting
This adds two new method to the BPY Object type:
 - makeParentDeform
 - makeParentVertex

Both are based on makeParent. In fact, I splitted off the parenting
part of makeParent into an internal function so that all can reuse it. I
also added DEP_graph refresh flag that where missing.

makeParentDeform sets the parent type accordingly for correct
deformation (armature and curve) and checks if the parent and childs are of the
correct type for deformation.

makeParentVertex takes as additional mandatory argument a tuple of
indices to tell the parent which vertex to use. It does some object type
checking too.

Also included documentation. :)

Test file is in the patch there: http://projects.blender.org/tracker/?func=detail&atid=127&aid=2833&group_id=9

Note to Ton: When doing vertex parenting, the dashed parent line is only updated correctly if the objects are on screen when calling the function. If they aren't, the line is wrong and is only corrected when another recalc is called on the parent or child.
2005-07-15 05:30:58 +00:00
5332854a7b - more warning killing: unused vars, double -> float constants, signedness 2005-07-14 22:21:12 +00:00
480b8ce10b - switch em_{vert,solid,wire}offs to be unsigned
- some other twiddles to fix mixed signedness compiler warnings

And from the "Dear lazy programmers" file: After you have extern declared
a variable 5 or more times at the top a function, you would have actually
saved a lot of effort by just putting it in the header where it belonged.
Or perhaps you thought by hiding it no one else would notice you were
using global variables to pass information around. Tsk tsk.
2005-07-14 22:16:38 +00:00
40bfa5c7a1 Appending armature crashed... nasty stuff, but works again :) 2005-07-14 22:04:57 +00:00
8da29921ba - added mesh_get_texspace (should be used instead of direct access)
which calculates texspace on demand if need be.
 - removed almost all calls to tex_space_mesh

There may be a few corner cases where this goes wrong (meshes with vertex
keys) but these should get ironed out by coming modifier system.
2005-07-14 21:57:18 +00:00
0b89046790 - incremental subsurf calc in mesh_changed didn't actually make sure
mesh used subsurf before calc (led to crash when subdiv==0). Woops!
2005-07-14 20:42:43 +00:00
fc0c2ef251 Adding CTRL stepping for Edgeslide. Mouse control is still not finished here, this is just a temporary fix until it can be done right. 2005-07-14 19:44:10 +00:00
3929802335 - switch several instances of makeDispList to use more specific version 2005-07-14 18:14:19 +00:00
6711eb9152 - make mesh_changed invalidate the mesh boundbox as well 2005-07-14 18:06:53 +00:00
b22e3414ca - add mesh_get_bb function to return mesh boundbox and calc if needed
- switch all mesh boundbox access to go through mesh_get_bb
 - switch object_handle_update to call mesh_changed instead of making
   the displist data immediately (delayed calculation)
2005-07-14 18:04:27 +00:00
3f769ff371 - change subsurf_make_derived_from_editmesh to check that subdivision
levels match before proceeding with incremental (need to build new
   subdivision object if levels have changed)
2005-07-14 17:59:36 +00:00
5bcdd33770 - fix extremely dismal approximation of vertex & face counts for
count_object. It is pretty obvious whoever changed this didn't
   think about it much or test it well... *cough* *cough*.
2005-07-14 17:57:27 +00:00
ed8d745e0f Armatures now draw bone names over solid.
(commit of initrender.c is just an added comment)
2005-07-14 17:23:26 +00:00
aa454cd412 - switch to using DAG_object_flush_update instead of mesh_changed
- mesh drawing calculated derived surface before clipping to view matrix,
   waste for offscreen objects
2005-07-14 17:10:44 +00:00
abbda3a8a1 - use cos not cosf 2005-07-14 15:59:42 +00:00
6fefc761cc - declare Mesh.mface and Mesh.tface to be of proper type instead of void* 2005-07-14 15:58:32 +00:00
d22d9ab3c8 - switch to new mesh_set_smooth_flag call (takes mesh object argument
instead of raw mesh)
2005-07-14 15:57:14 +00:00
a2694df9d0 - removed line that slipped in by accident 2005-07-14 15:50:43 +00:00
f265d4925a Bug reported by Guillaume LeCocq
Setting both 'xray' and 'transp' did not work proper. Had to add one
extra check, and switch drawing order. Now a transparent object gets
drawn OK as Xray too. :)
2005-07-14 15:49:31 +00:00
befc2bbc41 - split makeDispList into makeDispList{Mesh,MBall,CurveTypes}, there is
still a makeDispList that dispatches to the appropriate one.
   makeDispList is on the way out and this makes it easier to track down
   exactly which places use makedispList and for what types of objects.
 - switch calls to makeDispList to appropriate more specific function (if
   the object type is known by caller).
 - added mesh_changed function that invalidates cached mesh data (but does
   not rebuild, mesh data gets rebuilt on access). Most old calls to
   makeDispListMesh use this instead now.
2005-07-14 15:48:01 +00:00
1261dc7e4e - part of DerivedMesh interface change from yesterday that got left out 2005-07-14 15:30:30 +00:00
274e4f5a1f Bug fix #2799
Sequence effect "gamma cross" didn't work since 2.36. Caused by not
initialized gamma tables...
2005-07-14 13:50:48 +00:00
4a14cb6f01 Bugfix for #2826
Initialize shadow buffer lamp accidentally altered the ob->obmat for the
lamp. Never showed up before until now (depgraph).
2005-07-14 13:44:59 +00:00
120427e96b Fix for a *very* nasty bug... somewhere in the ancient past - I tracked it
back to 1.4 - comparing pointers apparently gave warnings or errors... I
don't really have a memory of that. Could be the Irix compiler.

What it was used for is sorting edges in arrays or hash lists, like:

  if( ((long)v1) > ((long)v2) )

long is defined to be pointer size, so that should work 32/64 bits, where
it not that the long cast makes the value SIGNED! :)

Ken Hughes discovered this... noting that when his system uses a calloc, the
returned pointer had an uncommon address making the long negative.
It was a very hard bug to track, since (apparently) most OS's have an address
space being still in the lower part of an long...

Anyhoo; I have removed a couple of (long) casts from pointer comparing now,
need to get compile feedback if that's compliant for all our OS's.
If so, quite a lot of such hacks have to be removed from our code, or make
them casting to an unsigned long...

This has been confirmed to fix bugs #2709 and #2710. Thanks Ken!
2005-07-14 13:12:29 +00:00
e5a639a161 New:
- XRAY draw for armatures now is generic "Draw Extra" option for any
  Object type. This feature just moves drawing to the end, after clearing
  the zbuffer again.
- Solid draw mode now displays materials with Alpha, with the new
  "Draw extra" option "Transp" set. This also moves drawing transparent to
  the end, but it doesn't sort the transparent faces. Still looks OK.
  Note: this is not enabled in mesh editmode. Here all the fancy extra
  drawing just makes it nearly impossible to do OK.
- Re-ordered Object Buttons -> "Draw" panel

Fixes:

- do_versions had check for the UserDef in it (new ogl texture cache).
  that can't be there, should be in usiblender.c (stupid exception).
- same error caused reading older files to not always fix version
  changes on armatures (commit yesterday).
- Outline select drawing happened also on picking-select draw, needless
  slowdown.
2005-07-14 12:44:33 +00:00
256a5cd2c0 Databrowse needed new code to handle the hide dot file correctly.
Added a comment explaining what and why.

Also added a couple of explicit cast to make compiler whine less (double to float mostly).
2005-07-14 06:25:02 +00:00
b89035906d Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit

-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
2005-07-14 03:34:56 +00:00