Commit Graph

90 Commits

Author SHA1 Message Date
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
5dbc4c5f8f Added scn.objects.new(obbdata) as a way of adding object data to a scene and createing the object data at once.
This functionality will probably be moved later on after discussion.
2006-08-27 16:27:34 +00:00
66bc55e8a6 Added a new iterator type to the scene - scene.objects should eventualy be used in place of scene.getChildren() and linking objects to the scene. 2006-08-26 09:53:26 +00:00
Ken Hughes
e5ccb8773d Bugfix #4169: unlinking an empty object using scene.unlink() wasn't checking
for ob->data == NULL, causing segfault.
2006-05-03 17:15:33 +00:00
f913a53b0a A small alteration for C syntax, code before vars (MSVC complained about this). 2006-03-13 14:44:49 +00:00
Nathan Letwory
50b34df348 ==BPy==
* move declaration to start of function. Again I repeat: these *have* to
  be at the start. GCC users should check themselves always, as GCC allows
  this kind of atrocities :)

  /Nathan
2006-03-13 14:43:20 +00:00
3649c806a3 Scene unlinking didnt set the python objects scene to NULL,causing memory errors if accessing the data after the scene was unlinked.
Also a few functions segfulted if scene was unlinked, added more checking.

First commit from win32, hope line endings are ok.
2006-03-13 02:02:19 +00:00
Ken Hughes
93c3a6f784 Bugfix #3898: Scene.unlink() was not decrementing the datablock user count. 2006-03-11 01:14:33 +00:00
1db5c23716 More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.

The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.

Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.

- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".

- Bug fixes

Added redraw event for Image window, when using compositor render.

Text objects were not rendered using background render (probably a bug
since depsgraph was added)

Dropdown buttons in Node editor were not refreshed after usage

Sometimes render window did not open, this due to wrong check for 'esc'.

Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
ef520a8cc9 Scene.c - Removed redraw when in non UI mode.
Lamp.py - Example indent
Object.py - Improved join documentation.
2006-01-06 01:53:26 +00:00
5233f73589 *warnings fixes
- fixes a number of warnings in bpy project
2006-01-03 16:27:34 +00:00