Commit Graph

705 Commits

Author SHA1 Message Date
b63e26e109 Added some equvalency tests for the other math objects
* ==, != are defined for matrix, quat, euler.
2005-11-22 17:59:49 +00:00
af2042d219 new attempt at the pyboolean macro, 'cause that style did not work in one line if/elses - this one is from the py 2.4 boolops headers. 2005-11-22 11:25:23 +00:00
3caeea233d trying to fix new armature compile probs on macs (w/ py 2.3 probably) by adding the 2.4 macros for returning python booleans. 2005-11-22 11:18:34 +00:00
280375ab2c - editng options for armature added to AramtureType 2005-11-21 22:21:46 +00:00
838fb77159 - drawtypes added to ArmatureType
* uses module constants added to Armature.c
2005-11-21 21:26:09 +00:00
ac80b4ba11 * added some display options to the ArmatureType class 2005-11-21 20:54:29 +00:00
4d7ca2931c * adds deformation properties to armatureType 2005-11-21 20:22:08 +00:00
d5f1fc13b7 * [ #3376 ] Blender.Mathutils.Matrix().toQuat() broken
- a 0-degree rotation gives a abitrary axis of 1,0,0 not 0,0,0
2005-11-21 19:42:20 +00:00
9607fac3a5 A few more doc updates 2005-11-21 15:44:59 +00:00
0e62c58b08 Some updates to armature documentation. 2005-11-21 15:36:36 +00:00
Ken Hughes
44c581644a -- fix indentation to make epydoc happy 2005-11-20 18:41:41 +00:00
Ken Hughes
d040d2012c -- removed GetParticlesLoc() function, which was replaced by
getParticlesLoc() method
2005-11-20 15:12:06 +00:00
c52170b4ed Patch provided by Alfredo de Greef
This adds Radiance HDR image file support. So now at least we can save
the 'fbuf' (4x32 bits float colors) in Blender.
It doesn't change anything for internal support in imbuf for floa colors,
so when reading .hdr files it still converts it to 32 bits RGBA.

As an extra I've added that saving images with F3 now also adds the
optional extension, when the F10 "Extensions" option is set.

One important note; I don't know the proper license for the code, it was
provided without... will await feedback from Alfredo about it. For now
I've added the standard Blender GPL header.
2005-11-20 14:32:07 +00:00
77332fa698 Patch by Matt Ebb: upgraded usablitiy of text button.
Textbuttons now allow a selection too (like any textbutton in other UIs).
By default, on activating a textbutton, the entire button text is selected
when you enter the button. A single arrowkey or LMB click reveils the
cursor then. Here's more user notes:

LMB click: If inside the button, places the text cursor at the clicked
position. If outside the button, confirms/finishes editing

LMB drag: Selects the text between the start and end point of the drag.

Backspace: Deletes selected text, or backspaces a character

Shift Backspace: Deletes all, as before.

Delete: Deletes selected text or forward deletes a character

Shift LeftArrow: Extends the selection left

Shift RightArrow: Extends the selection right

LeftArrow: If there's a selection, move the cursor to the left edge of the
selection, otherwise move the cursor left a character.

RightArrow: If there's a selection, move the cursor to the right edge of
the selection, otherwise move the cursor right a character.

UpArrow/Home: Move the cursor to the beginning of the line

DownArrow/End: Move the cursor to the end of the line

Ctrl Left arrow and Ctrl Right arrow to jump between directory separators
2005-11-20 10:04:45 +00:00
Ken Hughes
a86b0af575 -- added an optional "cage" parameter to mesh.getFromObject() to allow
getting cage vertices from geometry objects
2005-11-20 01:07:54 +00:00
Ken Hughes
58edf6b40d -- fix printing of constant dicts
-- remove "TF_" from constant names in M_Mesh_FaceTranspModesDict()
2005-11-19 15:44:43 +00:00
Ken Hughes
555a3d02c7 -- fix bug which used unitialized pointer in M_Effect_New. 2005-11-19 15:06:20 +00:00
ec2e8d5380 Finally switched to porting UI stuff from tuhopuu!
This commit is based on the patch & cool design work of Matt. It includes
the new Lamp drawing style, and replaces the Object center dots with a
similar styled OpenGL drawn dot.

Important side-note is that removing the old glDrawPixels() for centers or
lamps will not only make Blender faster, but also prevents crashing on a
couple of cheaper 3d cards (as reported for S3 and Intel on-board cards)

Notes:
- The new default only draws Object centers when selected or active. If
  you like to see them always, use the View Properties Panel. You can also
  save that in the .B.blend
- The size for centers (and lamps) is in the User settings "View & Controls"
- Unselected Lamps, and their offset lines from zero Z, are drawn in a new
  Theme color

Changes and additions in Matt's patch:
- Lamps and centers are drawn fixed size, in pixels. Also the 'sun' lamp
  draws screen aligned now.
- Center dots now also draw in blue to denote Library linkage or to show
  that an Object has been linked to other scenes.
- When objects are empty (no vertices) they will always draw a center dot.
  Otherwise these objects would never be selectable anymore!
- Added theme setting for center size, and initialization
- Removed the old redundant code for drawing centers
- Cleanup of drawing routines, made center dots faster
- Started removing calls to glBlendFunc(). Regular alpha drawing should
  become standard, and the (very) occasional exception should return this
  to default after usage.
2005-11-19 10:55:07 +00:00
Ken Hughes
97c13508ff -- added Object.protectFlags attribute; let user get/set transform lock bits 2005-11-18 19:44:44 +00:00
Ken Hughes
2de340199d -- fixed bug with returning NULL from Object_CreatePyObject() on MacOS/X.
The code prior to the last commit worked... but can't see the differene
2005-11-18 16:03:03 +00:00
Ken Hughes
43ac5834b6 -- add support for new particle effects 2005-11-17 19:19:05 +00:00
Ken Hughes
9deec11e59 -- fix small problem with Ipocurve.recalc(); recomputed handles but did not
re-sort control points (also added reminder in BezTriple doc that script
   users need to call recalc themselves)
2005-11-17 19:10:40 +00:00
Ken Hughes
32c91c897b -- Fix for the "LIB ERROR: base removed" problem; BPy Object was decrementing
us.id when objects were destroyed but not always incrementing when
   created.  The intent of modifying us.id is to make Python a "user" of the
   data so it persists even when it is deleted from Blenders UI.  The original
   commit was unintentional but Ton thought the idea was OK.
2005-11-17 18:35:11 +00:00
Ken Hughes
96221a5331 -- fix documentation error (replace removeCurve() with delCurve()) 2005-11-17 02:25:32 +00:00
Ken Hughes
6b407d488e -- fix bug in constant_repr() which printed the final key twice 2005-11-16 19:00:47 +00:00
a8df218335 - point constructor
* added a constructor for the point class to mathutils
2005-11-15 21:45:05 +00:00
0f58b99d65 * update to python docs
- the softbodies documentation was put in object.properties instead of object.object. Hello!
2005-11-15 21:33:29 +00:00
4ea1c4dc60 * update to python docs
- update for the old mathutils rewrite
- update for some other methods ive added
- added explaination of wrapped data
- added a .css file for epydoc gives nice blender/python colors :?
2005-11-15 21:14:24 +00:00
Ken Hughes
a85ba68eb4 -- Added OB_RECALC_OB to Object_set* methods. 2005-11-15 16:34:25 +00:00
Ken Hughes
c6d22dd44e -- various fixes for Mesh.c:
* add some protection against accessing MVerts/MEdges/MFaces which have
   been deleted
   * correct cut-and-paste bug in faces.delete() method
   * correct some compiler warnings
2005-11-11 16:17:29 +00:00
Ken Hughes
564b629013 -- When storing a mesh, allow TFaces without defined UV coordinates to use
some default values instead of throwing an exception.  Also use only the
   first four UV coordinates supplied in the list.
2005-11-09 00:38:56 +00:00
Stephen Swaney
960a872431 Bugfix: #3377 Epy docs missing links
Link to sys was broken.  need to be  L{sys<Sys>} for name to match.
2005-11-08 22:11:19 +00:00
Ken Hughes
1ba15893bd -- changes and bugfixes from Cam:
-- calling mesh.getFromObject(obj) with mesh object now also
     copies material properties
  -- mesh.quadToTriangle() takes a parameter to duplicate both
     Ctrl-TKEY and Shift-Ctrl-TKEY actions
  -- assigning None to mesh.verts "clears" the memory allocated
     to the mesh (equivalent of Mesh.New(), but on an existing
     mesh)
  -- exception handler message for mesh.faces[i].uv = [..] more
     clear (uv attribute only accepts tuple, not list)
  -- fixed bug for meshs with deformed verts when deleting verts
     (deformed verts deleted and repacked correctly now, I think)
2005-11-08 21:50:30 +00:00
Ken Hughes
c217188a62 -- Previous commit using PyDict_Keys left new reference around. Change to use
PyDict_GetItem() instead, and clean up string manipulation.
2005-11-08 18:46:55 +00:00
33648819f7 BPython docs:
bug #3367 reported by Chris Want (thanks): ob.mat documentation was
wrong (was not updated); that attribute returns the world space matrix,
not the local one.
2005-11-08 17:23:20 +00:00
cd7ca03034 *work around for PyDict_Contains 2005-11-08 16:27:58 +00:00
f09a3611be *armature api for python
- don't get too excited
- allows you to get armatures from a scene
- makeEditable()/saveChanges() puts the armature into out of editmode (pythonically)
- Armature.bones is a dictionary that contains all the bones in the armature and can be iterated
- getters are available for:
name,
roll (dictionary) keys are BONESPACE, ARMATURESPACE
head (dictionary) keys are BONESPACE, ARMATURESPACE
tail (dictionary) keys are BONESPACE, ARMATURESPACE
matrix (dictionary) keys are BONESPACE, ARMATURESPACE
weight
deform_dist
subdivisions
options (list of constants)
parent
children

Setter work only in editmode. Some are not fully implemented.
Type class is embedded in the module. This means the construct is called as follows:
Blender.Armature.ArmatureType()

import Blender.Armature as Armature
arm = Armature.Get('myarm')
for name, bone in arm.bones.items():
...print name, bone, bone.matrix['ARMATURESPACE']

more documentation is forth coming. This is an alpha for this api.
2005-11-07 20:03:32 +00:00
a39559ea11 *change to the way constants are printed 2005-11-07 19:36:50 +00:00
cce655b5e7 - warning fixes
* various warnings the python api is putting out
2005-11-07 19:34:44 +00:00
Ken Hughes
979c28bf06 -- Clean-up of Effect and Particle modules; since particle was the only
remaining effect type, it didn't make much sense to leave things
   implemented in two separate files.  Changes include:
   * two bug fixes (the getChild() and getMat() methods were using floats
   instead of shorts)
   * performing clamping on input values
   * implementing attributes using tp_getset
   * merging Effect and Particle functions: the Particle module exists in
   name only, with the Particle.New() and Particle.Get() functions
   remaining for backward compatibility (they are in fact identical to
   Effect.New() and Effect.Get() functions)
   * update of doc/Effect.py (including remove all old references to wave
   and build effects)
2005-11-07 00:22:05 +00:00
Ken Hughes
0089c0bc53 -- Added Object.effects, a read-only attribute which returns a list of the
particle effects belonging to an object (based on patch from jms)
2005-11-06 22:29:49 +00:00
Ken Hughes
a602dcfe5f - JMS's patch which adds GetParticlesLoc() method. I've modified the code
so that it resides in the Effects module instead, with the intent of
  soon merging Effect.c and Particle.c into a single file (and somedat
  removing references to the Effects.Particle submodule)
2005-11-04 20:34:38 +00:00
3f8f0f7aac Silly error string correction 2005-11-03 20:22:29 +00:00
Ken Hughes
eafdcdd4ac -- Bugfix #3335: mesh.remDouble() accidentally performed a mesh fill also
(missing break statement): thanks, Cam!
2005-11-03 00:58:41 +00:00
Ken Hughes
e01e5a4cbf -- Bugfix 3333: BPy method ob.getEuler() was returning PyObject which wrapped
stack-allocated data (thanks, pontus).
2005-11-02 23:28:36 +00:00
15707394d1 Adding Key.ipo as access to ipo data both get and set 2005-10-31 15:53:21 +00:00
Ken Hughes
54659d4a7d -- further clean-up of mesh error handling for update and PutRaw(); add
specific messages for different types of exception errors
2005-10-31 15:08:01 +00:00
Ken Hughes
7040e6c157 -- patch submitted by Johnny Matthews which lets a user get an Ipo curve by
its adrcode in addition to its string name (shape keys don't have fixed
   or unique string names, and they are stored in the key, not the Ipo).
   This will make it easier to later use constants from dictionaries to
   access a curve.
2005-10-31 14:05:47 +00:00
4181b6ec74 Removed key.getChannelIpo() doc. 2005-10-31 02:52:17 +00:00
43ec1ee71a Removed key.getChannelIpo() since it is not proper implementation anymore. 2005-10-31 02:52:14 +00:00