Commit Graph

1208 Commits

Author SHA1 Message Date
Nathan Letwory
d6e9265895 ==SCons==
* make blender_python understand we're doing a debug build when BF_DEBUG=1. Otherwise
 we get linking errors with scons/mingw
2006-12-04 14:32:07 +00:00
c520a2a6b2 =IDProperties Small Update=
BPy conventions were not being followed for PyObject_New;
now they are.  I still doubt the usefullness of doing this,
however its important to maintain module standards.  

Which reminds me, anyone know where I can get that source code
prettier that was used on the api files?  It was kindof
hard following the coding style of bpy with it being so
different from normal blender, and also what with having
to write the IDProperty code from scratch. :)
2006-12-04 04:51:32 +00:00
28bbf2d616 - added support for generic 6DOF constraint
- only 6DOF constraint shows buttons for limits
- added python support for rigidbody constraint (untested, but required for COLLADA Physics support)
2006-12-02 03:48:36 +00:00
Ken Hughes
e906417a3a Python API
==========

Bugfix: using del operator on me.verts would cause a crash.
2006-12-01 21:20:40 +00:00
Stephen Swaney
e3b72755cc clean up some warnings. no executable changes. 2006-12-01 17:53:04 +00:00
71da111613 =IDProperties bugfix=
Another bug from the tracker, reported by Mike Stramba.
A duplicated Py_XDECREF in the wrong place made assigning
arrays from Vector objects not work.

Also, fixed nasty bug in C API of idproperties (the function
to look up a property from a group was broken).  Fixed a memory
leak too.

In addition, made "del group['property']" delete properties
from group; previously this would just crash (or at least it
should have).  Added a small addition to the example in the
epydocs for IDGroup.
2006-12-01 03:04:36 +00:00
4941107f92 - enabled compound collision objects, requires 'clear parent inverse'
- fixed some issues with kinematic objects, introduced during Bullet 2.x upgrade
2006-12-01 01:04:27 +00:00
99d66e1d5e =IDProperties bugfix=
Fixed the bug of "print type(property)" crashed blender;
just needed to add PyType_Ready init code for all ID property
python types; I made a function IDProp_Init_Types and put
code to call it in types_initAll().

Also added GPL/BL headers to idproperty files.
2006-11-29 23:31:46 +00:00
0c85ea07f1 =IDProperties bugfix=
Misspelled __members__ __member__ in IDProperty's
getattr function; this made "print dir(prop)" not
work.  Eventually I need to replace the whole thing
with getsetters.

Still need to find out why "print type(a_property)" crashes
blender. :S
2006-11-29 22:30:41 +00:00
b7f6b4799e =IDProperties bugfix=
IDProperties was doing a name check where it shouldn't;
thise made executing "prop['value'] = something" not work
if the property 'value' already existed.  Fixed it by
making the code replace existing properties, like it
should.
2006-11-29 22:19:21 +00:00
008d789f15 =IDProperties small update=
This update changes Object.properties to Object.game_properties 
(as discussed) so .properties can be used for ID Properties.

This should be fine as, after all, .properties was undocumented anyway :)
2006-11-28 04:34:26 +00:00
Alexander Ewering
314b7adc17 Uncommitted my potential fix for
http://projects.blender.org/tracker/index.php?func=detail&aid=4786&group_id=9&atid=125

It seems like you can't quote the executable path on win32 using system().

So, playing back a rendered animation now works again on win32, however,
the bug remains... no idea how to correct it.
2006-11-25 14:53:31 +00:00
9f5713df2f Bugfix: test_index_face got wrong number of vertices when converting NMesh
to Mesh if there were vertex colors.
2006-11-23 20:37:45 +00:00
b1f787715a Fix for bug #5296: Mesh.update destroys vertex groups. Code wasn't
updated for customdata layers yet.
2006-11-23 18:36:13 +00:00
Nathan Letwory
d38a8b20b9 * free socket names
* some misc changes
2006-11-23 11:54:50 +00:00
Nathan Letwory
f4aa5064e9 * add two files for development of pynodes - note that the module in this is not enabled,
so don't bother to try and get it working just yet. It all will come in due time
 :)
2006-11-23 05:59:09 +00:00
Ken Hughes
7b9fac49f5 Bugfix #5289: "Shape Wizard Widget" script was using non-existant key:
changed so "Key 0" is substituted for "Basis".  This may not be correct...
Also, fix to make ob.setEuler() accept a tuple again.
2006-11-23 00:28:09 +00:00
e10a86eef9 (Partial) fix for bug #5289:
Crash using Shape Widget Wizard script, was an error in customdata copy.
The script still throws a python error though, but that seems unrelated
to this crash.
2006-11-22 23:12:38 +00:00
Ken Hughes
2dbed48e24 Python API
==========

Bugfix #4951:  This might be a serious change for python script writers.
-- ob.getMatrix('localspace') did not return the correct matrix when the object
   had a parent; this has been corrected.
-- ob.setMatrix(m) did not work predictably (more correctly, in an easy-to-
   predict manner) when an object had a parent.  The method has been changed
   so that if thee is a parent, it ASSUMES the matrix is "localspace",
   relative to the parent.  The documentation now states this.
-- ob.mat and ob.matrix are now read-only attributes, while ob.matrixLocal
   (which calls Object_setMatrix() ) is now read-write.

Ton is not thrilled (is that a fair summary, Ton? ;-) with this method since
the ob->obmat is calculated from the loc/rot/size attributes of an object.
I'll let him speak on this, but I believe his desire is for this method to be
deprecated in the future and replaced with something else.
2006-11-21 21:15:15 +00:00
Ken Hughes
973e8920f0 Python API
==========

Fix epydoc warnings after IDProperty addition to Material.py
2006-11-21 19:17:13 +00:00
Ken Hughes
ed3559aa8e Python API
==========
Bugfix #4905:  correcting errors and out-of-date NLA API documentation.
2006-11-21 19:00:12 +00:00
19a4f41172 =ID Properties Python Doc Update=
The epydocs are now updated to have idproperties;
all the modules that have bindings for ID properties
now has docs for them.  E.g Materials have a .properties
members, Image, Texture, Scene, Object, NMEsh, and Mesh.

I realized that .properties was already taken in
Objects, so I renamed it to .idproperties.  There was
also a nasty little problem with an example inside
Object.getType; the entire example was being pasted inside
the return field.  I fixed it by just moving the return
definition to after the example, like it should be.
2006-11-20 11:07:56 +00:00
e435fbc3c5 Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.

Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData


Replaced TFace by MTFace:

This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.


Removed DispListMesh:

This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.


Removed ssDM and meshDM DerivedMesh backends:

The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.


This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00
6e086d4cfe =ID Properties Python Update=
ID Properties binding have now been added for textures.  Also,
the beginnings of supporting "del IDProperty Object" (which 
basically removes the property from it's parent group then frees
it) in python were done; really the only thing now is to figure 
out exactly *how* you overload the del operator. :S
2006-11-19 16:00:04 +00:00
2bb9d5471e Fix for bug #5250: inaccurate conversion between edit and pose mode bones.
Using acos(dot(u, v)) to find the angle between two vectors is quite
inaccurate, and there's a better way to do it, as explained here:
http://www.plunk.org/~hatch/rightway.php

Also changed the use of atan for computing roll to atan2 in some places,
the latter avoids accuracy and division by zero issues.
2006-11-18 23:07:32 +00:00
2a0fc46266 CMake: Fix FFMPeg/OpenEXR issues in CMake system and possibly the others. OpenEXR can be linked in DEBUG mode on Windows using the libraries in CVS and stub. 2006-11-18 02:48:18 +00:00
Alexander Ewering
a94925809b Bugfix for:
http://projects.blender.org/tracker/index.php?func=detail&aid=4786&group_id=9&atid=125

If the path to Blender contained whitespace, various places which called
the Blender executable wouldn't run. Now the path to the executable
should be quoted correctly everywhere.

If this breaks anything on other platforms, please shout :)
2006-11-18 01:45:47 +00:00
Ken Hughes
318a694a25 Get rid of various warnings with gcc under linux 2006-11-17 17:50:43 +00:00
6b9bf57066 Yuck, a very ancient crasher in going area-full screen in Blender.
I wonder how this survived so long in Blender... (2005/03/09 commit).

Reason was the call to BPY_free_screen_spacehandlers(sc) in kernel,
which was freeing up scripthandlers in a weird way. That call is
really obsolete. The real freeing should go in the del_area() call,
to prevent copying and deleting area in the UI to go wrong.

(Crash happened in testing timeline markers, and holding CTRL+Uparrow
a while...)
2006-11-17 12:44:15 +00:00
ab141e1439 =ID Properties Python Update=
IDProperties now have a sanity check to prevent different ID properties
in the same group from having the same name.  The appropriate code has been
added to the python bindings to catch this and raise an error.
2006-11-17 08:19:58 +00:00
80f7ea96c8 =ID Properties Small Python Update=
This commit adds a new constant dict to the top Blender module
called PropertyTypes.  This dict represents all the ID Property
constants: STRING, INT, FLOAT, ARRAY and GROUP.

Further python work, including epydocs, are forthcoming.
2006-11-17 07:50:24 +00:00
4c5fcf136b =ID Properties Update=
This commit adds file reading/writing of ID properties to all ID types, 
and also adds python access for NMesh, Mesh, Scene and Image.  Note 
that the file reading code might need some more work for certain 
future/planned features to save right.  Also I updated a few comments in idprop.c.
2006-11-17 06:14:15 +00:00
8768707610 =ID Properties=
This commit adds supports for per-ID properties to blender.
See http://mediawiki.blender.org/index.php/BlenderDev/ID_Property
for more information on how it all works.

ID properties are accesable by python; but note that 
bindings have only been added to Object and Material thus
far.  However adding more bindings is easy and I plan
on adding several more hopefully within an hour of this inital 
commit.

A generic UI panel is also planned, that will go wherever its
needed; for example in the material buttons, editing buttons, etc.
I'll likely submit the initial code for that as a patch, though,
so matt and ton and others can go over it and make sure it's
all good. :)

VERY important, if you intend to use ID properties please
go to http://mediawiki.blender.org/index.php/BlenderDev/PropertyStandards
and start writing the appropriate standards for it.
2006-11-17 04:46:48 +00:00
24f4440d05 CMake lists initial submission. Documentationand further verification for different platforms will follow soon. This was just tested against current CVS on MSVC 2005 with Verse, QuickTime, OpenEXR, Player all on. 2006-11-17 02:27:12 +00:00
97d306e68f Added group.layers bitfield to the python API 2006-11-16 21:38:08 +00:00
Ken Hughes
ba71fbb785 Python API:
Bugfix #5172: removed nmesh.addEdgesData() from documentation (the method was
removed in Blender 2.40 release)
2006-11-14 16:36:45 +00:00
Ken Hughes
78dbeb6be9 Python API
Bugfix #4989: some Python types were not correctly initialized, resulting in
segfaults when "type()" was used.  Added missing initialization to Type.c.
Thanks to Fernando (fbs) for tracking this down.
2006-11-14 15:58:17 +00:00
Ken Hughes
2e133599da Python API:
Bugfix #5075: make curve.update() recalculate bezier curve handles.  This
would/should be called after changing the handles of a BezTriple.
2006-11-13 21:14:48 +00:00
ef56538c62 removed warning in last commit 2006-11-13 17:55:06 +00:00
26ef99157e made mesh.getFromObject() accept a python object as well as the object name.
accepting the name only was causing big problems when exporting library data, because duplicate names are possible the wrong data was exporting.
2006-11-13 17:37:01 +00:00
Nathan Letwory
008d6987d0 move SPACE_* (enum) and SPACEICONMAX to DNA_space_types (being the more logical place than DNA_screen_types). SPACEICONMAX gets its value now through this enum, so it is not anymore easy to forget to update it correctly :) 2006-11-07 11:24:11 +00:00
b48c514db8 Added an option in the IK constraint to disable stretching, useful
in rigs with layered IK constraints. Also removed the tolerance
setting, this value wasn't used in the solver anymore.
2006-11-06 23:51:37 +00:00
4545da3510 ack- need to get the hang of usercounts better- it seems they need to be initialized as 1 for groups, just like images. 2006-11-02 23:05:10 +00:00
80ffbee6f7 was missing a return of len, so scn.objects.context was always returning 0 2006-10-25 13:33:08 +00:00
0e569035c7 made mesh getFromObject also copy the meshes flag 2006-10-22 02:43:04 +00:00
045e143189 a Malifico request, Blender.Library now supports loading relative libraries.
Blender.Library.Open('//someblend.blend')

the // at teh start of the path mean that the file will be loaded relaive to the existing blend files path.
2006-10-15 14:00:23 +00:00
3b0adf0bf4 added shadAlpha access to materials in python 2006-10-15 08:43:59 +00:00
c8b06bba9c mesh/animation exporters didnt work when there were no 3d views open, because the Blender.Set('curframe', i) called a update command that resulted in no viewable layers updating.
Made Blender.Set('curframe', i) do a
  scene_update_for_newframe(G.scene, (1<<20) - 1);

  removed 2 unused constants from Scene.c
2006-10-13 11:56:08 +00:00
ce0f9a3cac On Matt's suggestion moved "Make Link->Groups" to the add groups menu as "Add to Active Objects Groups"
removed "Make Link -> DupliGroup" because Copy->Duplis does the same thing.

Python's Group.c had an unneeded scene/base lookup.
2006-10-12 13:13:45 +00:00
de3c54569d BPyRender sets renderlayers right now
Object groups were get/set without user counts changeing.
2006-10-11 10:33:34 +00:00