Commit Graph

119 Commits

Author SHA1 Message Date
327881c838 [#18574] small bug - warning for sce.link() depreciated displays even when sce.objects.link() is used
Remove the warning since the func will sstay in 2.4x
2009-04-23 00:56:05 +00:00
3e7cbd5388 Blender Python API
- Removed the gen_utils.c dependency from Mathutils (since gen_utils wont go into 2.5 but mathutils will), repalced with python functions.
- removed Blender.Mathutils.Point, since it was not documented, the C api never used it, none of our scripts used it (and I never saw a script that used it).
2009-04-21 09:44:29 +00:00
2a331067cc resolve some compiler warnings with intel c/c++ compiler
* subsurf code had a lot of unused variables, removed these where they are obviously not needed. commented if they could be useful later.
* some variables declorations hide existing variables (many of these left), but fixed some that could cause confusion.
* removed unused vars
* obscure python memory leak with colorband.
* make_sample_tables had a loop running wasnt used.
* if 0'd functions in arithb.c that are not used yet.
* made many functions static
2008-09-29 17:08:11 +00:00
3dbdd8939b 16624 was incorrect. Blender wont always give the requested name for new datablocks or for renaming. scripts need to account for this. 2008-09-20 11:54:27 +00:00
c282178411 Patch #17654: Fix for Scene.Get with input >20 chars
Patch by Darryl Pogue (paradox).

Blender cuts off datablock names at 20 chars, which causes issues if you're trying to access Scenes with a string longer
than 20 chars.

Ex.

s = 'GuildPub-Writers_GLOBAL'
Blender.Scene.New(s) #This creates the scene "GuildPub-Writers_GLOB"
Blender.Scene.Get(s) #This throws an error: the name and the string don't match

This patch cuts down the input of Scene.Get() to the 20 char limits, thus making the the above example return the correct
scene.
2008-09-20 10:10:50 +00:00
da2d4904af bugfix
* scene.object.context and scene.object.selected had broken get_item 
funcs so scene.object.context[i]  returned the wrong object.
* aligning the view to an object (numpad*key), did not disable the 
ortho view grid.
* long standing problem where opening a relative image would fail with 
no message. BLI_convertstringcode was returning a path with /../../'s 
that need to be cleaned before the path could be read, the path was also 
invalid from unix shell so its not a blender path reading problem.
2008-05-30 01:59:15 +00:00
be0b8ccfaa Used GET_INT_FROM_POINTER to get rid of many warnings that only occurred with 64bit os's
Also use Py_ssize_t which we might need to define for older python's
2008-04-17 21:14:55 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
009e5d00cb TimeLine PyType was not getting initialized, causing auto-completion in the interactive console to crash. 2008-03-31 14:29:40 +00:00
c7d0a2a92a PyAPI: create scene sequence data if its not there when getting scene.sequence 2008-03-03 21:43:31 +00:00
7af9e824bf * Bugfix #8426: certain hooks options segfaulted
This was caused by my previous commit for add_hook.

* Also, removed a compiler warning in the Python code
2008-03-03 03:21:25 +00:00
d1af95f4bb Fix for bug [#8405] makeParentDeform segfaults Blender
linking armatures to objects didnt make pose data.
2008-03-01 10:59:38 +00:00
b7af3d2cbd fix for [#8257] double-freeing pointers from sculpt code
http://projects.blender.org/tracker/index.php?func=detail&aid=8257&group_id=9&atid=125

Cleaned up scene_copy, and moved some scene copying into this function that was inline in the user interface.

Also moved malloc error prints onto separate lines so you can set breakpoints.
2008-02-16 16:35:47 +00:00
df46987ba3 old bug in python api, Blender.Scene.Unlink() did not check if screens were using this scene or if it was used as a set elsewhere.
In both cases this resulted in invalid pointers and crashes.
Also was not freeing nodes or sequence data.
2007-12-24 10:25:35 +00:00
5dfef1ae35 Reverting to 2_2x BPY
I was careful in selectively rolling back revisions, but if you've committed changes unrelated to BPY mixed with BPY changes, I might have reverted those too, so please double check.
2007-12-17 20:21:06 +00:00
b4ec6efb41 =Python API bugfix=
Scene.update(full=1) was pretty useless as it didn't actually evaluate the
depsgraph DAG.  This meant, for example, that re-evaluating the parenting
tree for an armature pose could only be done by redrawing the view (which
evaluates the depsgraph). scene_update_for_newframe() is now called when Scene.update is in "full" mode; to prevent firing off newframe scriptlink events, scriptlinks are
temporarily disabled while scene_update_for_newframe() is being called.
2007-11-07 18:52:23 +00:00
17533e534f removing unneeded checks 2007-07-25 04:45:20 +00:00
39e4dc6202 replace PyInt_CheckExact with PyInt_Check, same for floats and strings so subclass and C/subtypes work.
was reported as a bug a while ago.
2007-07-01 05:41:23 +00:00
39a526a963 Python PyMethodDef supports single argument methods (METH_O) but was using METH_VARARGS everywhere and getting the single args from the tuple.
Use METH_O where applicable.
2007-06-16 12:24:41 +00:00
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