Commit Graph

1004 Commits

Author SHA1 Message Date
Ken Hughes
da33f51b76 ===Python API===
Moved .up() and .down() methods from Modifier API to Modifier sequence
API (also renamed them to moveUp() and moveDown() ).  Locating methods
which modify the "parent" structure in objects didn't seem consistent.
2006-06-14 04:41:31 +00:00
b58998729b Last minute patch from Chris Want
Nkey "Properties Panel" now has Dimension ("Dim") buttons too.
This reads from the actual bounding box value to see the size. Note that
dimensions for animated & deformed objects will change per frame.

(Cleaned up buttons layout for patch, and added support for Curve, Text and
Surface objects)
2006-06-12 20:01:18 +00:00
bad72cec61 New feature! (Well, replacement for the exisiting cumbersome "DispView")
Next to the "DispWindow" there are now two new choices:

- Display render output to Image Editor
- Display render output to Screen-sized Image Editor

Both options won't open a 2nd window anymore, which makes work quite more
smooth even, especially because 'focus' isn't lost. Further it fits in the
'single window UI' paradigm of Blender. Should have been done 10 years ago!

Lastly it might bypass issues with X11... having 2 windows with opengl
context is not always stable in Linux.

This option uses an identical trick as for the Compositor viewer, using an
Image block with a fixed name ("Render Result").

The flow, when invoking a Render, goes as follows:
- first it checks if there's an Image Editor visible displaying the "Render
  Result", if so then it uses that area-window.
   (Use this option for dual-monitor setups for example, a render will always
   go to the same location then)
- else it checks if there's an Image Editor open in general, it then
  assigns that window the "Render Result" Image.
- else: it searches for the largest Area in the screen, and turns that into
  a temporal Image Editor showing render output.

After a render, an ESC will push back the former view, if the Area type has
changed.

Same rules apply for the "Full Screen" option. Here an ESC will always go
back to the regular Screen, and restore Area type if required.

While rendering, the queue for the renderwindow isn't handled yet, so you can
not zoom (nor get full redraws), as for the regular render window.

Existing conflicts:
- in FaceSelect mode, the Image editor enforces to display the face texture
  after rendering again.
- when using an Image window for compositing, you'll lose the Viewer output
  on a render.

Implementation note:
While rendering updates, nothing is drawn in frontbuffer anymore. That's
good news for b0rked OpenGL drivers (and faster). However, for the few
OpenGL cards that don't do a "swap copy" but a "swap exchange" you get
issues... has to be worked on. I'm afraid we have to drop frontbuffer
drawing altogether.

Other fixes:

- Hotkeys NumPad 1, 2, 4, 8 will set zoom levels (was half coded only?)
  Use SHIFT to zoom out (smaller).

- Rendering Tile updates still had draw errors on edges of tiles, in OSA
  only. (Caused by commit 4 days ago)
2006-06-12 14:39:08 +00:00
873e2eaae3 == Python Button Evaluation ==
Users can write any valid Python expression (that evals to an int or float) inside Blender's gui number buttons (preceded by #) and have them evaluated to their actual int or float value.

Button Evaluation has access to the same modules as PyDrivers.

For example:

#1.0*9-2.3
#ob("Camera").LocZ
#1.0/ob("Cube").LocX
#math.sin(math.pi) -- or simply #m.sin(m.pi)
etc
2006-06-12 00:10:00 +00:00
Ken Hughes
962c81208b ===Python API===
Removed recently added Material API methods getRbFriction() and
getRbRestitution().  Erwin had already added attributes rbFriction and
rbRestitution, and current API design goal is to eventualy replace
all getStuff()/setStuff() with attributes.
2006-06-11 15:35:40 +00:00
af3f454cd8 ==Sequencer==
Added patch by Matt Ebb, that enhances the sequencer GUI in several ways:
- It looks a lot better
- Strip colours are themeable.
- The drawing code is more readable.
- The background of the timeline makes now distinguishing the channels easier
  by alternating between different shades of gray.
- Handle-scaling is clamped to min and max-values, making it possible to
  grab strips at large zooming levels more easily.
- Preview-images can be panned by dragging it with the middle mouse button.
  Home-Key resets the position.
- Since some people can't grab the meaning of "C 0", it is renamed to "Chan: 0"
- Effect strips have slightly different colors to distinguish them better.

Additionally:
- fixed an off by one error in Matt's patch
- Scene-rendering saves CFRA to avoid jumping current-scene on scrub
  (might be academic fix, since most likely it only happens if you add
  the sequencer-scene to the timeline... But nevertheless it bugs you on
  testing the GUI ;-)
2006-06-08 19:05:58 +00:00
Ken Hughes
e77112f76b ===Python API===
added len() operator for MFaces, which returns number of MVerts.
2006-06-06 18:14:31 +00:00
721de110b2 Added Py_DECREF since PySequence_GetItem adds a reference where as PyTuple_GetItem borrows it.
Thank ken.
2006-06-06 17:28:39 +00:00
46329e5ab0 made it so a meshes uvsel could be set with any sequence, not just a tuple. 2006-06-06 17:04:00 +00:00
ce202f7540 Clicking on the arrows of a python float button did not change the value :/ - (Click step was zero) Fixed in Draw.c
Added a comment to interface.c on how a1 and a2 are used with float buttons.
Added an example to Draw.py epydocs of a script using a float button.
2006-06-05 01:23:56 +00:00
Ken Hughes
cc28a00d15 ===Python API===
Patch to add 'NoSpecular' to Lamp.Modes constant dict, submitted by Jonathan
Merritt.  Thanks!
2006-06-04 13:16:31 +00:00
6f44fc5c1a Added an option to OBJ import "As Instance" - so people can import all the objs objects into a new scene and have a group instanced in the current scene.
some extra details in Epydocs about how groups work.
2006-06-03 07:46:56 +00:00
a4817c518c added basic docs for rbFriction and rbRestitution 2006-06-02 23:26:41 +00:00
9c2707572a added friction and restitution for the Collada Physics export/import
See http://colladablender.illusoft.com
2006-06-02 20:59:29 +00:00
Ken Hughes
d631abe4fe ===Python API===
Define macros for Py_RETURN_TRUE and Py_RETURN_FALSE (for Python 2.3).  Also
make Py_RETURN_NONE macro a little safer.  Current macro will not work as
expected in situations like below since it expands to two C statements:

	if( !attr )
		Py_RETURN_NONE;
2006-06-02 19:42:09 +00:00
Ken Hughes
1d6e626073 ===Python API===
addProperty() and removeProperty() were each defined twice, because each
could be called with different inputs.  Hence only the second definition
was showing up in the documentation.  Both descriptions are merged now.
2006-06-01 18:27:57 +00:00
bc263b1e84 ==render by parts==
made xparts and yparts consistent in the different places it can be set now python and the buttons are max 64 (was 512 in some python locations) and xparts is max 512 (was max 64 in some python locations), also made the minimum xparts and yparts 1 again.  Ed Halley suggests that we should up the max xparts to 1024 (instead of the current 512) for 'smoother panoramas'
2006-05-31 22:56:22 +00:00
76d2d388f2 added rbRadius and rbHalfExtents members for python / rigid body access. rbRadius is read/write. rbHalfExtents is read-only (it is derived from the mesh) 2006-05-31 20:48:44 +00:00
Ken Hughes
263771fc1c ===Python API===
Removed "#if 0" conditionals of future code which were causing compiler
problems on some platforms.
2006-05-30 13:09:51 +00:00
4a0d703964 saveRenderedImage docs were a bit vague on the output path, took a look at teh source and docs updated. 2006-05-30 08:04:46 +00:00
Ken Hughes
a74472014d ===Python API===
Second pass at sceneRender.c / Scene.Render API clean-up.  Most of the remaining clean-up needs to wait for the API refactor, since the "good" attribute names are already used by methods.
2006-05-29 17:14:05 +00:00
Ken Hughes
d7a21ed220 ===Python API===
First pass at sceneRender.c / Scene.Render API clean-up.  Mainly implementing
attribute via tp_getset, but a few new features too.
2006-05-29 05:01:07 +00:00
Ken Hughes
7b1d6021a4 ===Python API===
Fix typo in Mesh.py epydoc.
2006-05-29 03:52:38 +00:00
c4abb5e7ca a little clean of no used line
.
2006-05-28 17:17:18 +00:00
Ken Hughes
8a8400ff28 ===Python API===
Added to Mesh API me.sel and me.hide, which set/clear the selection and
hidden values for all verts/edges/faces in a mesh.
2006-05-28 00:39:13 +00:00
Ken Hughes
6ebdfbfc85 ===Python API===
Fixed epydoc summaries for mesh.vert.index and mesh.vert.uvco so they say
something useful other than "(MVert Only)".
2006-05-27 23:31:13 +00:00
Ken Hughes
0fab573205 ===Python API===
Bugfix: epydocs for World API incorrectly described settings for getMode(),
setMode() methods.
2006-05-27 16:40:00 +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
2132bbb621 *python fix
- save_rendered_image_cb_real has a popup window embedded in it that prevents automation through python as a result python scripts would get a popup which is ignorned by the script
- modified so python scripts overwrite the image by default
2006-05-25 21:34:00 +00:00
2a6952f386 - bug fix
* C uses braces unlike python :/
2006-05-25 21:13:13 +00:00
1b577b7f0d *python documention & bug fix
- added documentation to Render - saveRenderedImage has an option to save the zbuffer along with the image
(off by default)
- fixed a really annoying runtime error of uninitialized data being passed to a method in pipeline.c during a render
2006-05-25 21:10:28 +00:00
af87c651a5 *python fix
- fixed Render.saveRenderedImage() so now it works once again
(it was broken since render refactor)
2006-05-25 20:47:17 +00:00
Ken Hughes
8fb3373a78 ===Python API===
Ok, now let's try making the Mesh Primitives documentation accessible.
2006-05-25 17:00:17 +00:00
Ken Hughes
48033e00c4 ===Python API===
Fulfilling a very old feature request: a new Mesh Primitives module is
introduced, which gives script writers access to the Blender mesh datablocks
created from the "Add->Mesh" menu.  You can now do this:

  from Blender import *

  me = Mesh.Primitives.UVsphere(10,20,3) # 10 segments, 20 rings, diameter 3
  ob = Object.New('Mesh','mySphere')
  ob.link(me)
  sc = Scene.GetCurrent()
  sc.link(ob)
2006-05-25 16:45:24 +00:00
Stephen Swaney
8aeaf82a67 set locale to POSIX so regex works on platforms that set funny
locales.  needed to make "ls [A-Z]*.py" work properly.
Setting LC_ALL=C may be a better choice than LC_ALL=POSIX.
We shall see.
2006-05-23 02:27:22 +00:00
Ken Hughes
677cf7f133 ===Python API===
Adding support for Action Strips to the API.  A new attribute "actionStrips"
has been added to the Object API to access them.
2006-05-22 14:19:52 +00:00
f849384fcd === Python API ===
Fixes for the bug introduced by my other commit the other day.

Blender.Draw.Create now does proper error checking.
2006-05-22 01:59:28 +00:00
58648f0ed2 python documentation update 2006-05-21 21:04:21 +00:00
023737daa4 *python additions
- added a method Action.getFrameNumbers()
returns the frames at which keyframes were inserted for this action

example usage:
import Blender

myobj = Blender.Object.Get('Armature')
myaction = myobj.getAction()
frames = myaction.getFrameNumbers()

for frame in frames:
	print 'bones at frame %d' % frame
	myobj.evaluatePose(frame)
	pose = myobj.getPose()
	for bone in pose.bones.values():
		print bone.head, bone.tail
2006-05-21 21:02:29 +00:00
Ken Hughes
f3ae4d0f4d ===Python API===
Something to try making import/export script writers happy; Mesh.New() will
not create a new Blender mesh datablock unless the mesh is linked to an
object.
2006-05-20 16:52:11 +00:00
befd007511 === Python API ===
Blender.Draw.ColorPicker

	Enables scripters to use a color picker in there scripts.

See this file for a trivial demo: http://blenderartists.org/~theeth/colorpicker.blend
2006-05-20 15:44:14 +00:00
2cd91acf37 *python addition
- modified the repr for beztriple to print less non-sensical output
- beztriple now prints its handles and control point only
2006-05-19 21:45:27 +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
Chris Want
a0fdbf1c18 Added Blender.Get('rt') so that the pythoner can access the value
of the rt button for setting debugging levels.
2006-05-17 16:42:04 +00:00
Ken Hughes
18b622ca6b ===Python API===
Change code for rigid body access to use attributes instead of methods; also
add documentation to epydoc.
2006-05-17 16:08:54 +00:00
Alexander Ewering
3417378a3a Fix a buffer overflow in Blender.sys.splitext. It was checking for bounds
(although it did this one char too 'friendly'), but still happily copying
the string even if it was too long.

Pythoneerz, please check if this is the correct fix :)
2006-05-17 10:09:20 +00:00
91c5d75c4d added 2 more Rigid Body Python access, should be enough to make a start for Collada 1.4 Physics Import/Export 2006-05-16 23:47:29 +00:00
a88675d0e4 Added first Rigid Body python access (mass). Basic others will follow. This helps Collada 1.4 Import/Export. 2006-05-16 23:17:56 +00:00
bb69543fa9 *added new Object method Object.evaluatePose(frame)
- the new methods will advance an object's pose correctly to any frame

Example:
myobj = Blender.Object.Get('obert')
for x in range(10):
  myobj.evaluatePose(x)
  pose = myobj.getPose()
  print 'Data at Frame %d' % x
  for bone in pose.bones.values():
    print bone.head, bone.tail
    print bone.head, bone.tail
2006-05-16 20:32:21 +00:00
16f4d0c0b6 *documentation update 2006-05-14 18:29:32 +00:00