Commit Graph

880 Commits

Author SHA1 Message Date
368cab399c === bugfix win32 - python ===
Fixed BLI_exist: In Windows stat doesn't recognize
a dirname ending is a slash, exept when it's
the root dir ("C:\\"), where it is required.
So trailing slashes are only removed when filename
is longer than 3 chars.
Also fixed Python Sys.c that now uses BLI_exist
instead of calling stat directly.
2006-03-19 13:28:01 +00:00
59ed566e86 Added support for group objects
grp.objects

To have an iterator assigned as well as a list. Since gp.objects is an ietartor this is expected.
grp.objects= someGroup.objects works now.

Some other small fixes made.

Made a wrapper for add_to_group() That handles the OB_FROMGROUP flag. Should be moved to group.c's add_to_group()

void add_to_group_wraper(Group *group, Object *ob) {
	Base *base;
	add_to_group(group, ob);

	if (!(ob->flag & OB_FROMGROUP)) { /* do this to avoid a listbase lookup */
		ob->flag |= OB_FROMGROUP;

		base= object_in_scene(ob, G.scene);
		if (base)
			base->flag |= OB_FROMGROUP;
	}
}
2006-03-19 04:45:58 +00:00
abab9fc3de Added object.dupliGroup so objects can access the groups they instance.
This is very confusing.
Since in object has
ob.setDupliGroup() # Enable/Disable Dupligroup
ob.getDupliGroup() # see if its enabled.
ob.dupliGroup # the group data this object is instancing.

Not yet added
ob.groups # Groups that use this object.
2006-03-18 17:24:59 +00:00
bfe42eea43 Moved declerations to the top of the skope so as to work with MSVC?
started removeing // from constant.h to shut GCC's -pedantic up. realized // are used everywhere.
2006-03-18 15:23:02 +00:00
7b37efb35f Added Blender.Group module
The plans for the new Python API are too far off to have this module conform.

Needs testing with MSVC 6
2006-03-18 14:47:26 +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
f7cccc36d4 Bugfix #3995: NMesh.GetRawFromObject() would segfault sometimes if object
was in editmode, due to undefined derivedmesh data.
2006-03-11 18:18:32 +00:00
Ken Hughes
5f550b4ceb ===Python API===
A bug fix and an enhancement:
   * fixed bug when adding or deleting faces from a mesh which has
     vertexColors; mesh->mcol was not being updated
   * changed edges.extend() and faces.extend() to accept integer vertex
     indices in addition to MVerts; this should make scripts simpler and
     in general make things run faster
2006-03-11 16:00:07 +00:00
Ken Hughes
04ce5e8efe Bugfix: Object.link() was not correctly handling object/datablock material
counting, causing "Error Totblock" messages on exit due to memory not being
freed.  Added a call to test_object_materials() after the new data is linked.
2006-03-11 01:17:21 +00:00
Ken Hughes
93c3a6f784 Bugfix #3898: Scene.unlink() was not decrementing the datablock user count. 2006-03-11 01:14:33 +00:00
Ken Hughes
c35e8426fe ===Python API===
Additions to BezTriple API: complete get/set access to all BezTriple settings
(knot and handles points, handle types, tilt/alfa, hide, weight and selection
status).
2006-03-10 21:39:14 +00:00
Ken Hughes
2a4dc7654c Bugfix #3895: Call to PyString_FromString() wasn't being Py_DECREF()'ed,
causing a memory leak.
2006-03-10 21:05:30 +00:00
e0f9c69a2c quick fix for Python armature CVS making bones with no layers, therefor being invisible.
Should realy have Bone/Layer access through python.
2006-03-06 02:07:39 +00:00
Ken Hughes
ae32a538dd ===Python API===
Taking a hint from Hos, started adding some (hopefully) better examples into
the documentation for creating and manipulating meshes.
2006-03-04 00:04:45 +00:00
8afc4cf192 fix for bug 3903
.
2006-03-03 17:45:23 +00:00
0caa0ddb82 Fixed mistake where BLI_countlist(&(lb)) should be BLI_countlist(lb) 2006-03-02 01:00:13 +00:00
f68b0ddb2a Recoded Panorama rendering.
The old implementation was added quite hackish (talking about 10 yr ago).
You also had to make a small image slice, which was extended Xparts in
size. That also required to adjust the camera angle. Very clumsy.

Now; when enabling the Panorama option, it will automatically apply the
panorama effect on the vertically aligned tiles. You can just enable or
disable the "Pano" button, to get a subtle lens effect like this:

(without pano)
http://www.blender.org/bf/rt.jpg
(with pano)
http://www.blender.org/bf/rt1.jpg

For Panorama render, the minimum slice size has been hardcoded to be 8
pixels. The XParts button goes up to 512 to allow that. In practice,
rendering 64 slices will already give very good images for a wide angle
lens of 90 degrees, the curvature of straight lines then is equal to
a circle of 256 points.
Rendering a full 360 degree panorama you do by creating an extreme wide
angle camera. The theory says camera-lens 5 should do 360 degrees, but
for some reason my tests reveil it's 5.1... there's a rounding error
somewhere, maybe related to the clipping plane start? Will look at that
later. :)

Also note that for each Xpart slice, the entire database needs to be
rotated around camera to correct for panorama, on huge scenes that might
give some overhead.

Threaded render goes fine for Panorama too, but it can only render the
vertically aligned parts in parallel. For the next panorama slice it has
to wait for all threads of the current slice to be ready.

On reading old files, I convert the settings to match as closely as
possible the new situation.
Since I cannot bump up the version #, the code detects for old panorama
by checking for the image size. If image width is smaller than height, it
assumes it's an old file (only if Panoroma option was set).
2006-02-27 12:39:36 +00:00
b7ff45f914 new emptys now have default settings for new emptys. 2006-02-27 06:00:00 +00:00
9e0d2837d5 Applied JMS's Patch. for better Python Dupli Access.
Made some fixes and changes.
* The matricies returned were wrapped. Wrapping Display Mesh matricies segfaulted sometimes. - Made a copy instead.
* Added 1 missing epydoc from the patch.
* Renamed getDupliMatrices to getDupliObjects, and changed to return a list of (object, matrix) tuples instead of just the matrix. This is much more usefull because it allows python to know what objects are used for dupliGroups and for dupliverts where there is more then 1 child. also cleaned up this function a bit.
2006-02-27 04:05:55 +00:00
Ken Hughes
69d00bccaa ===Python API===
Bugfix: make face and edge .extend() methods check that input vertices are
from the same mesh.  Fixes a bug found by Cam.
2006-02-17 17:50:54 +00:00
Ken Hughes
7592c09c2b ===Python API===
Allow object.setMatrix() to accept 3x3 matrices by extending to a 4x4
internally.  Also check the dimensions of the new matrix and throw an
exception if not a 3x3 or 4x4.
2006-02-16 20:09:32 +00:00
9fedbd6c51 ==Python==
Small bug reported on irc, matrix.translationPart didn't check bounds
properly (needed to use || instead of &&). Also fixed similar bugs in
rotationPart and rich compare.
2006-02-15 22:31:43 +00:00
4c966a3141 assignment typo: had == instead of =
Reported by jkw on the forums.
source/blender/python/api2_2x/Text3d.c

Kent
2006-02-13 01:25:03 +00:00
ee4c7ef22a Added ability to render Zbuffer to an image.
Just use SHIFT-F3 and save an image.

	Basically all this does is copy the zbuffer to a new Image buffer
	and pass that to the save image function.

Sample output:
	http://www.cs.umn.edu/~mein/blender/kungfu_zbuf255.jpg

	Also thanks to Jesterking for helping me debug dumbness... ;)
	and the nice screenshot.

Kent
2006-02-10 21:10:58 +00:00
Ken Hughes
83ea72de1a ===Python API===
Three more changes for the Mesh module:
(1) Bug fix for UV vertices ("sticky").  me->msticky was not being updated
   when vertices were added or deleted from the mesh.
(2) Vertex, edge and face .extend() methods accept zero-length sequences
   instead of throwing an exception.  (Note that not giving any argument
   is still an error).
(3) Edge and face .extend() methods ignore "invalid" edges or faces which
   have the same vertex twice instead of throwing an exception.  Cam and I
   argued about this for a while... :-)

Ken
2006-02-10 00:08:06 +00:00
a3d0d456ac More things for easying the job of replacing proxy/working armatures in the scenes of Elephants Dream with the final ones: 1) adds removing Fakeusers from Actions to PyAPI, now with a hackish call in the Blender module. Possibility of better ways should be discussed on bf-python. 2) adds BPY Object.copyNLA(otherob) - that was simple 'cause the copy_nla function was nicely in kernel nla.c. 3) Object.convertActionToStrip(), here it gets tricky: the function to convert the active action of an object to a NLA strip was buried inside the respective function in the GUI editnla.c which had also code for reading mouse coordinates and whatnot. So I took the actual copying out of it and moved it to the kernel nla.c as a new function, bActionStrip *convert_action_to_strip (Object *ob). that code used other functions, of which find_stridechannel() was also in editnla.c but free of UI code so i moved it to kernel too. kept things with UI code in editnla.c. tried to be careful with keeping mallocs and the pointer business intact, and tested that this works and after usage Blender gives no memory warnings or anything, so seems ok - but certainly is best reviewed by ppl more active with c coding than me. hopefully this little refactor makes it possible to add this function to the menus too, which was not straightforward earlier when Matt took a look at it. 2006-02-08 16:58:12 +00:00
0b1cf0a01f Add the WITH_OPENEXR to sconscript. I needed this for toni's latest SceneRender stuff to work. Strange that it worked ok on his computer without this. 2006-02-07 19:04:24 +00:00
3fe6fca3f6 additions to make the orange rendering preparation script work, sorry undocumented again (we are testing this now and gotta commit to get this to other compus at studio, Stivs make a note to bug me about the doc or someone add it.. :o) 2006-02-07 18:33:01 +00:00
680756393a - Header changes to support hdaudio, memcache limitor and framecount boost. 2006-02-05 19:36:32 +00:00
Ken Hughes
ccedf6d833 ==Python API==
Bugfix #3849: "break" instead of "continue" caused memory corruption in
faces.extend() if an edge was given in the middle of parameter list.
2006-02-05 19:15:58 +00:00
Ken Hughes
8c333c63a4 Previous commit broke faces.extend() and edges.extend() for single edges
and faces.
2006-02-05 15:43:47 +00:00
e66b5e5cd5 UV Editor Tweaks:
- Set local sticky in the uv editor as default.
- Don't do live unwrap on fully selected charts or charts with no pins
  selected.
- Fixed bug with live unwrap not respecting transform cancel in some cases.
- "View Home" didn't work without an image.
- Move UV Calculation settings (cube size, cylinder radius, ..) into the scene
  toolsettings, instead of global variables
- Remove the name LSCM from the UI (and python docs on seams), and replace it
  with 'Unwrap', with upcoming ABF this didn't make sense anymore.
- Move the Old/New LSCM switch into the UV Calculation panel. New LSCM is the
  default now. Also renamed LSCM there to "Conformal".
- Made some room in the UV Calculation panel by removing the buttons to execute
  the UV calculation, only leaving the settings.

Fill Holes:

- LSCM now has an option to fill holes in the chart before unwrapping. This on
  by default, and enables two things:
  - Prevent internal overlaps (e.g. eyes, mouth) for LSCM unwrapping.
  - Allow the internal boundaries to move freely during stretch minimize.
- The possibility to switch it off is there because it is not always possible
  to define which the outer boundary is. For example with an open cylinder
  where there are two identical holes.
2006-02-05 14:12:45 +00:00
Ken Hughes
eb185d7032 ==Python API==
A couple of bug fixes and enhancements:
(1) Setting the UV attributes of a mesh face will create texture faces if
    they are not already defined.  Previously this threw an exception.
(2) Setting the image attribute of a mesh face will also set the TEX bit
    of the face.mode flag
(3) When "sticky" vertices are created with mesh.vertexUV, the color is
    set to white instead of black.
(4) Bugfix #3872: copying the mode attribute of one mesh to another would
    sometimes result in an exception due to unexpected bits being set. I
    still don't know how these other bits are being set, but this patch will
    stop the complaint if they are set.
2006-02-05 07:19:37 +00:00
Nathan Letwory
3bb82a27fc == SCons ==
* This commit is all of the rewrite work done on the SCons system. For
  documentation see doc/blender-scons.txt and doc/blender-scons-dev.txt.
  Also http://mediawiki.blender.org/index.php/BlenderDev/SconsRefactoring
  contains valuable information, along with what still needs to be done.

    - linux, os x and windows compile now.
    - files are compiled to BF_INSTALLDIR (see config/(platform)-config.py)
        - NOTE: Jean-Luc P will commit sometime during the weekend proper
          appit() for OS X. For now, copy the resulting binary to an
          existing .app bundle.
    - features:
        - cleaner structure for better maintenance
        - cleaner output during compile
        - better handling of build options
        - general overall speed increase
        - see the wiki for more info

  Cygwin, FreeBSD and Solaris systems still need work. For these systems:
    1) copy a config/(platform)-config.py to ie. config/cygwin-config.py
    2) set the proper defaults for your platform
    3) mail me at jesterking at letwory dot net with you configuration. if
       you need any modifications to the system, do send a patch, too.

  I'll be giving first-aid today and tomorrow, after that it'll be all
  regular development work :)

  /Nathan
2006-02-04 14:15:10 +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
afb5a2acf5 yet another temporary strange but straightforward hack for a script at orange to work! that is: while Joseph is working on the actual Constraint API for bones etc., this allows our armature script to set influences with a simple call: armatureobject.setConstraintInfluenceForBone(bonename, constraintname, influence); fails silently at failure ('cause the c calls used do and no retvals are checked) and is in the strange place (as the current api is largely not object level) but works for us for now (e.g. next few weeks). 2006-02-01 22:21:46 +00:00
Ken Hughes
1b0ad97f46 ==Python API===
Minor typo fixes for Object API.
2006-01-31 22:18:07 +00:00
240e25ab65 Cleanup of blender/ module; Makefiles now compile this warning free.
Mostly was unused variables, unused functions, missing prototypes and
missing include files.
2006-01-28 20:17:48 +00:00
Chris Want
c8b48e70e6 Final merge of HEAD (bf-blender) into the orange branch.
Here are my notes on things to look out for as potential problem
spots:

source/blender/blenkernel/intern/displist.c:
+ is initfastshade(void) supposed to be empty? I had
to make it empty to get the merged tree to compile.

source/blender/python/api2_2x/Armature.c:
+ went with the version that had Armature_getLayers()

source/blender/python/api2_2x/Object.c
+ went with the version of Object_getPose() from bf-blender.
(#ifdef 0-ed the other version)

source/blender/python/api2_2x/Pose.[ch]
+ had problems linking due to no Pose_Init() ... copied these
two files straight from bf-blender.

source/blender/src/drawview.c:
+ view3d_panel_properties() had things shifted a few things shifted
a few pixels, otherwise, things were painless

source/blender/src/splash.jpg.c:
+ went with bf-blender version (orange is dead)

source/gameengine:
+ went with bf-blender version -- does not compile due to IMB_rect* stuff,
Ton should look into this.
2006-01-28 16:35:18 +00:00
no-author
e8afec9f9a This commit was manufactured by cvs2svn to create branch 'orange'. 2006-01-26 22:47:31 +00:00
Chris Want
164a7929ce Not a show stopper, and does not add or remove any functionality
... but a pythoner forgot to do a cast, causing an error with an
anally retentive compiler.
2006-01-24 17:23:01 +00:00
042d612df2 Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:

Render:
- Full cleanup of render code, removing *all* globals and bad level calls
  all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
  default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
  tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.

Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
  easier use of movies in Blender

PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
  code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)

3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
  (pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
  rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!

Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
  with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
  done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
  window. (yes, output nodes to render-result, and to files, is on the list!)

The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
  system should be built from scratch. I can't really understand this code...
  I expect it is not much needed, especially with advanced layer/passes
  control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
  recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
  effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
  to check first the option to render to a Image window, so Blender can become
  a true single-window application. :)
  For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again

OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
Ken Hughes
6e1db67cc0 ===Python API===
Bugfix: Hos discovered that recent fixes broke mesh.verts.extend(); it now
accepts three floats again.  Sorry....
2006-01-21 06:21:03 +00:00
Ken Hughes
0fcfd5bd40 ===Python API===
Bugfix #3660:  NMesh.getVertexInfluences() was broken following the changes
to the armature system.  Tron Thomas (kudos) came up with a fix that seems
to perform identically to the old method.  I'm also adding it to the Mesh
module for compatibility.
2006-01-19 15:48:56 +00:00
Ken Hughes
a8cb639f0b ==Python API==
Bugfix #3761: Attempting to set mesh.faceUV=1 when a mesh has no faces
now throws a RuntimeError exception.  Previous behavior was to do nothing.
2006-01-18 06:15:17 +00:00
cf5570c45b ==python api==
epyDoc for insertShapeKey
2006-01-17 16:32:09 +00:00
75aa68e821 ==python api==
clarification of Blender.Mesh.Mode() tip
2006-01-17 09:20:37 +00:00
427b132ad0 ==python api==
patch from jean-michel soler (jms) - .insertShapeKey()

Python API, a function to insert a shape key in an object . It works on Mesh, Lattice curve ans surface .
Example of use :

import Blender
OBJECT=Blender.Object.GetSelected()[0]
OBJECT.insertShapeKey()

a docstring to follow soon
2006-01-17 06:47:48 +00:00