Commit Graph

100 Commits

Author SHA1 Message Date
044607a450 == PY API ==
Added some braces to silence gcc warnings about scene.c
2007-05-29 10:28:19 +00:00
bcc3143119 more memory leak fixes, though only a few are likely to happen 2007-05-27 21:33:48 +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
8355326e01 Scene.c - scene.objects.context how dosnt include hidden objects
editview.c - deselect all ignores restricted objects
headerbuttons.c - removing a material didnt redraw the 3d view
vpaint.c - disable vpaint for mesh libdata as well as object libdata
2007-04-30 08:00:48 +00:00
Ken Hughes
bf8bb77abc Python API
----------
Change deprecation printfs to print warning once instead of everytime the
deprecated method is called.  Also commented out deprecation warnings for
code which will eventually be replaced by experimental Blender.Main/bpy
module.
2007-03-31 15:31:37 +00:00
8da5f2a143 allow dealing with vertex groups once an object is created from a mesh. 2007-03-30 16:47:42 +00:00
1a47d71f72 added Window.Get/SetActiveLayer() and changed how scn.objects.new() works, if scn is the active scene it uses the 3d views active layer to create the object in. 2007-03-30 08:20:37 +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
3a834803ef Python API
----------
Support for new bpy.libraries module, which is being proposed to replace
the Blender.Library module.
2007-03-21 02:23:28 +00:00
52e43441d1 removed unneeded dealloc functions 2007-03-15 01:47:53 +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
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
36eba6eb6c PyApi: fix for own bad bug, obdata was having a user removed when the object was removed with (scene.objects.unlink(ob)) 2007-03-10 12:37:03 +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
Ken Hughes
b8e236a861 Python API
----------
Fix bug with variable declaration in middle of function.
2007-03-09 00:11:02 +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
69a46946e1 adding experemental sequencer module, This may change or be removed before next release.
scene.sequence - This is an iterator that loops over strips, metastrips are intern iterable.
currently has support for dealing with scene strips and metastrips, generic strip options and moving strips about.
2007-03-05 15:26:03 +00:00
69eb4eefb5 Scene.c - world could not be set to None, added "cursor" attribute.
Scene.py - added docs for new scen attributes.
meshtools.c - typo
2007-03-01 13:22:26 +00:00
780177ec13 mis named Layer, should be Scene.Layers 2007-02-28 04:50:39 +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
Nathan Letwory
35bb9dff1d * remove warning about add_only_object 2007-01-24 04:44:49 +00:00
702defaa81 use add_only_object to add a new object with defailts. 2007-01-23 16:51:14 +00:00
a03c8ba8a0 creating new objects from
ob = scn.objects.new(arm_data)
didnt work.

Also added docs to Pose - that make an armature, add an action and add pose keyframes
2007-01-22 11:26:55 +00:00
9ca61ba44d Scene.c - deprecation warning for getScene
bvh_import.py - use old slow method of adding keyframes. setting IPO's was having problems.
2006-12-29 08:57:33 +00:00
2feea3dcc3 made scn.objects more flexible... you can now things like...
scn.objects.selected = [] # deselect all
scn.objects.selected = scn.objects # select all
scn.objects.context = [ob1, ob2...]

Added epydoc examples and updates importer scripts to use this de-select-all method.
2006-12-28 11:09:36 +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
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
Ken Hughes
7679634ff8 Python API
----------
Bugfix: Scene.objects.new() didn't check string inputs correctly.
2006-12-21 16:05:01 +00:00
Ken Hughes
0a0753b409 Python API
----------
Change Scene.objects.new() to accept the string "Empty" instead of Python
None when creating new empty objects.
2006-12-20 16:02:01 +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
956add11b4 Wasnt initializing a pointer as null, messed up making new object names 2006-12-15 09:58:16 +00:00
b69fdd21ba renamed objects.add() and .remove() to .link() and .unlink() for scene and group objects to be less pythonic and more like blender.
for scn.objects.new() a optional second argument can be used to spesify the name.

We still need a way to add a new Empty (some constant)
2006-12-11 03:23:17 +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
Ken Hughes
318a694a25 Get rid of various warnings with gcc under linux 2006-11-17 17:50:43 +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
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
80ffbee6f7 was missing a return of len, so scn.objects.context was always returning 0 2006-10-25 13:33:08 +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
0ed327f162 Setting new objects scenes layers is & (1<<21)-1
the scenes active object is only unset when unlinking - if the active object is being removed.
2006-10-11 03:02:35 +00:00
e4c38c5740 changed python scn.Layers get/set to mask off bits other then (1<<20)-1 2006-10-10 04:54:02 +00:00
6e61448123 Mistake in recent schange to scn.objects.new() crashed Blender. fixed and also stopped Mesh_FromPyObject() clearning a meshes object if not called with an object. 2006-10-10 02:18:08 +00:00
27dc45ba24 BPyRender.imageFromObjectsOrtho's now sets all layers visible,
an error in Scene.c - scn.Layers disallowd all layer bits to be set.

made image_billboard.py rotate all images to be verticle for more efficient packing, added the option not to pack resulting images into 1.
2006-10-09 04:29:24 +00:00
b3a48fe82e removed some unused vars from Curve and matrix
scn.objects.new(None) - adds a new empty
 - new objects are selected by default now

further stripped down the vector struct, the wrapped state was being stored and 2 places.
2006-10-07 11:49:53 +00:00
dda63a9dde added comparison function to many python types so you can do == and =! 2006-10-06 16:48:28 +00:00
7f7f35d1ca fixed mistakes and warnings in previous commit. 2006-09-24 09:21:18 +00:00
e8495d1fdd Extra generic errors for Scene, Groups and Metaballs to raise errors when trying to do anything with a python objects thats had its data removed in Blender.
Added to existing scn.objects
scn.objects.active    (get/set the active object for the scene)

scn.objects.selected    - an iterator that only uses selected objects
scn.objects.context    - an iterator on objects in the user context (visible in the current 3d views layer and selected)
These are the same type as scn.objects but .add() .remove() .new() .active etc raise errors. so scn.objects.selected.add() will raise an error.

Made nested loops possible with scn.objects, metaball.elements and ob.modifiers, by initializing the iter value as NULL and creating copys of the pyobject when _getIter() is called if ->iter is not NULL.
This is how pythons xrange() works.
2006-09-24 08:30:38 +00:00
Ken Hughes
f108325904 ===Python API===
Bugfix for #4971: Scene.unlink() was incorrectly decrementing the datablock
user count whenever an object was removed from a scene, instead of only when
the object's count reached 0.  The Python code was modified to use the
existing free_and_unlink_base() function (with some modifications to allow
specifying a scene).  Also fixed a bug with the undocumented return codes
from the method; it now returns True if the object was found in the scene.
2006-09-08 18:31:09 +00:00
0648d0d13a Commented out user incrementing while linking to a scene while testing that I forgot to remove.
also shut GCC // comments to /**/
2006-08-29 06:04:10 +00:00