Commit Graph

271 Commits

Author SHA1 Message Date
91ea74c339 adding object.matrixParentInverse 2007-05-28 03:09:46 +00:00
30dd4fafd1 More memory leaks fixed - in IDProp, Bone.head, tail, matrix, ob.DupObjects (my fault) and in Effect module as well as a few others.
Also stopped using Py_BuildValue for strings, ints and floats.
2007-05-26 04:39:31 +00:00
f231bd0d57 Many long standing memory leaks fixed in the BPY api.
Data from Armature.c and logic.c still leaks.

Mostly todo with PyList_Append adding a refcount and the bpython api not decrefing.

Also added some features needed to fix a bug in mesh_clean.py (ob.pinShape and ob.activeShape)
2007-05-25 16:43:25 +00:00
05dcd05520 Python bugfix reported by reD_Fox1
ob1.shareFrom(ob2) - didnt work with the new type/realtype method of making sure all new objects were emptys until they were linked to data and the realtype is used.
2007-05-16 12:26:17 +00:00
66ffd1d207 more epy doc updates
added a constant dict "Blender.Object.IpoKeyTypes" to pass to ob.insertIpoKey(keytype), previously these constants were not documented well and added to Blender.Object directly
2007-05-05 06:09:03 +00:00
0c7e145dce Object.c - made object action writable
gen_library - fixed bug, wasnt adjusting user counts properly.
bpy_data.c - added default new names for new data
2007-04-25 00:37:19 +00:00
94ad8c810c Changed TESTBASE and TESTBASE_LIB to check the hidden flag
Checked every instance of testbase to see this dosnt break anything, also changed TESTBASE and TESTBASELIB, both were used incorrectly in places.

added error_libdata() for library error messages that are everywhere.
added object_data_is_libdata to test if the object and its data's are from a library.
fixed 2 crashs in adding Curve points to a library object (remember to check, verify_ipocurve returns NULL!)
made duplicating and making dupli's real for lib objects possible, disabled joining into lib armatures and meshes.
2007-04-22 22:08:19 +00:00
c97be098f7 Python API
made all libdata hashable - use the object type,name and lib for the hash.
added .tag to libdata so we can test if data's been processed without using dictionaries
added libdataseq.tag (write only) setting the tag flag (which can always be dirty)
2007-03-26 02:10:24 +00:00
Ken Hughes
b00f592992 Python API
----------
Bug reported on IRC:  Object.setEuler(0,0,0) threw an exception.  Change so
it will accept (0,0,0), ((0,0,0), ([0,0,0]), or an euler.
2007-03-17 03:19:41 +00:00
ee5dc4d0bf removed duplicate functionality, macro's and functions existed to check a PyObjects type, now only use macro's 2007-03-15 01:09:14 +00:00
5c5a80f644 made all python types that can do .__copy__(), also do .copy()
added copy function to lamp, texture and ipo types
2007-03-14 03:01:24 +00:00
d3ae4b9944 disabled Object.Duplicate() in background mode bacause it needs the 3d view, added a note in the docs. 2007-03-14 02:11:42 +00:00
e0c77c0f14 made all data adding functions accept a name such as add_mesh or add_curve, previously only some datatypes adding functions accepted a name.
also updated the Bpy.py epydocs
2007-03-11 16:25:17 +00:00
1135434ed1 moved python functions that deal with blender libdata into gen_library.c from gen_utils and BPY_interface
small cleanup, removed unused functions and explicetly cast pointers..
2007-03-11 04:05:45 +00:00
a8695b1c6e removed python oops access, (was unreliable and nobody used it)
oops data access need to be done differently.

Blender.sys fix for win32 path bug 6193
2007-03-10 11:47:24 +00:00
5eaf9f90c1 BPython API
added a function - GenericLib_assignData for assigning blender data, to assign an ipo to a camera or world to a scene for instance.
Using this function removed ~300 lines of code.
also fixes user count error in some places that didnt check.

also made it possible to clear the colorband by setting it to []
2007-03-08 14:37:34 +00:00
Ken Hughes
69dc499ee7 Python API
----------
Add some missing Py_DECREF() calls.
2007-03-07 00:56:09 +00:00
585edac6d2 various warnings fixes - mostly casting and initialization issues 2007-03-01 21:30:48 +00:00
436e1697fd made attributes (name, property, users, fakeUser, lib) into functions all python types can use.
removed a lot of code duplication when moving to this.
Also removed unused functions GetMaterialByName(), same for Mesh, Object, World etc.
2007-02-25 07:36:50 +00:00
75147698e2 Scene
* Moved to getsetattrs
* added scene.users (get)
* added scene.fakeUser (get/set)
* added scene.world (get/set)
* added scene.timeline (get)
* added scene.render (get)
* added scene.radiosity (get)
* added scene.objects.camera (get/set)

Group
* added properties

gen_utils
* made getScriptLinks work as documented, return an empty list rather then None.

header files, noted libdata after PyObject as a requirement.

Others,
* Deprecate prints for older functionality

EpyDocs still need updating.
2007-02-25 01:07:28 +00:00
086d51c822 BPython API
* Added data.lib attributes to almost all data types, (except for Text3d and NLA)
  This is None or the path of the library as a string.
* Main was giving a warning, Include Curve.h rather then CurNurb.h
* Added Library.LinkedLibs(), returns a list of externaly linked libs.
2007-02-23 14:51:20 +00:00
a2ce2600d9 renamed posebone.ik to hasIK, removed unused code, made the function name of Armatue's py object from Blender object consistant with others. 2007-02-21 23:14:01 +00:00
64231d19bf Object parentType could never match Object.ParentTypes.LATTICE, Id incorrectly assigned the lattice constant. Armature and Lattice parent types are the same. documented this. 2007-02-20 09:23:13 +00:00
Ken Hughes
4aa33f5633 Python API
----------
Bugfix for problem reported with ac3d importer; Object_getData() wasn't
setting the real object type before calling EXPP_add_obdata().
2007-02-14 17:40:31 +00:00
Ken Hughes
148a74988e Python API
----------
Replacing locally-declared function prototype with included one.
2007-01-25 19:31:39 +00:00
4d44475543 Bugfix #5732
Python scripts: when setting a layer for an object, the function assumed
the object had to be in the current scene, thus ignoring layers for other
objects.

Now the object->lay value is set always.
2007-01-17 21:07:10 +00:00
048bb84f82 Cleanup of pose insert methods for Armature objects, as planned in the post to bf-python.
Two sensible methods left in: armatureobject.insertPoseKey and .insertCurrentPoseKey,
but still left unofficial i.e. not published in the api doc yet, because of additional
error checking is still needed and more testing too. But at least is now in better shape to
work on to be published in a later release.
2007-01-15 16:00:36 +00:00
Ken Hughes
1a4e64cd02 Python API
----------
Bugfix: Object.setEuler() didn't accept an Euler object.
2007-01-12 22:15:33 +00:00
8ea2b66810 Made it possible to copy modifiers from the python API
ob1.modifiers = ob2.modifiers
2006-12-28 06:47:56 +00:00
Ken Hughes
a5c188b4a6 Python API
----------
Bugfix. Refactor from a few months ago broke ob.loc; it only accepted a tuple
of 3 floats instead of a list.  Make it accept both types now.
2006-12-27 18:39:39 +00:00
9afe662c12 renameing datablocks was imposing a name limit on the python side.
This isnt needed because the limit is alredy being set by rename_id()
some other minor changed- use None returning maro
2006-12-27 05:04:20 +00:00
Ken Hughes
e6381a04d6 Python API
----------
Bugfix: fix my own over-optimization in insertIpoKey(), allow IPOKEY_LOCROT
and IPOKEY_LOCROTSIZE to again set rotation and size Ipo curves.
2006-12-26 19:47:34 +00:00
46924d32f4 Camera.c refactor, moved to getsetattrs. deprecated get/set functions. and added access to all camera settings.
cam.type now uses 'ortho' and 'persp' rather then 0 and 1

group.c and object.c, minor cleanup
2006-12-26 07:00:32 +00:00
470f91b506 object_cookie_cutter - use edge keys
widgetwizard - made a mistake in last commit, works and also dosnt creash with bug.
https://projects.blender.org/tracker/index.php?func=detail&aid=5289&group_id=9&atid=125
Can others test so we can close?

Object_join was messing up object usercounts
2006-12-26 01:45:58 +00:00
b72bfbd923 replaced id->us++ with id_us_plus(id); so any indirect libdata isnt lost on reload.
added camera.dofDist to the python camera module
2006-12-24 03:25:53 +00:00
60a2977dcf adding ob.activeMaterial - allows you to get/set the active material for an object. 2006-12-22 04:46:37 +00:00
Ken Hughes
2260add0f0 Python API
----------
Correcting typos in Object documentation.
2006-12-19 17:17:14 +00:00
1ec3e6f3b6 adding ob_arm.makeParentBone([ob1, ob2...], bonename)
ob.parentbonename is also settable now as long as it already has a bone parent
2006-12-19 09:41:45 +00:00
Ken Hughes
65eda9e6e1 Missing variable initialization from earlier Object.New() patch. 2006-12-17 06:58:02 +00:00
Ken Hughes
940e625702 Python API
----------
Bugfix #5447: bug in determining whether a Curve was a CurNurb or SurfNurb.
2006-12-17 05:55:56 +00:00
1041ad4719 added fakeUser and users to more pytypes 2006-12-17 02:16:29 +00:00
Ken Hughes
08a7208aa6 Python API
----------
A more robust attempt to avoid creating non-Empty objects with no data while
maintaining backward compatibility.
2006-12-17 00:21:57 +00:00
a9447e4273 Enable/Disable DupFaces from the Python API.
Fixed a (own) bug in fakeUsers and added fakeUsers to Objects and Materials as well as Mesh.
2006-12-16 22:04:21 +00:00
dfb811d73d fixed issue: rbHalfExtents was accidently named wrongly rbShapeBoundType 2006-12-16 21:14:36 +00:00
47adee414c added ob.passIndex to bpy, changed passIndex tooltip to a better one ton suggested. 2006-12-12 21:01:43 +00:00
9c3cacd283 added the flag group_exclusive to material
added restrictDraw/Select/Render to objects in python
updated group and scene docs for last commit
made 3ds import use new scn.objects rather then Object.New() - (removed import as instance for now)
fixes off import error from this report http://blenderartists.org/forum/showthread.php?t=84182
2006-12-11 08:57:39 +00:00
Ken Hughes
ba36ef9f3f Python API
----------

Bugfix #5373: creating a curve or text object using Object.New() without
linking any data to the object would later cause a segfault when ob->data
was later dereferenced.  This problem will be fixed (hopefully soon) in the
API when new objects are created with data and linked to scenes all in one
step, but for now check for curves that ob->data is defined before using,
otherwise print an error message to the console and skip the object.
2006-12-09 06:17:14 +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
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
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