Commit Graph

1815 Commits

Author SHA1 Message Date
Kester Maddock
b97c77df2b Check for zero normal vectors in the clip planes (if eg Python has set a strange projection matrix)
Fix the transformation of the frustum bound sphere to world coordinates.
2004-05-30 11:04:26 +00:00
Ton Roosendaal
62c333a562 report #1338
Switched order of routines for displacement and autosmooth, where the
autosmooth will be last now. This prevents displaced (loose) faces, and
might give attractive sharp edges in other cases too.
2004-05-29 19:46:46 +00:00
Ton Roosendaal
d2dbc96b81 bug #1340
Key alpha (render) set alph component at '1' for sky... this is an old
convention from NeoGeo days, and I have absolutely no clue whatfor...
maybe for some antique amiga iff format or so. Made it zero now.
2004-05-29 17:33:30 +00:00
Ton Roosendaal
690a430bcb Counter of mballs, before polygonize, had error in taking linked mball-
data into account, causing errors modeling.
2004-05-29 17:00:51 +00:00
Ton Roosendaal
dbfe3daec3 Oh, the fix is an addition of a OB_NEG_SCALE flag in ob->transflag, which
is calculated in where_is_object.
Negative scale is found by a cross product of first 2 rows in matrix, and
comparing that (dot product) with third row.
2004-05-29 16:22:07 +00:00
Ton Roosendaal
6b51c684f1 NEW! Blender now displays flipped (negative scaled) Objects correctly in
OpenGL draw.

(BTW: the previous commit also solves raytrace errors with negative scaled
objects...)

Further a cleanup of displaylist flags and object/base flags. The #define
ACTIVE is moved to filesel.c (only used here).
The GONNA_MOVE #define got a OB_ added in front.
2004-05-29 16:17:46 +00:00
Ton Roosendaal
59dad6aefc Recoded the methods how normals get corrected and flipped during render
conversion. Old method tried to solve it per object, detecting a flipped
matrix. Since we have displacemapping and raytracing this is too inaccurate.
Also, flipping normals should alsways result i correct flipped vertex-
normals too.

Solution is to completely recalcuate the 'puno' (vertex normal) flags in
renderHelp.c now (set_normal_flags). The face normals themselves are not
flipped until that stage.

Second major improvement involves the calculation of correct splitted
triangles, when a quad is not flat. It now creates triangles based on the
vertex normals, which have actual information on surrounding geometry, thus
resulting in much smoother results.
Without this you get errors in ray-shadow, with light shining almost
parallel to a face. But again, displacement mapping improves with it too.

Third fix is that by removing normal flipping from displace code the result
is much better now.
2004-05-29 16:14:34 +00:00
Ton Roosendaal
993a89e2a5 Bug fix 1332
EnvMap render now uses the percentage button for size (f10 buttons).
That wasn't implemented yet for saving envmaps....
2004-05-27 17:54:26 +00:00
Kent Mein
173ecf172a Panagiotis Papadakos's patch to fix the following:
Implicit declaration of swab in Linux, needs to define __USE_XOPEN at
source/blender/src:

I also added #includst <stdlib.h> to this file to fix it on solaris as well.

Kent
2004-05-27 14:54:14 +00:00
Ton Roosendaal
954e5546ea In drawing solid objects ("Solid" drawmode) there were material
switches (glMaterial) inbetween a glBegin and glEnd. Combined with a
switch of glShadeModel however, on recent Nvidia it caused faces not
to be drawn... dunno if this is official compliancy, but not too
complex just to correct.
2004-05-26 21:04:02 +00:00
Kester Maddock
8253d3e041 Python fixes:
Reenabled the setScript/getScript methods for python controller bricks.
Set the ray source point to MouseFocusSensor.getRaySource works.
Added: Python -> MT_Quaternion
MT_Matrix4x4, MT_Matrix3x3, MT_Vector3, MT_Point3 -> Python

Correct transform of frustum bound sphere centre point to world coordinates
2004-05-26 12:09:17 +00:00
Kester Maddock
3dd18c5c34 Added an UpdateTransform callback from SceneGraph -> Physics.
Profiling revealed that the SceneGraph updated every physics object, whether it moved or not, even though the physics object was at the right place.  This would cause SOLID to go and update its bounding boxes, overlap tests etc.
This callback handles the special case (parented objects) where the physics scene needs to be informed of changes to the scenegraph.

Added Python attributes (mass, parent, visible, position, orientation, scaling) to the KX_GameObject module.
Make KX_GameObject use the KX_PyMath Python <-> Moto conversion.
2004-05-26 12:06:41 +00:00
Kester Maddock
e5cc9abceb Fix Bug #1309 Disabling Actor leaves Ghost, Dynamic and Rigid Body etc enabled.
Depth sorting for Transparent polygons.  Use ZTransp in Material buttons to enable.
This will cause an object's polygons to be sorted (back to front for alpha polygons, front to back for solid polygons.)
2004-05-26 12:01:08 +00:00
Stephen Swaney
05e76c22b0 bugfix: #1322 minor tweaks to the documentation for Draw module.
Blender.Draw.Button() was not showing up.  Seems to be an epydoc
issue with Button() being both a module method and the name of a class.
I changed Button to Button_ and added a usage note.
Yes, this is lame.
2004-05-25 19:59:41 +00:00
Jacques Guignot
5e3a9c092a Changed parameters names in addCurve function (suggested by Paolo)
DLoc* --> dLoc*
DRot* --> dRot*
DSize* --> dSize*
updated doc (Ipo.py)
2004-05-25 19:31:13 +00:00
Brecht Van Lommel
f99099109f Fixed a potential bug in the uv editor transform function, a check if the tface
might be only an edge was missing in one of the loops.

Fix a crash that would sometimes happen when clicking the texture painting
button in the image window header. Made headerbuttons_packdummy a static
variable again. The uiDefBut call for the texture painting button stores a
reference to it, so it must be kept in memory.
2004-05-25 19:06:48 +00:00
Willian Padovani Germano
8a64e0e867 BPython:
- Campbell Barton contributed another function (thanks again), the Image.reload method:
  with this a script can keep an image that is being edited and saved by an external program updated in Blender.
2004-05-25 10:36:58 +00:00
Matt Ebb
f9fa705cd3 * Added support for python scripts to register themselves
in the UV/Image editor 'UVs' menu

Script authors can use:
Group: 'UV'
 in the headers of their scripts to let them appear in
 this menu.

* Updated the UV Face Layout script to reside in the UVs
 menu, rather than the (incorrect) File->Export menu.
2004-05-25 06:08:49 +00:00
Joseph Gilbert
779d0d0221 - documentation update for new functions
- error corrections in NLA about dictionaries
2004-05-25 03:26:29 +00:00
Joseph Gilbert
1308786974 - added Boneclass support
- ability to get a bonespace/worldspace bone matrix
- get ik flag
- some tweaking to matrix updates for addBone()
2004-05-25 02:48:02 +00:00
Nathan Letwory
cfda234450 After hearing that the reason for do_common_editbuts being in buttons_object.c I decided to move it to buttons_editing.c, where it logically belongs. Matter of copy and paste (and deleting from buttons_object.c :)
Now poor newcomers can more easily find the editing buttonevent handling code.
2004-05-24 19:48:07 +00:00
Matt Ebb
af0579b578 Added the hotkey for Bevel in the menus 2004-05-24 13:46:36 +00:00
Kester Maddock
a96955efc2 Game Python Reference Manual.
This manual lists all the Python classes and modules for Game Objects, Sensor bricks, Controllers etc.
Missing: Actuator & Controller reference.
2004-05-24 07:49:50 +00:00
Ton Roosendaal
86899e7a22 Changed two shorts in int, for calculation of distance between bezier point
and mouse coordinate in selecting routine.
Caused selection not to work in extreme zoom ins.
(Thanks OOPz!)
2004-05-23 19:13:15 +00:00
Willian Padovani Germano
7f6b88e389 BPython:
- updated docs with recently added functions
- dynamic menu entries now are sorted (alphabetically, of course)
- added new menu categories for scripts: Wizards, Modifiers, Generators, Materials, Animation:
  only added to list of options, didn't mess with any Blender header.  They are already available from the "Scripts" menu in the scripts win, but not elsewhere.
- added option 'datadir' to Blender.Get(option):
  so scripts can use .blender/bpydata for reading / writing their data files.
2004-05-22 20:25:22 +00:00
Kester Maddock
4551490dd4 near & far are reserved words on MSVC. Don't use them as variable names. 2004-05-21 14:09:18 +00:00
Kester Maddock
a7456b37f1 Cunning hack for Blender python module in the game engine - just don't unload it before running the game! 2004-05-21 09:27:42 +00:00
Kester Maddock
e957b12f0e Frustum sphere culling.
Do a sphere<->camera sphere and a sphere<->frustum before the box<->frustum test.
2004-05-21 09:21:15 +00:00
Kester Maddock
1217928e66 Fixes for Camera objects and python:
Normalise clip planes for sphere testing.
Do a frustum-sphere <-> sphere test
Reference count all python objects (!)
2004-05-21 09:18:42 +00:00
Kester Maddock
22883f9232 Query GL for max number of lights to use. 2004-05-21 08:56:05 +00:00
Kester Maddock
e78ef29a59 Depth sorting for alpha mesh objects.
- Mesh Objects are sorted by depth (based on object centre.)  Using object centre means the user has control over the sort.
- Polygons are not sorted.
- Polygons are not split.
- O(nlog(n))
2004-05-21 08:55:12 +00:00
Matt Ebb
2a622e35d4 Added Shift C 'Center Cursor and View All' to View -> Align View menu 2004-05-21 01:35:10 +00:00
Matt Ebb
af6d9fb7a5 A few hotkey additions/corrections to the toolbox and 3d view menus. 2004-05-20 12:27:21 +00:00
Stephen Swaney
8391f0c337 add some explanation about Object.Layer being a bitmask. 2004-05-20 07:21:07 +00:00
Stephen Swaney
2124168e21 removed unused var in Object.getBoundBox()
bugfix: #1212 changing object's layer had no effect.
2004-05-20 06:26:43 +00:00
Martin Poirier
dbb6dc5d2f Bug #1289
Mirror menu missing in the Header Menu for most object types in edit mode

http://projects.blender.org/tracker/index.php?func=detail&aid=1289&group_id=9&atid=125
2004-05-20 01:22:43 +00:00
Ton Roosendaal
e67713c113 Removed a bzero from octree-filling, replaced with exact code what
needs cleared. Timings go down nice:

octree new     2.33a

128    0:04.2  0:07.5
256    0:06.5  0:20.0
512    0:18.0  2.06.9

Time is including initialize renderfaces etc. 100k quads.
2004-05-19 19:30:43 +00:00
Willian Padovani Germano
1ff3066a9a BPython:
-- Added two new functions to the Draw module, to display int and float popup buttons:
    Both contributed by Campbell Barton, thanks!
-- Fixed a couple warnings.
2004-05-19 01:28:12 +00:00
Ton Roosendaal
1a6329533f Removed double #defines from include, added some comments in code, and
added define for future use to bring back old (fast) AA.
2004-05-18 20:00:51 +00:00
Ton Roosendaal
ec45e4ad78 Patch provided by Matthew Plough for better view zoom with CTRL+middle
mouse.

For me it's a good replacement, and more intuitive & compatible. Now
let's wait for the storm of reactions...
2004-05-18 19:59:50 +00:00
Willian Padovani Germano
022bff122f BPython:
- Finally added Blender.Load function for loading .blend files, useful for demos, for example.
- Moved data from Blender.h to Blender.c.  We'll keep doing this where it applies and someday remove all unused files at once.
2004-05-18 03:23:45 +00:00
Kester Maddock
fba0e401c9 Compiler portability fixes (MSVC 6) 2004-05-17 23:56:56 +00:00
Ton Roosendaal
a6458b3cfa <blush> this should have been part of render commit of some days ago.
This fixes errors in quads that are non-planar...
2004-05-17 21:40:00 +00:00
Matt Ebb
a1f5e64239 Tweaked the display and positioning of tooltips so they aren't obscured by the mouse pointer.
This is addressing bug #952
2004-05-17 14:36:13 +00:00
Kester Maddock
5454280f6c Same again - change static const for MSVC++ 2004-05-17 09:06:54 +00:00
Kester Maddock
0f447ac5a8 Fix for MSVC .NET, which can't handle static const declarations in classes.
Make it static, and define in SM_Object.cpp
2004-05-17 08:31:35 +00:00
Kester Maddock
6f4272a200 Fix for bug 1245: Vertex Colours are wrong in GameBlender. 2nd try.
http://projects.blender.org/tracker/index.php?func=detail&aid=1245&group_id=9&atid=125

The member names of MCol are wrong, so we will convert to unsigned char* like the rest of blender.
2004-05-17 00:42:07 +00:00
Ton Roosendaal
1adae69b5f Rewind of change in MCol structure.
Kester: since this is in DNA, it backwards converts all R into B now,
which isn't the bug. On big endian systems (OSX) there engine colors
are OK, which indicates the conversion of MCol goes wrong on the
engine side, by using some endian-sensative approach.

The main confusement is, that the MCol struct isn't in use for read
or write in Blender, only for a save in files. The contents of that
struct is wrong, yes. See note in vpaint.c top.
2004-05-16 16:25:40 +00:00
Kester Maddock
a0d82b242f Drawing cylinder & cone bounding objects according to how they will act in the physics simulation. 2004-05-16 13:23:59 +00:00
Kester Maddock
bab6e5ce36 Cleanup unused/commented out code, compiler warnings, coding standards etc. 2004-05-16 13:10:10 +00:00