Commit Graph

12543 Commits

Author SHA1 Message Date
Martin Poirier
ff52dcbf0d Bugfix: Transform Snap
Would crash if snapping from a mesh in edit mode to a group instance including that same mesh.

Reported by UncleZeiv on IRC
2009-01-18 22:09:29 +00:00
Campbell Barton
c0ecbfce0e blender was crashing if no argument was given after '-t'
mesh.faces.deltete(...) with an empty list no longer returns an error.
2009-01-15 18:06:06 +00:00
Benoit Bolsee
509ca83ef1 BGE patch 18065: gameobj mass writeable + setmass actuator. This patch allows to change the mass of a dynamic or rigid body object during the game. Two methods are available: in a Python script by setting the mass attribute of the game object; by logic brick with the Edit Object->Dynamics->Set Mass actuator. The mass can only be set on dynamic objects and must be a positive floating point value. 2009-01-14 22:33:39 +00:00
Benoit Bolsee
00c12e0906 BGE patch: dynamically update the coumpound parent shape when parenting to a compound object.
This patch modifies the way the setParent actuator and KX_GameObject::setParent() function
works when parenting to a compound object: the collision shape of the object being parented
is dynamically added to the coumpound shape. 
Similarly, unparenting an object from a compound object will cause the child collision shape
to be dynamically removed from the parent shape provided that is was previously added with 
setParent.

Note: * This also works if the object is parented to a child of a compound object: the
        collision shape is added to the compound shape of the top parent.
      * The collision shape is added with the transformation (position, scale and orientation)
        it had at the time of the parenting.
      * The child shape is rigidly attached to the compound shape, the transformation is not
        affected by any further change in position/scale/orientation of the child object.
      * While the child shape is added to the compound shape, the child object is removed from
        the dynamic world to avoid superposition of shapes (one for the object itself and
        one for the compound child shape). This means that collision sensors on the child
        object are disabled while the child object is parent to a compound object.
      * There is no difference when setParent is used on a non-compound object: the child
        object is automatically changed to a static ghost object to avoid bad interaction
        with the parent shape; collision sensors on the child object continue to be active
        while the object is parented.
      * The child shape dynamically added to a compound shape modifies the inertia of the
        compound object but not the mass. It participates to collision detection as any other
        "static" child shape.
2009-01-13 22:59:18 +00:00
Campbell Barton
0066b6a8aa fix for big in yesterdays commit, color values were not initialized 2009-01-13 05:55:48 +00:00
Campbell Barton
d0b953d860 can now add sequencer effects with the python api
also fixed crashes when incorrect args were used

cross = 13; track= 5; frame = 1 # no effect constants 
scene.sequence.new((cross, seq1, seq2), frame, track)
2009-01-12 15:58:32 +00:00
Benoit Bolsee
9ce30005de BGE bug #18070 fixed: 2dFilter actuator is always pulsed. 2009-01-02 22:15:05 +00:00
Benoit Bolsee
10702bf93f BGE API cleanup: more bricks converted to attributes. 2009-01-02 22:09:57 +00:00
Benoit Bolsee
cc569504d0 BGE API Cleanup: update the python attribute definition framework.
* Value clamping to min/max is now supported as an option for integer, float 
  and string attribute (for string clamping=trim to max length)
* Post check function now take PyAttributeDef parameter so that more 
  generic function can be written.
* Definition of SCA_ILogicBrick::CheckProperty() function to check that
  a string attribute contains a valid property name of the parent game object.
* Definition of enum attribute vi KX_PYATTRIBUTE_ENUM... macros. 
  Enum are handled just like integer but to be totally paranoid, the sizeof()
  of the enum member is check at run time to match integer size.
* More bricks updated to use the framework.
2009-01-02 17:43:56 +00:00
Campbell Barton
abd4934d1a fix for a memory leak in NMesh (deprecated api) while looking at bug report...
[#18139] Memory Leaks while using Py_BuildValue
2009-01-01 16:18:54 +00:00
Benoit Bolsee
2dfd34994f BGE API cleanup: introduction of a generic framework to link Python attributes to logic brick class member. See KX_PYATTRIBUTE macros in PyObjectPlus.h. 2008-12-31 20:35:20 +00:00
Benoit Bolsee
cbceb6c8b2 BGE API cleanup: more consistent type check on set attribute (mouse and keyboard so far). Check type after name so that the user get a type error when assigning a wrong type to a built-in attribute. 2008-12-30 16:44:34 +00:00
Campbell Barton
bd97dd0846 mistake in previous commit, stopped CurNurbs from appending 2008-12-30 05:00:19 +00:00
Benoit Bolsee
1c663bbc7e First batch of GE API cleanup.
The principle is to replace most get/set methods of logic bricks by direct property access. 
To make porting of game code easier, the properties have usually the same type and use than
the return values/parameters of the get/set methods. 
More details on http://wiki.blender.org/index.php/GameEngineDev/Python_API_Clean_Up

Old methods are still available but will produce deprecation warnings on the console: 

"<method> is deprecated, use the <property> property instead"

You can avoid these messages by turning on the "Ignore deprecation warnings" option in Game menu.

PyDoc is updated to include the new properties and display a deprecation warning
for the get/set methods that are being deprecated.
2008-12-29 16:36:58 +00:00
Campbell Barton
aa56346b12 * disable back buffer selection drawing while projection painting (was redoing for every update while painting)
* remove unneeded return from game engines py api - ConvertPythonToGameObject
2008-12-24 21:53:15 +00:00
Campbell Barton
cbebe4ad46 * bpy curve api wouldn't give correct errors for bad arguments when appending nurbs.
* the radius on the curves first point was ignored. 
* mesh_edges2curves.py was giving all points a tilt of 1.0
2008-12-24 15:46:26 +00:00
Campbell Barton
3a4ead8f0f fix for own mistake - [#18119] Texture Paint: "clone from layer" button not drawn in buttons window 2008-12-24 02:06:34 +00:00
Benoit Bolsee
05fc2aa9da pose_grab_with_ik_clear(): fix bug with memory used after being freed. 2008-12-22 16:56:14 +00:00
Joshua Leung
601fb5e6fa Bugfix - Fixed crashes in Action Editor on Ctrl-L due to missing NULL checks. 2008-12-22 10:52:17 +00:00
Campbell Barton
f288a43457 define WITH_CCGSUBSURF isnt used anymore 2008-12-21 03:11:32 +00:00
Campbell Barton
eb1d0e139f Bugfix since rev 2, BLO_setversionnumber() was using sizeof(array), which gives the sizeof the pointer, not the array.
On a 64bit system I assume this would set 8 chars of a 4 char array.

Turns out this isnt such a problem since BLO_setversionnumber isn't used anymore but way as well commit.
2008-12-20 17:09:45 +00:00
Campbell Barton
c67d26602f id prop update function was receiving a tuple when it only needed a single arg 2008-12-20 08:41:46 +00:00
Campbell Barton
630c16feb7 patch [#18110] [patch] Update blenderplayer.exe -h text
from Mitchell Stokes (moguri)
2008-12-20 07:12:38 +00:00
Benoit Bolsee
5881922bc5 Add G_FILE_IGNORE_DEPRECATION_WARNINGS option to G.fileflags in preparation of BGE python API cleanup 2008-12-19 20:35:53 +00:00
Campbell Barton
3c9ae035fb Typo was making actuator.getExecutePriority() crash 2008-12-19 03:26:41 +00:00
Daniel Genrich
a755342b14 Bugfix for crash with loading fluidsim files, reported by Gimble3d and nudelZ 2008-12-18 22:08:57 +00:00
Benoit Bolsee
04ef5be177 FFmpeg upgrade to revision 12758 (avformat version 52.13): support libavdevice for video capture in VideoTexture module (BGE). Makefile, CMake, scons updated. FFmpeg binaries will have to be rebuilt for certain OS (irix), win32 binaries already up to date. You MUST do a clean rebuild after this patch. Scons users: pay attention that the config/<os>-config.py files have changed, adapt your user-config.py in consequence 2008-12-17 20:52:39 +00:00
Nathan Letwory
3c886d7c38 * commit r17900 by Genscher was wrong.
- Instead of defining such defines for the entire codebase in Blender.py, add
    the right checks and definitions to the places where it matters.
  - Only check+set WITH_BULLET instead of also GAMEBLENDER=1
  - NOTE: No global defines allowed in BlenderLib.
2008-12-17 05:40:40 +00:00
Daniel Genrich
9776749438 Reverting revision 17417 which broke cloth collisions which check also in blenkernel/intern for WITH_BULLET 2008-12-17 00:41:07 +00:00
Campbell Barton
882d85a968 Patch from Banlu Kemiyatorn
replace VecMulf(var,-1) with new VecNegf(var) function.
2008-12-16 12:32:10 +00:00
Campbell Barton
4da3c4b9d5 fix for [bf-blender-Bug Tracker][18089] scons compiling bug
and removed unused vars
2008-12-16 11:26:55 +00:00
Chris Want
024b4b3dda B
Linking of blenderplayer was failing with unresolved symbols
(initVideoTexture) when building without FFMPEG. Needs
testing with SCons and Makefiles.
2008-12-15 20:53:45 +00:00
Chris Want
b99f74c8e8 Make sure that WITH_OPENEXR is defined when sources are configured
with OpenEXR in the CMake system. This is a compilation fix from
Miguel A. Figueroa Villanueva for building Debug versions of Blender
using OpenEXR (thanks!).
2008-12-15 17:47:57 +00:00
Ton Roosendaal
4d21036829 bugfix #17989
Patch from Xavier Thomas.

Compositor, filter node, had shifted output when used on single-value
buffers.
2008-12-15 08:37:39 +00:00
Campbell Barton
d99686a783 Touch/NoOverwrite options were not disabled for video. 2008-12-15 08:29:31 +00:00
Ken Hughes
ba6972eb4d Python API
----------
Bugfix #18044: missing return statements in getter for displacement modifier
caused incorrect values to be returned.
2008-12-15 05:30:09 +00:00
Campbell Barton
f8aa295596 projection paint cleanup (nothing to see here)
* BarycentricWeightsPersp2f was calling BarycentricWeights2f, and re-weighting. Changed so the re-weighting isnt needed.
* replaced tri_depth_2d with VecZDepthOrtho and VecZDepthPersp
* project_paint_occlude_ptv_clip now calls project_paint_occlude_ptv to remove duplicate code.
2008-12-13 16:11:52 +00:00
Campbell Barton
aa40953210 Projection Painting, merge from branch
Additions/Features...
 - Painting onto multiple images at once.
 - Clone with an offset similar to the gimp, also an option to clone between UV layers, (not both offset and between layers atm)
 - Stencil layer, similar to The Gimp's quickmask.
 - Face mask mode - (painting onto only selected faces).
 - Texture brushes (so image and texture-node brushes too)
 - Seam bleed so you don't see gaps when painting over UV seams (new option set in the panit panel)
 - Occlusion (only point onto the first face under the paintbrush, can also be used for masking out parts of the model to paint onto) - (new option set in the paint panel)
 - Muti-threaded, each thread operates on its own bucket.
 - Support partial updates to speedup OpenGL texture refreshing.
 - Support tile based multiple undo's
 - Support float image buffers.
 - Backface culling (new option set in the paint panel)
 - All color blending modes - Add/Multiply.. etc.
 - Airbrush rate. (used to be broken) 
 - Improve the way paint is mixed when painting, so painting with 0.2 alpha will not accumulate above 0.2 alpha on the image as you paint.
 - Option to use normals to fade out strokes on the edge of a surface to avoid ugly edges. (same as Vertex Paints "Normal" option) 

Known Problems
 - Not directly related to painting but changes in selection flags are not updated on the final derived mesh.
 - Smear tool has some distortion when in perspective mode. 
 - While in perspective view any faces with 1 vert behind the viewpoint, will be completely ignored.
 - Painting can be initially slow while buckets are being initialized, a number of solutions exist.
 - Size 1 brushes don't work yet.
 - When painting onto large faces its still possible to get artifacts.
 - Spatial optimizations are needed to skip occluded faces and test pixel occlusion. (will look into using blenders BVH )
2008-12-12 18:59:17 +00:00
Campbell Barton
696ef1afd2 minor changes 2008-12-12 18:31:34 +00:00
Campbell Barton
6f78cdd79f view.c
* Renamed view_autodist to view_mouse_depth
 * Accept args for mouse location and pixel distance around the hotspot used to lookup the depth.
 * removed persp(PERSP_VIEW) within this function, since it didnt set the view back.

imagepaint.c
 * normal falloff now works as Brecht suggests. Normal limit of 80 will blend between 80 and 85deg,  70deg limit blends between 70-80deg.
 * convert normal falloff to radians on initializing rather then on every comparison.
 * Ctrl+Click setting the cursor in its own function.
 * projection painting wasnt accounting for an exception for too high pressure values on first touch in windows for some tablets.
 * removed grease pencil benchmark function
2008-12-12 17:56:19 +00:00
Benoit Bolsee
1ecf855276 VideoTexture.ImageMirror: if the mirror is horizontal in mesh coord, take the Y axis as the up direction for the UV map. If the mirror is not perfectly vertical(horizontal), the projection of the Z(Y) axis on the mirror plane is the mirror Up direction. 2008-12-11 23:02:33 +00:00
Campbell Barton
6dc2714c78 fix for [18069] open nurbs curve snaps end to centerpoint
made nurbs surface curves use the same number of points as nurbs curves.
2008-12-10 11:42:26 +00:00
Campbell Barton
2ef5af67ca merge from trunk - r17500 to HEAD 2008-12-10 09:45:48 +00:00
Campbell Barton
2f39ae3b2e move the paint buttons from the image view and buttons window into one function. 2008-12-10 05:41:21 +00:00
Campbell Barton
ce5b9d21a7 tweaks to brush falloff and alpha, giving nicer looking strokes. 2008-12-10 03:13:48 +00:00
Campbell Barton
42f792309f bugfix - [#18063] Projection paint branch: draw tool "drops out" when model extends beyond view borders
reported by michael williamson.

Was caused by point inside triangle test using an error limit that didnt adjust for different size triangles.
2008-12-09 14:30:05 +00:00
Benoit Bolsee
cd47292745 ImageMirror: add clip attribute to limit clipping distance of mirror rendering 2008-12-09 14:16:10 +00:00
Campbell Barton
4251912b54 * tablet pressure changing opacity while painting didnt work
* pixels with <= the current opacity are not painted onto, speeds up painting especially with low spacing. (only when airbrush is disabled)
* use qsort rather then own crufty sorting function
* grouped projection painting functions together.
2008-12-09 08:21:53 +00:00
Diego Borghetti
12fbd936dd Fix mistake in last commit.. it's pic + 1 ;) 2008-12-09 04:57:42 +00:00
Campbell Barton
1adb5b5442 patch from Mitchell Stokes
#18045] [patch] A patch that exposes the rest of the motion functions of KX_GameObject to Python.

*applyForce	=> setForce
*applyTorque	=> setTorque
*applyRotation	=> setDRot
*applyMovement	=> setDLoc
2008-12-09 04:13:23 +00:00