Commit Graph

84 Commits

Author SHA1 Message Date
3c1ad6a295 * Displacement map baking
This is an extension on the work Brecht already did to implement normal map baking. I've updated the release notes page here with info and pics:

http://www.blender.org/development/current-projects/changes-since-244/render-baking/
2007-12-29 05:17:19 +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
bfb9603cb4 From stable
Revision: 11237
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11237
Author:   campbellbarton
Date:     2007-07-12 13:05:31 +0200 (Thu, 12 Jul 2007)

Log Message:
-----------
PyObject_IsTrue was missing a check for an error return value in many cases.
2007-07-12 11:51:21 +00:00
e192e7e024 remove unneeded checks from the python API 2007-06-29 08:59:26 +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
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
d6cbdabfe1 Bugfix for python Image.save()
[ #6702 ] Image doesn't get saved after painting & packing
IMB_saveiff - (general saving function), does not write a file when the image is packed.
so write a file with writePackedFile for packed files.
2007-05-22 19:40:11 +00:00
c71949419e == UV/Image Editor ==
Patch #6570.

This patch adds color and alpha selectors to Image -> "New..." dialog.
2007-05-03 15:10:44 +00:00
3fe793f2b5 [ #6442 ] image.repack (Python)
- Modified pack so it can repack too, rather the n raising an error.

editobject - Dont need to recalc data when hiding and unhiding. rather do what layers do and re-sort the scene.
2007-04-19 23:45:33 +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
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
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
5ae20c6eaf renamed norepeatX/Y to ClampX/Y 2007-03-13 12:50:36 +00:00
268fdb7425 added no-xtile and no-ytile to the images realtime properties and python api. 2007-03-12 01:43:11 +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
Ken Hughes
6da624fead Python API
----------
Added Image.source attribute, so image type can be get/set for still, movie,
sequence or generated images.
2007-03-09 22:21:23 +00:00
a3320f209c console.py
* improved autocompleation
* faster dictionary usage

Types.c
* type(scene.getTimeLine()) # old bug, will crash blender
2007-02-26 02:24:04 +00:00
a05f95f347 Image.c
* moved to getseters (use new generic ID funcs)
* added 'reflect' attribute

Text.c
* moved to getseters (new generic ID funcs too)

NLA.c
* moved to getseters (ditto)

Ipo.c
* bugfix, allow nested loops on an IPO's curves.

Blender.c
* removed undocumented function RemoveFakeuser, since actions now have the fakeUser attribute.
2007-02-25 12:41:50 +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
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
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
ed47053fa6 Arnaure.Get() now raises an error when the name dosnt exist. added warning in docs.
Image - added img.fields, img.fields_odd, img.antialias, also updated the docs. replaced Py_BuildValue with faster list creation for getPixel functions.
2006-12-22 21:23:27 +00:00
253432bfc7 The Big Image refactor!
Please read:
http://www.blender3d.org/cms/Imaging.834.0.html

Or in short:

- adding MultiLayer Image support
- recoded entire Image API
- better integration of movie/sequence Images

Was a whole load of work... went down for a week to do this. So, will need
a lot of testing! Will be in irc all evening.
2006-12-20 17:57:56 +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
dda63a9dde added comparison function to many python types so you can do == and =! 2006-10-06 16:48:28 +00:00
d82f1f5f91 from looking at patch 4934 made all user preference paths settable with Blender.Set('val', data), also added exception errors which were on the todo.
image.filename was being limited to FILE_MAXDIR rather then FILE_MAXDIR + FILE_MAXFILE when setting.
2006-09-21 18:25:40 +00:00
95c185c4c5 Setting the image name was raising an error. 2006-09-21 17:03:24 +00:00
e472a3d852 renamed Blender.Image.SetCurrent(img) to img.makeCurrent() to be consistant with scene.
applied patch #4998 (array count), as well as adding other array settings, updated documentation as well.
added EXPP_setVec3Clamped() as a way to set a vector from getset attrs (used with array offset and scale)
2006-09-17 02:31:16 +00:00
c7d39e1a06 New images were being initialized with zero users (normal for other data types),
but for images user counts work differently.
(just noticed this is what blender does so Image.New() now does the same)

Many of the sys functions had maximum path thengths that were too short.
  char path[FILE_MAXFILE];
rather then
  char path[FILE_MAXDIR + FILE_MAXFILE];
2006-09-16 10:05:57 +00:00
e6960f3881 Python Metaballs api refactor, based on Mesh and Group modules.
* removed get/set in favor of setsetattrs
* added an element iterator to the metaball data type.
* now accepts vectors and quat for location dimensions and rotation.
and other small changes.
Docs updated shortly at.
http://members.iinet.net.au/~cpbarton/ideasman/BPY_API/Metaball-module.html

other changes
typo in image.c
metaballs constants in buttons_editing
2006-09-16 09:33:09 +00:00
2b7f09b8ea added Image.SetCurrent(img) and img.has_data so you can see if an image contains pixel info. 2006-09-16 06:18:41 +00:00
Ken Hughes
e194ccce5e ===Python API===
Bugfix: using Image.GetCurrent() and image.save() on the "Render Result"
image could result in a segfault since image->ibuf was NULL.  This change
forces ibuf to be created if necessary.

NOTE: the Image API needs additional methods/attributes for image.save() to
really do anything useful.  The image type, quality, etc., don't seem to be
gettable/settable so the resulting image file may not be in the format the
user would like.
2006-07-18 21:02:15 +00:00
dee16b9e3d * bug fix
[ #4228 ] Blender.Image.Load(filename) loads only on the first loading
- Image.Load() will now reload the image buffer when a image of the same name is loaded again
- small textual change in render code
2006-05-26 15:28:04 +00:00
1022107236 Image and Draw wernt converting the paths of an image properly.
Getting teh size of an image with a relative path "//foobar.png" would always fail.
2006-05-19 15:33:23 +00:00
e9718958ee Applied pack unpack from Pablo Martin (caedes),
http://projects.blender.org/tracker/?func=detail&atid=127&aid=3246&group_id=9
adds

Blender.c:
Blender.UnpackModes (dict with the unpack modes)
Blender.UnpackAll(mode)
Blender.PackAll()
Blender.CountPackedFiles()

Image.c:
image.packed (this was working)
image.pack()
image.unpack()

Sound.c:
sound.packed
sound.pack()
sound.unpack()
2006-05-06 06:17:46 +00:00
Stephen Swaney
342bb99a19 a little spring cleaning to remove some compiler warnings for
implicit declarations, redundant redeclarations, missing initializers,
nested externs and other cruft.

Cleaned up includes and moved extern _Type decls from Types.h into
Types.c since that is the only place where they are needed now.

Did not touch Ipo.[ch] since work is on-going there.
2006-04-16 15:28:50 +00:00
915cd5b80b Added python image pack/unpack per image. 2006-03-26 09:25:30 +00:00
Ken Hughes
e57ce8489b ===Python API===
Two small bugfixes:
   * Image.New() resets id.us to 0; it is set to 1 by new_image()
   * allow ima.depth and ima.size getters to propagate their own error
     messages (missing image was returning MemoryError)

Also, seems to me there's something funny going on with image id.us
accounting.  In do_image_buttons(), id.us is set whenever an image is
accessed vi the datablock menu:

        if(idtest!=id) {
            G.sima->image= (Image *)idtest;
            if(idtest->us==0) idtest->us= 1;
            allqueue(REDRAWIMAGE, 0);
        }

This is independent of whether a UV face is selected or not (and it also
seems that the number of UV faces linked to an image is not maintained
either).
2006-03-21 23:30:25 +00:00
2b7919a9f2 fixed returning true/false, thanks Willian. as well as removed the image space spesific image changed call. 2005-12-18 08:47:55 +00:00
e76e78e78a typo, thanks letterrip. 2005-12-16 22:40:20 +00:00
4a8087db76 Fixed some warnings from GetCurrent, remaining warnings seem to have no obvious solution
attr = Py_True; // Image.c:1107: warning: dereferencing type-punned pointer will break strict-aliasing rules
2005-12-15 02:06:37 +00:00
d527b0e585 Added
Image.New(name, w,h,depth)
Image.start- for animtex
Image.end - for animtex
Image.speed - for animtex
Image.packed - read only bool

See the pydocs for details.
2005-12-14 03:27:35 +00:00
7bba26d24b *warnings fixes 2005-12-13 14:29:56 +00:00
fadaa2fbe9 From kh_pylon:
You have to put Py_RETURN_NONE; inside { }; it's a two-line macro
Aparently breaks MacOS.
2005-12-13 00:27:10 +00:00
d73e312f88 Added Image.GetCurrent()
Previously the only way to get the current image was flaky and relyd on the image being assigned to a mesh.

try:
  me = Scene.GetCurrent().getAttiveObject().getData(mesh=1)
  image = me.faces[me.activeFace].image
except:
  image = None

...Can new be replaced by the following, and works even when there is no mesh.
image = Image.GetCurrent()

epydocs:
  Get the currently displayed Image from Blenders UV/Image window.
  When multiple images are displayed, the last active UV/Image windows image is used.
2005-12-13 00:00:11 +00:00
Stephen Swaney
bb5ae49992 A large collection of fixes from Ken Hughes including:
- corrections to constants
 - parameter type checking
 - correct use of METH_VARARGS vs METH_NOARGS
 - return objects instead of strings in Scene.getChildren() as per doc.
 - correct logical operators

Thanks, Ken!
2005-08-21 15:00:17 +00:00