Commit Graph

50 Commits

Author SHA1 Message Date
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
0a2b8b1308 A user submitted a BVH file that took a long time to import (I didnt end up finishing since it was so slow)
this is mainly because adding pose keyframes recalculates every handle so importing became increasingly slow.

added a 'fast' argument to insertkey that python api's insertPoseKey can make use of since it alredy accepts a 'fast' option.

The ~4450 frame, 31 bone BVH imports in ~108sec now

Seperated editmode switch statement in space.c's event handling,
if editmode is disabled, or the images is a render or composite, UV editing operations are ignored.
In previous releases it has given an annoying warning if selecting or scaling is attempted when out of UV/Face mode.
2007-09-18 06:41:29 +00:00
52f551678b == Action Editor - Copy and Paste Tools ==
Now it is possible to do Copy+Paste in the Action Editor, like in the IPO Editor. There are two new buttons in the Action Editor header for this, using the familiar icons.

* To copy...
Select the keyframes you wish to copy, and the channels that they occur in (except for ShapeKey mode, where it is not possible to select channels). Click copy button.
* To paste... 
Place the current frame where you want the first of the keyframes from the buffer is to be pasted. Select all channels you wish the keyframes to be pasted into. Click paste button. 

Currently, keyframes are only pasted into 'compatible' curves (i.e.  LocX keyframes can only go to LocX, and so on). This may change after user feedback, if this is found to be too restrictive.

== Code Changes ==
I've made a few changes which allow this code to be nicer. 
* renamed insert_vert_ipo to insert_vert_icu, as that represents its actual purpose better (and changed all occurrences I could find)
* created a new function, insert_bezt_icu, which does the actual inserting of provided BezTriple data to a given IpoCurve 
* recoded insert_vert_icu to use this new function, and also the IPO-Editor keyframe pasting (i.e.  pasting in Editmode)
2007-09-17 11:41:12 +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
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
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
Ken Hughes
5e77460a28 Python API
----------
Fix memleak caused by missing Py_DECREFs (good catch, Campbell).
2007-04-05 04:34:41 +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
156ac69aad driverExpression - strcpy on wrong type (my bad) fixed.
added .sel bool for Ipo curves.
2007-01-13 04:53:41 +00:00
2a9fab55ba PyAPI driverExpression:
added "ipocurve.driver = 2" to set the curve to use driver python expressions.
added ipocurve.driverExpression - the string to run.
2006-12-25 10:44:28 +00:00
dda63a9dde added comparison function to many python types so you can do == and =! 2006-10-06 16:48:28 +00:00
9334048b60 Bugfix #4906
Python API bug: Importing ipo curves did a memcpy() on a 1 item too large
data block. I wonder how IpoCurve_append() would have ever worked...
2006-08-20 11:02:31 +00:00
Ken Hughes
4aa28f13f4 ===Python API===
New Ipo and IpoCurve API.  Ipo and IpoCurve objects support the [] operator,
for accessing the curves of a particular Ipo and for accessing the value
of an IpoCurve at a specific time.  Both modules were also "tp_getset"-ified.
Also, code for an alternative method (Antont wanted this) of accessing curves
via Ipo attributes is included for now, for people to try and see if it's
actually preferable to the Ipo [] operator.

These are all new additions; nothing was intentionally removed from the API.
If you find the something in the existing API has changed, let me know.
2006-04-21 20:27:52 +00:00
Ken Hughes
f73f226ed7 -- Bugfix #3617; addBezier() was not initializing all the attributes for
a the beztriple, so things like the hidden and handle select states were
   set to random values.  Added a beztriple.hide attribute so that the
   hide attribute can be set/cleared from the BPy API.
2005-12-17 04:57:48 +00:00
Ken Hughes
569f9de63c Added some extra parameter checking in Ipo driver code. 2005-12-06 05:42:23 +00:00
Ken Hughes
b2e32f5bd1 -- Bugfix #3458: keyblock.getData() was getting vertex data from keys
incorrectly, including wrapping curve data as BezTriples.  Needed to
   make a change to beztriple module so we could more easily create a
   "thick" BezTriple object similar to Blender.BezTriple.New().

   The change to BezTriple.h pointed out some dead code in the Ipocurve
   module that could be removed.
2005-11-28 05:03:26 +00:00
Ken Hughes
9deec11e59 -- fix small problem with Ipocurve.recalc(); recomputed handles but did not
re-sort control points (also added reminder in BezTriple doc that script
   users need to call recalc themselves)
2005-11-17 19:10:40 +00:00
cce655b5e7 - warning fixes
* various warnings the python api is putting out
2005-11-07 19:34:44 +00:00
94915fde5f Python API Additions
New
Ipo Drivers access in IpoCurve
key.getChannelIpo(index) returns the ipocurve of a given shape index

Docs included for usage :)
2005-10-26 16:30:50 +00:00
4bd9775936 Stupid me! Committed in wrong console with wrong dir... here's the rest of
all files for the Ipo/Action/NLA makeover...
2005-10-10 18:05:30 +00:00
96253376e7 Recommitted this commit yesterday, was apparently done in the wrong
directory... so the slowdown was still evident!

Maintenance commit;

  - *Giant* speedup for LMB frame-dragging in ipo/action/nla windows. It was
    calling a routine that accessed frontbuffer drawing.... a very old patch
    for SGIs even! :)
  - Prepared code for support of unlimited Shape keys
  - Curve objects didnt draw correct for selection-outline option
2005-09-27 21:52:04 +00:00
Chris Want
5dd3bfdb18 MEM_freeN() and MEM_mallocN() should not have been redeclared in this
file.
2005-08-29 02:47:55 +00:00
e60291d39c Header file clean up and warning fixes
- Mostly this cleans up the #includes and header files in the python project.
- Warning fixes are mostly casting issues and misc fixes. General warning clean up.
- #include Python.h MUST come as the first include to avoid the POSIX redefine warning in the unix makefiles
- fno-strict-aliasing flag added to makefile to fix a unavoidable type punning warning in types.c
2005-07-18 03:50:37 +00:00
Stephen Swaney
bb84abaaa8 updates to doc strings in code and doc from Ken Hughes.
add alias .recalc() for IpoCurve.Recalc() to match api standard.
2005-05-24 15:14:32 +00:00
Stephen Swaney
a15fbce1de fix overlooked compiler warning. sheesh.
update contributor names.
2005-04-24 19:27:14 +00:00
Stephen Swaney
626e930c47 New IPO methods.
Ipo.delCurve( curve_name ) deletes named curve from IPO.
Ipocurve.delBezier( int ) deletes point at index from Ipocurve.

Contributed by Ken Hughes (khughes).  Thanks!
2005-04-24 19:03:39 +00:00
6d9c02be4c Scripts:
- Fixes by Jean-Michel Soler: mod_ai2obj.py, mod_svg2obj.py;
- Fixes by Campbell Barton: obj_import.py;
- Small fix to mod_meshtools.py (fixes bug #1605: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1605&group_id=9);
- Updates by Jean-Baptiste (Jiba) to his blender2cal3d.py;
- Updates to all his import / export scripts (added doc data) by Anthony D'Agostino;
- Update to off_import: support for uv data, by Arne Schmitz.

BPython:
- Removed Object.get and .getSelected (deprecated long ago, we use .Get and .GetSelected) -- fixes #1861: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1861&group_id=9
- Applied patch by Michael Reimpell: quat.c - fix for wrong initialization with newQuaternionObject; Mathutils documentation improvements.
- Stani reported a wrong return msg in IpoCurve.Get (that is unimplemented).

Thanks to all coders mentioned above!
2004-11-30 02:27:46 +00:00
Stephen Swaney
0fdc0ce297 Another step in the Big Bpy Cleanup.
- move static declarations and data definitions out of headers.
  the BGL module still need cleaning.

- move declarations out of modules.h and into appropriate .h files.
  modules.h still exists as a container for the few modules that
  need to #include almost everything.

- all files now have a $Id tag and have been formatted by indent

there are no changes to executable code.

pre-commit versions are tagged with bpy-cleanup-pre-20041007
for the sake of paranoia.
2004-10-07 19:25:40 +00:00
Stephen Swaney
a509b8adc9 Another round in the Great BPy Cleanup:
Run everything thru indent to cleanup spaces vs tabs.
Clean up some of the comments by hand.
BGL.c was not touched due to all that macro wackyness.

There are no functional changes to the code.
Pre-indent versions of source are tagged with
tag bpy-cleanup-20040925 , just in case.
2004-09-25 20:30:40 +00:00
Stephen Swaney
a2ea84903e One small part of the Great Bpy Code Cleanup.
Add cvs $Id tag to files
2004-09-18 18:47:03 +00:00
73f1da749b Nathan's huge ipo patch.
- now more than 31 channels possible for ipos
- added lotsa new channels all over
- Texture block has ipo now too
- recoded getname_ei functions

(Will ask nathan to give release log info when he's back!)
2004-07-26 21:44:55 +00:00
Stephen Swaney
d97e3e5527 patch for bug #1347. IpoCurve.evaluate() missing/disappeared.
Contributed by Philip Wainwright.
2004-06-06 19:42:12 +00:00
Stephen Swaney
2609a608bb fix for #1123 by Roland Hess (harkyman)
Testing has not convinced me this is a complete solution to the
Ipo Curve handle issue, but it does seem to make things
better for curves created via python.  We will probably need to revisit
this, especially if we expose the curve handles in the bpy interface.
2004-04-29 04:50:28 +00:00
ce9a3d0b46 Bug fix provided by Anders Nilssen.
TotIpo was never meant to be exposed in the Ipocurve object. It's a variable
to store the number of IPOs.
2004-04-02 20:26:58 +00:00
7cc4d7525d Python API fixes. Provided by Anders Nilsson (breakin)
* Typo fixed in IpoCurve_getInterpolation.
  'Bonstant' was used, while 'Constant' is what we want.
* IpoCurve.getName now also returns curve names for action-IPOs.

* Update to the Object module:
  Added obj.getTimeOffset() and obj.setTimeOffset() methods

Anders Nilsson has promissed me to provide some updated Python API docs :)
2004-04-02 18:38:38 +00:00
Stephen Swaney
f3feb77918 General housekeeping and cleanup. Move static declarations and
data definitions from .h files into corresponding .c files.
Blame zr for this since he's the one who pointed out that our
bpy headers were a mish-mash of stuff that belonged in the .c files!

In a nutshell, the headers should contain the declarations necessary
to use a module or class.  The implementation files ( .c in this case )
should contain statements that allocate storage ( definitions in
the C sense ) and executable code.

When used at file scope, the keyword 'static' means "don't tell
anyone else about this".  Since headers describe a public
interface, static declarations and definitions belong in the
implementation files.

The net result of all this is that after stuff has moved out
into the .c files, the .h files are empty or mostly empty.
I didn't delete them since there seem to be some public
declarations and because I did not want to cause too much
disruption at one time. Time enough for that later!
2004-03-29 08:16:18 +00:00
Stephen Swaney
811e144c6f Fix for bug #1014
In IpoCurve.addBezier() method, set handles of newly added point to type Auto.

Fix provided by Roland Hess (harkyman).
2004-03-05 08:20:18 +00:00
de21846e69 BPython:
- Fixed small typo in doc file Object.py, reported by user Bill.
- Fixed bug #803:

Bug #803's Summary: print, type() or BezTriple broken

Trying to print type(BezTriple) was crashing Blender because
that type wasn't being initialized to PyType_Type. The other
problem is that the getName method for ipocurves only works for
object ipos.  A warning was added for when users try to use it
with other blocktypes,  we'll later update ipo related stuff in
bpython to work for all types.
2004-01-03 03:50:58 +00:00
0468a787d7 Bug fixes (sigh...) 2003-12-18 21:45:15 +00:00
5a5ab62336 Fixed two minor warnings 2003-11-23 21:25:55 +00:00
976164a338 modified the print function 2003-10-28 23:25:25 +00:00
05187adc2f removed unuseful function calls in BezTriple.[ch]
general cleaning of Ipocurve.c Ipocurve.h Ipo.h Ipo.c
updated doc
2003-08-05 10:19:28 +00:00
ee5461b06a reincorporation in the cvs of modifications which had been lost. 2003-07-21 00:08:30 +00:00
Chris Want
85f961bdb4 Some manipulations of the keyword 'static' to get
blender to compile
2003-07-20 23:06:59 +00:00
2ccf7ffb84 * removed the #include .c statements and replaced them with corresponding .h
files.
* updated the build environment to include the needed .c files.
* Updated the modules.h file to expose the necessary functions to other
  modules.
2003-07-20 18:06:06 +00:00
4856071402 Exppython:
Still compilation problems, wrong type returned in a function.
2003-07-19 21:04:33 +00:00
d51107b804 Nex modules added to keep a minimal compatibility with 227 api 2003-07-19 08:29:55 +00:00