Commit Graph

813 Commits

Author SHA1 Message Date
Ken Hughes
cfdf71bc5c Patches submitted by Michael Reimpell to get/set relative key selection, and
to get the current value of the IPO shape key.  There are still some issues
to discuss as to whether methods/attributes should be used and what they
should be named, but this will (or should) be addressed in the upcoming API
rewrite.
2006-01-17 06:12:53 +00:00
Stephen Swaney
14cc1192a3 clean up some warnings in bpy code 2006-01-16 17:55:03 +00:00
7d536502f8 *fixes global redefinitions
- added some extern keywords
2006-01-16 16:34:08 +00:00
bb9cadbb77 BPython:
- minor: added missing theme options (bone_solid, bone_pose, strip,
strip_select) to Blender.Window.Theme and also updated accordingly
(version info) the script that saves themes as scripts and the module's
doc.
2006-01-16 03:51:32 +00:00
Ken Hughes
df3fd052dd Fixed Window.Editmode(0) so that it only calls undo_push_mesh() when
U.undosteps is nonzero.  Also added optional parameter to avoid pushing
undo info alltogether if desired.
2006-01-16 02:06:02 +00:00
Ken Hughes
4f916b3081 Removed printfs in setPoints(), add proper exception handling. 2006-01-15 17:14:58 +00:00
Ken Hughes
e35f73cd00 Bugfix #3731: User reported that cyclic IPO curves reported the wrong value
in the BPy API for the "end point".  It was a minunderstanding of what
happens with cyclic Ipos, but we updated the documentation to make this
clearer in the future.
2006-01-14 22:05:16 +00:00
Stephen Swaney
148134205f fix previously fixed error msg. 2006-01-14 19:05:33 +00:00
Stephen Swaney
adcef46599 Object.Get( name ) was throwing an AttributeError.
Change to throw more correct ValueError when name
is not found as per IRC discussion
2006-01-14 02:13:15 +00:00
Ken Hughes
c18db96f56 Cam Barton discovered the setter for me.faces[i].col was missing. 2006-01-13 17:22:53 +00:00
144e3f827d * [ #3746 ] Calling getPose on a mesh object generates "RuntimeError: Pose - Error: PyPose_FromPose: Internal Error Ocurred"
- added returns where appropriate.
2006-01-13 16:19:11 +00:00
1a4c31442f *head/tail addition
- forgot to add the ability to get pose head/tail positions
- no setters (yet) as they are calculated
2006-01-13 15:53:22 +00:00
2aa6d4fc11 *bone.children fix
- fixes bone.children to return direct bone children
- added bone.getAllChildren() to allow previous behavior
2006-01-13 15:27:23 +00:00
Ken Hughes
5951b4dda7 Another bug fix for reference counting in extend methods. 2006-01-13 07:11:30 +00:00
Stephen Swaney
dea1ac52b4 bugfix: #3738 Armature bones returns none instead of key error
BonesDict was returning None instead of throwing a KeyError
when key not found.
Also fixed a few compile warnings about struct initialization.
2006-01-12 21:21:41 +00:00
Ken Hughes
6ded7d67d1 Clean-up of some reference counting issues with delete() methods. Also
further relax the input types for edge.extend() and face.extend() so that
single lists or tuples are accepted without errors.
2006-01-12 07:51:19 +00:00
150d36e4da BPy: Mathutils fix: bug #3737
Vector.resize4D() didn't put 1 in the 4th component (the scale factor), as it did in 2.37.
While this is more "correct", it is much less usefull. Also, matrix.resize4x4 puts a 1 there too,
so might as well revert and be consistent.
2006-01-12 01:11:42 +00:00
81f42b491a Scons fix:
new BPy Pose files weren't added to Sconscript
2006-01-12 00:07:08 +00:00
468dd24cd5 remove Constraint.h since it doesn't exist.
Provided by Letterrip.

Kent
2006-01-11 21:58:37 +00:00
f41c1f1c73 Forgot the pose file.... :p 2006-01-11 20:48:46 +00:00
31518a374b *pose docs
- some pose python documentation
2006-01-11 20:44:24 +00:00
6544ed3b64 Probably need these.... 2006-01-11 19:41:01 +00:00
5f0232f68f *pose code for python
- adds object.getPose
- ability to manipulate poses /posebones
- fixes a overflow bug in matrix sequence accessor
- adds code to get vec/roll from mat3
- few internal fixes to NLA
- ability to set bone matrices
2006-01-11 19:40:06 +00:00
Ken Hughes
0ee5c131dc A few Mesh fixes:
* edge and face extend() methods now add edges and faces in the order given
  by their parameters.  Note that if duplicate edges or faces are specified,
  the order is preserved but the dups are removed, so indices won't match.
* allow extend(), findEdges() and faces.uv to accept lists or tuples
* fix bug in mesh.verts.extend() which didn't correctly check argument types
2006-01-11 18:37:47 +00:00
2ead92cc2b BPy:
PupBlock method. This wraps the "clevernumbut" code to allow scripters to use popup blocks for user input instead of a sequence of multiple different popups.
See the blend file for a comprehensive test and example file.
2006-01-08 18:59:55 +00:00
ef520a8cc9 Scene.c - Removed redraw when in non UI mode.
Lamp.py - Example indent
Object.py - Improved join documentation.
2006-01-06 01:53:26 +00:00
2901da3c29 I added {}'s around an if block of code to prevent gcc from saying
this else is ambiguous...
code was
if (blah) if (blah2) stuff; else stuff2;
its now
if (blah) { if (blah2) stuff; else stuff2; }

Kent
2006-01-05 20:52:51 +00:00
Ken Hughes
75032534f3 Bugfix for Toni: Ipo_addCurve() needed to call set_icu_vars() in order to
properly initialize data for new Ipo curves.
2006-01-05 19:25:38 +00:00
1377e65531 Changed so all errors raise an excepton. - As per Toni's suggestions.
TypeError for pythonCoder error.
RuntimeError for blender not being able to be joined. (Sorry stivs, no BadJuJu yet)

Documented this in the epydocs also.
2006-01-05 15:53:07 +00:00
9e36d4bc8e [ #3661 ] resize4x4 in Matrix class doesn't set ones on the diagonal
* resizing a matrix now puts 1's back on the diagonals.
2006-01-04 16:02:02 +00:00
4af91dae79 Added some notes regarding Object.GetSelected() - it uses the last localview. 2006-01-04 15:11:35 +00:00
de37b11e56 [ #3712 ] Calling makeEditable() and update() on an armature twice duplicates bones
* fixes bug where editbones are not freed on calling update()
2006-01-04 15:07:15 +00:00
ff7ca4b1a2 Gave an example of changing lamp modes in epydocs. - answers a q on elysuin. 2006-01-04 01:55:39 +00:00
9f8348a22a *bpy fix
- include file capitialized wrong
2006-01-03 17:24:24 +00:00
5233f73589 *warnings fixes
- fixes a number of warnings in bpy project
2006-01-03 16:27:34 +00:00
d14f6c9cbc replaced more M_Object_Get for the faster Object_CreatePyObject.
Object.GetSelected now dosnt return None if there is no 3d view. - wasnt documented and likely would mess up scripts that always expected a list. - Just return an empty list instead.
2006-01-03 06:14:53 +00:00
fc079f8482 made scene.getChildren() a heap faster. 983.3 times faster in my test.
getting 7200 objects did take: 1.18 sec,  now 0.0012 sec

It was doing a full object list lookup for every object in the scenes base using the name to compare.
now it just gets the object directly from the base and converts it to a python object, adding it to the list.
- Cam
2006-01-03 05:38:39 +00:00
5f48930a75 Moved Object.Join() into a function of an object.
eg.
ret_val = ob.join(objects)
Now it dosent depend on the current selection, or change the selection context.

Made respective join_* functions return 0 if the join was not mode, 1 when it workes.
2006-01-03 02:35:45 +00:00
80f903ed73 Small commit, hopefully the last Duplicate change.
Made pythons duplicate not redraw, documented adduplicate()
2006-01-02 23:26:54 +00:00
8b0c3de7d9 Changed adduplicate() to take the dupflags as an argument. so faking the Alt Key isnt needed anymore in Blender or python.
Changed Pythons Object.Duplicate() to take keyword parms to enable duplication of spesific data.
Eg- Object.Duplicate(mesh=1) # to duplicate mesh data also.
2006-01-02 10:40:13 +00:00
Ken Hughes
362c8baac4 Bugfix #3652: material.setSpecCol() only accepted a tuple, not separate
parameters as it used to (prior to my tp_getset update).  Fixed this and
other similar situations.
2006-01-01 16:28:57 +00:00
Ken Hughes
aa8c1a016b Created local function check_NMeshLists(), which performs checking on
NMesh lists before trying to build a new mesh (used by mesh.PutRaw() and
mesh.update()).  It was possible to put junk into the NMesh lists, resulting
in some messed-up meshes.
2006-01-01 15:54:30 +00:00
Ken Hughes
5029a4444a Bug fix #3671: Blender.Beztriple.New() did not accept sequences as parameters,
even though its error messages suggested it did.  Thanks to Yann for the
patch (I also added the ability to accept parameters without requiring
them to be in a tuple).  Also documented the New() function.
2006-01-01 15:50:53 +00:00
Ken Hughes
3634128841 Two bug fixes for mesh.faces.extend() method; fix a error checking for
duplicate faces in the input list, and also extend texture faces if they are
enabled.
2006-01-01 15:43:34 +00:00
625c553e20 Added a python hook to Joining objects
Object.Join()

Seperated the join calls from space.c and view3dmenu into join_menu() in space.c, like the select_group_menu(),
okee's from join_curve, join_mesh.. etc are in join_menu() so python can call them without UI menu's in the way.
this is also a bit neater since there were 2 places that were doing what join_menu() does now.

- Cam
2005-12-30 14:17:15 +00:00
73dc1ff4af Ooops 2 tipos in the epydocs... 2005-12-30 11:56:44 +00:00
f310f296b2 Added the function Duplicate to the object module.
Object.Duplicate(linked=1)

Basicly a wrapper for adduplicate();

There was previously no easy way to copy objects in python. even the ways that do exist dont take modifiers, particles etc into account.
Uses the current selection.. epydocs included also.

- Cam
2005-12-30 11:54:53 +00:00
0565d86952 for Mesh_getFromObject made Mesh and Surf types copy the material list to the new mesh.
Still need to do Mball and Text.
Ken- this is fairly straight fwd but if you dont like it - its line 4867 of Mesh.c and 1 block that can be removed.
I tested for memory leaks and correct material user adjustment.
This is realy needed for using getFromObject to export to external rendering engines.
- Hope its ok.
Cam
2005-12-30 09:56:02 +00:00
8bc7d0bdf0 *crash fix
- previous fix crashes win32 and creates an unreachable code block
2005-12-29 19:27:52 +00:00
ccf117376d Fixed a python segfault when linking a new object to a scene that had no data and was a Surf. the data wasnt created and blender died. Now an error is raised instead. 2005-12-29 12:06:42 +00:00