Commit Graph

13526 Commits

Author SHA1 Message Date
Benoit Bolsee
234b616078 BGE bug #17459 fixed: action actuators depending on their order in the actuator list. 2008-08-31 21:53:39 +00:00
Benoit Bolsee
7f257df5b4 BGE patch 17547 applied in trunk: Cleaned up pydoc for BGE, compiles now error free 2008-08-31 19:07:10 +00:00
Benoit Bolsee
74339c639a BGE patch approved: BGE Multiple Joysticks 2008-08-31 18:42:58 +00:00
Joshua Leung
a4e74c92f7 == Grease Pencil Conversions - Armature ==
Can now also convert active layer to a series of bone chains. Each stroke will be converted to a chain of connected bones.

At the moment, it is still necessary to manually recalculate roll angles after the armature has been created, as the bones are not assigned the correct roll angles yet.
2008-08-31 12:47:04 +00:00
Joshua Leung
6aee42daaf Bugfix #17551: AutoKey for Visual Keying non-functional
No VisualKeying checks were being done
2008-08-31 07:33:27 +00:00
Daniel Genrich
9818b8a95c Fix for win64 building (gettextlib had wrong name) 2008-08-31 01:57:53 +00:00
Daniel Genrich
25c116e80a Fixing typo to make compile working again 2008-08-30 23:12:01 +00:00
Nathan Letwory
ff0aab05b2 patch for bug #17553: material emit is allowed to go from 0.0 to 2.0; however curves only make it go to 1.0
reported and patched by slikdigit
2008-08-30 21:41:02 +00:00
Kent Mein
4d888fb6c8 Added missing null check to convertmenu
Remported by alxarch.
If you remove the active object and then tried alt-c it would crash.

Kent
2008-08-29 14:19:34 +00:00
Joshua Leung
b77e130dd6 Grease Pencil:
* Added 'Convert To...' button for easy access to conversion tool. The hotkey has been mentioned in the tooltip. This replaces the 'Del Active Frame' button in 3d view only.

Armature Apply Pose:
* Added menu entry (beside Relax Pose)
* Bone-parented objects now get their parent inverse matrices correctly recalculated
* Changes for 'scale' code in previous commit wasn't correct... reverting
* IPO/anim flush protection is now set on bones to prevent them from being sprawled everywhere after applying
2008-08-29 12:24:07 +00:00
Joshua Leung
ff06fcfc33 Bugfix:
* Roll is now correctly calculated for Apply Armature
* Scale on x,z axes is no longer cleared (only scale on y axis needs to be)
2008-08-29 11:15:24 +00:00
Joshua Leung
bcff5afeb2 == Grease Pencil ==
Special request by Alxarch for Architecture:
Hold Ctrl-Key when 'Draw Mode' is enabled to draw straight lines. 
Although when drawing the stroke, the stroke will still be freehand, the final result will be a line between the endpoints of that stroke. This is useful for annotations of sectioning lines + site maps, etc.
2008-08-29 10:47:53 +00:00
Campbell Barton
e21b3d81c5 Use Py_ssize_t rather then int, broke building on 64bt linux 2008-08-29 06:32:42 +00:00
Campbell Barton
f60992daae BGE Py API - GameKeys.EventToString() utility function, makes key configuration menu's easier to write.
own error with blenderplayer, wasnt decreffing the GameLogic module, probably didnt matter since python was restarted anyway, but is incorrect.
2008-08-29 03:15:17 +00:00
Benoit Bolsee
272132888f BGE patch: add X-Ray option to ray sensor. The option is effective only if a property is set: the sensor will ignore the objects that don't have the property. 2008-08-28 19:37:49 +00:00
Joshua Leung
9f10007bfb == Apply Current Pose as New Restpose ==
In PoseMode, the Ctrl-A hotkey can now be used to apply the current pose as the new restpose for the armature. 

Notes:
* Roll correction may not be totally correct on bone chains, but is ok in most cases.
* Objects that are bone parented to the armature where this is applied are not correctly adjusted yet. 
* It is advisable to 'apply' the existing armature deformations to geometry deformed by the armature before applying this, to prevent unexpected results.
* No menu entry yet... will add in due course.
2008-08-28 12:22:55 +00:00
Benoit Bolsee
9f89f4cf34 compilation problem with gcc, memset undeclared 2008-08-28 12:12:56 +00:00
Benoit Bolsee
6a98b9215c final fix for compilation problem with KX_RayCast::Callback template in gcc 2008-08-28 11:13:04 +00:00
Benoit Bolsee
116001ac34 more fix for compilation problem with KX_RayCast::Callback template in gcc 2008-08-28 11:06:46 +00:00
Joshua Leung
bf7387b2d8 GPencil Bezier Curve Conversion:
Now sets vector/free handles by default
2008-08-28 10:43:17 +00:00
Benoit Bolsee
84d1dfb89b patch for compilation problem around KX_RayCast::Callback template with gcc 2008-08-28 10:28:06 +00:00
Joshua Leung
1032da67cc Grease Pencil - Curve Conversion Improvements:
* Changed hotkey from Alt-C to Alt-Shift-C so that it works when the active object cannot be deselected/deactivated.
* Added option to convert to bezier curves. Note that currently, the handles are simply placed to the same location as the point so that there is an exact match with the gpencil strokes. In future, it would be interesting to investigate using proper curve-fitting algos instead.
2008-08-28 10:19:34 +00:00
Campbell Barton
794ffdcd2c didnt build before committiong this small change :/
isLight() is apricot only. Add this back when GLSL is merged to avoid conflicts.
2008-08-28 09:02:04 +00:00
Benoit Bolsee
c8d0a540f5 BGE patch: fix division by 0 error when sound sample cannot be loaded in sound actuator. 2008-08-28 08:13:58 +00:00
Campbell Barton
f88c5d9721 BGE Bugfix, lights were not being removed when their gameobject was removed causing odd shadows to hang about the scene. 2008-08-28 07:03:23 +00:00
Campbell Barton
2934e78a86 remove more python functions from builtins that could allow scripts to do bad stuff.
- reload, file, execfile, compile
These are only removed when running in higher security mode thats not default in blender.
2008-08-28 05:45:20 +00:00
Benoit Bolsee
becd467be8 BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return true face normal and hit polygon information.
rayCast(to,from,dist,prop,face,xray,poly):

The face paremeter determines the orientation of the normal: 
  0 or omitted => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
  1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
The prop and xray parameters interact as follow:
    prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
    prop off, xray on : idem.
    prop on,  xray off: return closest hit if it matches prop, no hit otherwise.
    prop on,  xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
if poly is 0 or omitted, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
if poly is 1, returns a 4-tuple with in addition a KX_PolyProxy as 4th element.

The KX_PolyProxy object holds information on the polygon hit by the ray: the index of the vertex forming the poylgon, material, etc.

Attributes (read-only):
 matname: The name of polygon material, empty if no material.
 material: The material of the polygon
 texture: The texture name of the polygon.
 matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
 v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
 v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
 v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
 v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
     use this to retrieve vertex proxy from mesh proxy
 visible: visible state of the polygon: 1=visible, 0=invisible
 collide: collide state of the polygon: 1=receives collision, 0=collision free.
Methods:
 getMaterialName(): Returns the polygon material name with MA prefix
 getMaterial(): Returns the polygon material
 getTextureName(): Returns the polygon texture name
 getMaterialIndex(): Returns the material bucket index of the polygon. 
 getNumVertex(): Returns the number of vertex of the polygon.
 isVisible(): Returns whether the polygon is visible or not
 isCollider(): Returns whether the polygon is receives collision or not
 getVertexIndex(vertex): Returns the mesh vertex index of a polygon vertex
 getMesh(): Returns a mesh proxy

New methods of KX_MeshProxy have been implemented to retrieve KX_PolyProxy objects:
 getNumPolygons(): Returns the number of polygon in the mesh.
 getPolygon(index): Gets the specified polygon from the mesh.

More details in PyDoc.
2008-08-27 19:34:19 +00:00
Benoit Bolsee
f6bdba8351 Bullet patch: option to return true face normal, complete triangle information and broad phase filter. This patch is needed to support enhanced ray cast function in the BGE. I have proposed it to the Bullet forum for inclusion in the next Bullet version. 2008-08-27 19:16:21 +00:00
Joshua Leung
c6acbc3047 == Grease Pencil - Conversions + Bugfixes ==
* New stuff: Grease Pencil strokes on the active layer can now be converted to 3d curves (geometry). More work is still needed to make the result look be more optimal (i.e. extruded curve)

* Bugfix: Spacing between collapsed layers is more compact now
2008-08-27 13:02:44 +00:00
Campbell Barton
6cccdf0cb2 BGE bugfix, ipo actuator's foce option didnt check that the object was dynamic. 2008-08-27 06:02:10 +00:00
Campbell Barton
d566765635 get/set Angular velocity for KX_GameObjects python api and for the AddObject actuator.
Needed so objects created in an explosion could start spinning without having motion actuators and collision sensors on each item.
2008-08-27 03:34:53 +00:00
Campbell Barton
6778c8dc29 BGE: allow sound actuators to be converted even when they have invalid samples
without this, an incorrect sound path could cause scripts to to fail, making some functionality not work at all.

This also fixes a problem where samples would be loaded multiple times.
2008-08-27 01:03:55 +00:00
Daniel Genrich
0b523ac3e6 Particle System: a) Fixing visibility bug when a duplipart-system was deleted it didn't show up in during render any more, b) fixing possible crash during render 2008-08-26 01:07:18 +00:00
Kent Mein
b81bdfdc7c TLC needed for Makefiles to get gameengine compiling again.
Sorry it took me so long to do this :)

Kent
2008-08-25 19:50:17 +00:00
Chris Want
e3961717be Patch #17517 from Enrico Fracasso (thanks!)
Explicitly setting CMake policy CMP003 to obey the CMake 2.6
way of dealing with how to find libraries when the full path
isn't known. See:

http://www.cmake.org/HTML/cmake-2.6.html#policy:CMP0003
2008-08-25 15:33:18 +00:00
Daniel Genrich
10bcba77b1 Crash fix for having wind noise + particles (reported by Wahooney) 2008-08-25 13:49:55 +00:00
Daniel Genrich
683aabae93 Fixing compiler warning due to unsed code 2008-08-25 11:49:58 +00:00
Janne Karhu
d37f0325ca Effector fall-off power was off by one for spherical, magnet, harmonic and charge fields. For example a square fall-off was reduced to linear etc. 2008-08-25 11:46:55 +00:00
Joshua Leung
afa8a76f46 Grease Pencil Eraser - Bugfix:
* 3d strokes could only be erased from start of stroke 
NB: 3d-strokes could be erased starting from previous commit
2008-08-25 11:09:19 +00:00
Campbell Barton
b5d254445c getting the last created object would return an object that had no SG_Node which would crash whenever python tried to get its location.
since the object was removed from the scene anyway, there is no reason to return it.
2008-08-25 09:52:38 +00:00
Joshua Leung
1ed408e8c6 == Grease Pencil - Drawing + Eraser Improvements ==
Drawing Improvements:
* Single 'dots' now draw rounded
* Strokes being drawn are drawn 'solid' instead of as dotted lines

Eraser:
* Now operates interactively, so no more wait to see if stuff was erased
* An influence circle is now drawn - the radius of this is defined as the thickness^2
2008-08-25 06:22:21 +00:00
Martin Poirier
5e13055849 Little feature request
Adding numerical input support to edge slide (and at the same time, loop cut).

Also clean up NumInput functions for external use. I might have a second pass at this to make it even easier.
2008-08-24 20:57:56 +00:00
Martin Poirier
bdcf3783d7 [#17433] Cannot break node links with LMB drag under linux.
Grease pencil commit added some panel draw code or whatnot which seems to change the matrix stack in unwanted (in this case) ways. Reset to identity fixes it.

* I don't think it was limited to Linux though
2008-08-24 15:22:44 +00:00
Hans Lambermont
b33e57952c fix settings for freebsd7 2008-08-23 13:12:17 +00:00
Benoit Bolsee
bc8f002a4c BGE state system improvement: the sensor with Level option enabled will trigger the controller of a newly activated state, even if the sensor is already connected to an active state; new isTriggered() python function to determine which sensor triggered the current controller.
Previously, this behaviour was available only for sensors
that were not connected to any active state, which was
forcing the game designer to duplicate sensors in some 
cases.
For example the Always sensors used to initialize the 
states needed to be duplicated for each state. With this
patch, a single Always sensor with Level option enabled
will suffice to initialize all the states. 
A Python controller can determine which sensor did trigger
with the new SCA_ISensor::isTriggered() function.

Notes:
- When a sensor with level option enabled is connected
  to multiple controllers, only those of newly activated
  states will be triggered. The controllers of already
  activated states will receive no trigger, unless the 
  sensor internal state toggled, in which case all the
  controllers are triggered as always.
- The old isPositive() function returns the internal
  state of the sensor, positive or negative; the new 
  isTriggered() function returns 1 only for sensors
  that generated an event in the current frame.
2008-08-23 11:54:27 +00:00
Andre Susano Pinto
2076703a28 Removed cast warnings from shrinkwrap.c and BLI_kdopbvh.c
Only unused functions and openmp warnings left on those.
2008-08-22 18:28:34 +00:00
Benoit Bolsee
7630539fe8 Fix Windows compilation problem and update MSVC project files 2008-08-22 15:00:30 +00:00
Ton Roosendaal
39a8125e4c Typo in copyright notice (VF -> BF) 2008-08-22 12:48:12 +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
Joshua Leung
c230bc4a82 Grease Pencil - Drawing Improvements:
This commit finishes the work started in the previous commit. 
1) Reduced the effects of 'shrinking' lines with acute angles (*)
2) Ends of strokes now get crude end-caps which look ok for most purposes (they are really just simple trapeziums not fancy semicircles)

* Note: some shrinking does still occur if the stroke was drawn quickly enough for few points to be recorded. Also, although there are still zones of overlapping when there are acute angles, this is reduced to steeper angles (and is not too bad considering real-life materials)
2008-08-22 11:46:59 +00:00