Commit Graph

764 Commits

Author SHA1 Message Date
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
b73748bdd0 Just added some comments about face material incides and the material list. 2005-12-29 11:08:55 +00:00
69746f3b83 Added some details to the Object documentation, some parts were a big vague.. 2005-12-29 10:33:00 +00:00
Yann Vernier
a61871360f Fix crash in EXPP_(int|obj)Error. These functions are redundant;
they only differ by return type, so it's easier to just call
PyErr_Format and return appropriately.
2005-12-27 15:28:09 +00:00
Alexander Ewering
6f10660f0c Fixing a bit of horrible code in Armature.c (BonesDict_repr).
There is a lot of very dangerous (and slow) string manipulation code in
there. I do not want to appear arrogant, but a bit of basic code QA in this
module certainly can't hurt.

Please see the diff for further explanation ;-)
2005-12-23 22:16:33 +00:00
Ken Hughes
ea16c447c3 Fix typo in epydocs for Mesh example 2005-12-21 18:12:28 +00:00
73fa63751f Added missing mode rayShadow and updated docs, "NoSpecular" was also missing from the docs too. 2005-12-20 06:50:13 +00:00
2b7919a9f2 fixed returning true/false, thanks Willian. as well as removed the image space spesific image changed call. 2005-12-18 08:47:55 +00:00
e47f918e5e Added get/set/attr for area lamp settings - needed to exporting arealamps to povray.
areaSizeX, areaSizeY
raySamplesX, raySamplesY
epydocs updated also,
2005-12-18 07:45:45 +00:00
Ken Hughes
f73f226ed7 -- Bugfix #3617; addBezier() was not initializing all the attributes for
a the beztriple, so things like the hidden and handle select states were
   set to random values.  Added a beztriple.hide attribute so that the
   hide attribute can be set/cleared from the BPy API.
2005-12-17 04:57:48 +00:00
e76e78e78a typo, thanks letterrip. 2005-12-16 22:40:20 +00:00
Ken Hughes
826591d778 -- Added BPy support for new Material modes. Recent additions of new mode
bits broke input-checking in the API, so added a bitmask #define in
   DNA_material_types.h which contains all valid mode bits.
2005-12-15 21:54:00 +00:00
Ken Hughes
6e7e6d2357 -- removed redundant initialization for Mesh_Type (thanks LetterRip) 2005-12-15 19:12:31 +00:00
4a8087db76 Fixed some warnings from GetCurrent, remaining warnings seem to have no obvious solution
attr = Py_True; // Image.c:1107: warning: dereferencing type-punned pointer will break strict-aliasing rules
2005-12-15 02:06:37 +00:00
8304b73a08 BPython:
- malformed nmeshes could crash Blender with a sigsegv. Related to old
behavior that accepted "faces" with one or two verts.
- removing unused var (store_edges) + doc update.
2005-12-14 18:01:42 +00:00
d527b0e585 Added
Image.New(name, w,h,depth)
Image.start- for animtex
Image.end - for animtex
Image.speed - for animtex
Image.packed - read only bool

See the pydocs for details.
2005-12-14 03:27:35 +00:00
Ken Hughes
d3338620b7 -- More of Bugfix #3580: Mesh_getFromObject() was not updating key->from
when it duplicated mesh data.

   I'm not thrilled with how I implemented this code, but currently don't
   know a better way.  If someone more familiar with how blender duplicates
   objects and converts things to meshes wants to have a look, it would be
   appreciated.
2005-12-13 18:39:50 +00:00
Ken Hughes
4085cc06a6 -- Calling mesh.verts.extend() on a mesh with vertex groups was not updating
mesh->dvert, eventuallu causing a crash.
2005-12-13 15:36:32 +00:00
7bba26d24b *warnings fixes 2005-12-13 14:29:56 +00:00
fadaa2fbe9 From kh_pylon:
You have to put Py_RETURN_NONE; inside { }; it's a two-line macro
Aparently breaks MacOS.
2005-12-13 00:27:10 +00:00
d73e312f88 Added Image.GetCurrent()
Previously the only way to get the current image was flaky and relyd on the image being assigned to a mesh.

try:
  me = Scene.GetCurrent().getAttiveObject().getData(mesh=1)
  image = me.faces[me.activeFace].image
except:
  image = None

...Can new be replaced by the following, and works even when there is no mesh.
image = Image.GetCurrent()

epydocs:
  Get the currently displayed Image from Blenders UV/Image window.
  When multiple images are displayed, the last active UV/Image windows image is used.
2005-12-13 00:00:11 +00:00
540e5bb77d *Armature api documentation 2005-12-12 20:12:50 +00:00
9ae9527c51 - Armature/Bone API for python
* this resolves a number of outstanding issues with the armature api and gets this ready for release
- add/remove bones possible
- rolls work correctly now!
- ik'ing to parent should work
- flags for tip/root/bone selection
- etc.
2005-12-12 18:46:26 +00:00
c452e8672c Rewrote TimeLine_getFramesMarked func with better coding
.
2005-12-12 11:57:58 +00:00
e0d20e00ce Added some details in the Mathutils documentation. 2005-12-11 04:20:37 +00:00
Ken Hughes
76e7905736 -- Bugfix #3573: Deleting a scriptlink when some other scriptlinks were no
longer linked to a script would cause a crash.  We now delete all
   scriptlinks which are not linked.
2005-12-10 19:36:05 +00:00
Ken Hughes
080eb9b3fa -- Bugfix #3564: Texture.getImage() always returned None for Env maps, even if
an image was assigned.
2005-12-09 23:19:00 +00:00
7b2f1d4776 change return of getMarked method for dict {framnum:['nameframe']}
.
2005-12-09 15:00:54 +00:00
Ken Hughes
e67360cb97 Made Mesh verts/edges/faces hashable (as they were in NMesh); this will
make it easier for some scripts to be converted.
2005-12-07 21:12:33 +00:00
Ken Hughes
b02ff5f2a2 -- Bugfix #3551: fix memory corruption problem if Text3d.setText() called
while selected text is in edit mode.

(Future note: now that there is Unicode support in Blender, we need to add
support for it in the BPy Text3d API.)
2005-12-07 05:44:29 +00:00
Ken Hughes
39ca3e3fa4 -- Bugfix #3548: material.setMode() was doing incorrect range check on
inputs, returned error setting RAYMIRROR or RAYTRANSP modes.
2005-12-06 17:08:09 +00:00
Ken Hughes
1aebee2f9e More corrections and additions to Ipo and IpoCurve documentation. 2005-12-06 06:16:10 +00:00
Ken Hughes
569f9de63c Added some extra parameter checking in Ipo driver code. 2005-12-06 05:42:23 +00:00
Ken Hughes
1a2ac4e64d -- Bugfix #3072: As discussed on IRC, matrix.invert() should throw a
ValueError exception if matrix is singular.
2005-12-05 19:57:23 +00:00
Ken Hughes
e209676d3d -- Bugfix 3453: coercion operations were doing an extra incref on coerced
objects.  Also found extra increfs on some newly-created quat and matrix
   objects, from calls to Matrix_Identity() and Quaternion_Identity().
2005-12-05 19:02:30 +00:00
Ken Hughes
bf05bbef86 Fix unchecked parameter in M_Ipo_Recalc, and some documentation fixes. 2005-12-05 05:23:35 +00:00
Ken Hughes
00ce7c629f -- remove unused variable "dict" which was giving compiler warnings. 2005-12-05 01:07:24 +00:00
Ken Hughes
beb80aa609 -- Fix segfault when callign Blender.Armature.Get() with no parameters 2005-12-04 20:39:56 +00:00
5b9e85f0a2 Just one more useful commit from Desoto: added a newline to the end
of the file. Hold the applause please.
2005-12-03 00:52:51 +00:00
Ken Hughes
9588cfdffe Small changes to API docs on curves and space handlers explanations. 2005-12-02 21:25:30 +00:00
Ken Hughes
8a7242ff16 -- Bugfix #3139: Blender.Library.Open() was changing current .blend
filename.  We now save and restore file before opening library.
2005-12-01 05:30:15 +00:00
Ken Hughes
95e94b4630 Make curnurb.flagU and curnurb.flagV range check their inputs, plus make
the documentation correctly describe how the attributes and methods work.
2005-12-01 04:50:04 +00:00
Ken Hughes
22188fba21 -- previous commit was decrefing a borrowed reference; thanks Ascotan for
tracking this down!
2005-11-30 20:18:54 +00:00
Ken Hughes
b7a4a6c837 -- Bugfix #3186: Fix memory leaks caused by multiple calls to
PyDict_SetItemString() with objects that were not properly decrefed
   afterwards.  Due to the number of places this was used, I added a
   wrapper EXPP_dict_set_item_str() to gen_utils.c to handle it.

   This started as a scriptlink bug, due to how many times scripts were
   being executed I think it just magnified how bad the memory leak in
   BPy was.  Animating the blend attached with this bug report would cause
   memory to grow by about 3MB for every 280 frames.  After the patch,
   memory did not appear to grow at all (or at least not noticably using
   Unix's ps and top utils).

   Since many of the PyDict_SetItemString() calls were in initialization
   modules I think my tests executed most of the changed code, but would
   appreciate script users really giving feedback.
2005-11-30 08:18:06 +00:00
Ken Hughes
00f4310970 -- Bugfix #2868: NMesh.update(0,0,1) with derived mesh data would cause a
crash.  Hopefully the NMesh module will die a silent death before we
   discovere this doesn't really fix the problem :-)
2005-11-29 23:38:40 +00:00
65ce2c2cee * warnings fixes 2005-11-29 05:08:29 +00:00
Ken Hughes
0ae3fe59a3 -- Partial bugfix for #3186. curve.getControlPoint() wasn't DECREF-ing
values added to a list, causing a memory leak.
2005-11-29 01:35:45 +00:00
Ken Hughes
c0e94f3063 Fix incorrect documentation for Window.QTest(). 2005-11-28 22:49:59 +00:00
Ken Hughes
427cae9eeb -- Fix bugs caused (by me) by incorrect use of Py_RETURN_NONE macro in
"if" statements.  The macro defined in gen_utils.h expands to two
   statements; putting after an "if" statement without {} means the second
   statement should always be executed.  I'm not sure if just putting
   braces around both statements would cause other compilers to complain.
   But this explains an earlier bug in the Object module which only
   appeared on MacOS/X.
2005-11-28 05:21:25 +00:00
Ken Hughes
b2e32f5bd1 -- Bugfix #3458: keyblock.getData() was getting vertex data from keys
incorrectly, including wrapping curve data as BezTriples.  Needed to
   make a change to beztriple module so we could more easily create a
   "thick" BezTriple object similar to Blender.BezTriple.New().

   The change to BezTriple.h pointed out some dead code in the Ipocurve
   module that could be removed.
2005-11-28 05:03:26 +00:00