Commit Graph

29 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
9723e3ef39 miscellaneous edits from python development branch merged back into trunk 2007-12-07 09:51:02 +00:00
f02a746f56 ==Python API==
added .smooth setting to CurNurb's

so you can do....
for curNurb in Curve.Get('foo'): curNurb.smooth = True
2007-11-10 11:05:44 +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
f231bd0d57 Many long standing memory leaks fixed in the BPY api.
Data from Armature.c and logic.c still leaks.

Mostly todo with PyList_Append adding a refcount and the bpython api not decrefing.

Also added some features needed to fix a bug in mesh_clean.py (ob.pinShape and ob.activeShape)
2007-05-25 16:43:25 +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
Ken Hughes
b68ecc9f8b Python API
----------
Converted CurNurb module to tp_getseters.
Added patch #5761 to provide read access to NURB knot vectors.
2007-03-06 18:55:35 +00:00
Ken Hughes
59f8507a87 Python API
----------
Added CurNurb.recalc() method.  I thought I had commited this before as part
of a bugfix but obviously not.  It allows control point handles be recalculated
after changing  a curve's bezTriples.
2007-01-12 22:40:30 +00:00
50edac630b removed blender2cal3d.py, this is the second time where nobody has been able to maintain this script to fix minor bugs, aparently the cal3d/soya guys maintain their own scripts anyhow.
Adding switchDirection() for curNurbs. simple function and double checked to make sure its ok.
2007-01-04 10:18:37 +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
Ken Hughes
95e94b4630 Make curnurb.flagU and curnurb.flagV range check their inputs, plus make
the documentation correctly describe how the attributes and methods work.
2005-12-01 04:50:04 +00:00
Ken Hughes
0ea46ec202 - Bugfix #3194: calling curve.appendNurb() with any number of float param
other than 4 or 5 caused segfault (thanks for catching, Cam)
2005-10-16 16:39:11 +00:00
290ae52d81 Memory management flag to behave better, as hinted by Ken Hughes.
Still not good, i.e. getting these when quitting: Error Totblock: 4
new bpytriple len: 60 0x8889bdc ... 'cause nothing frees them..

Changed the loop that parsed input args to PyArg_ParseTuple to have
support for passing ints from Python too as the floats that are the
coordinates. Didn't find PyInt_AsFloat and figured that this is an ok
way anyhow.

Changed the default handle mode from AUTO to ALIGN, which is the same
as in UI and more useful at least for me.

Little sanifying in CurNurb (this was done with Ton).
2005-09-14 10:53:51 +00:00
c192b80b17 Big commit, had to rework lots of selection stuff so that things
worked properly with modifiers. Needs more testing I am sure.
No, honestly, I wasn't just cleaning for the hell of it, it
was *necessary* (I would never do such a thing). Selection should
work completely with cage options of modifiers now.

 - added DerivedMesh foreach functions to iterate over mapped
   verts/edges/face centers. These replaced some of the drawing
   functions and are more general anyway. Special edge drawing
   functions remain for performance reasons.
 - removed EditFace xs, ys fields
 - added general functions to iterate over screen coordinates of
   mesh/curve/lattice objects
 - removed all calc_*verts* functions that were used for storing
   screen coordinates in objects. they were recalc'd on the fly
   for most situations anyway, so now we just always do that.
   calc_*verts_ext was one of those calls that did dirty things
   deep down in the callstack (changing curarea and poking at
   matrices)
 - rewrote all vertex level selection routines (circle, lasso, bbox)
   and closest vertex routines (rightmouse select) to use the new
   system. This cleaned up the selection code a lot and the structure
   of selection is much easier to see now. This is good for future
   work on allowing modifiers to completely override the selection
   system. It also points out some discrepancies in the way selection
   is handled that might be nice to resolve (mesh vertex selection has
   fancy stuff to try to help with selecting overlapping, but it only
   works w/o bbuf select, and curves/lattices don't have at all).
 - had to remove ton's code to move Manipulator to cage location, this
   is not reliable (can come up with a different method if requested)
 - as it happens BezTriple.s and BPoint.s are basically available to
   be removed, just need to rewrite editipo code that still does
   background calc of screen coordinates
 - MVert.{xs,ys} are still around because they are abused in some places
   for other info (not sure if this is safe actually, since they are
   short's and the mvert limit went up).

And did I mention this commit is comes out to -305 lines? Well it does.
2005-08-09 08:12:36 +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
2a640f03cd My patch to BPy's curve module (applied by stivs) had a small mem leak. Fixing now. 2005-06-17 04:40:07 +00:00
Stephen Swaney
769fa6252d Patch from Martin Poirier.
Misc bpy Curve fixes and updates, includes bugs #1687 and #2637
2005-06-13 19:15:02 +00:00
Stephen Swaney
55cf304e99 bugfix: #2254 Curve.appendPoint() gives segfault in PySequence_Check().
Argument tuple not built correctly for CurNurb_appendPointToNurb().
2005-05-12 05:45:13 +00:00
Stephen Swaney
63388ad246 Fix previous fix by moving some code around to try to please everyone.
or at least their compilers.  let me know what breaks.
2005-04-22 16:10:46 +00:00
Stephen Swaney
9fb241c930 fix compiler error with gcc 4.0. mismatched declarations. 2005-04-22 02:27:16 +00:00
Stephen Swaney
f919cf75f1 More Curve Module features: access to the attributes flagU and flagV
in a  CurNurb object.
Contributed by Gergely Erdelyi (dyce).
2005-04-17 14:37:40 +00:00
34977b8937 BPython:
- applied Campbell Barton's patch for access to Oops location and selection of materials, mesh data and objects, slightly modified. Thanks, Campbell;
- got rid of warnings in many files, hopefully not introducing any other during the process.  Mostly this was done: 1) new EXPP_incr_ret_True/False functions were added and used instead of "Py_INCREF(Py_True/False); return Py_True/False;".  Currently at least the functions use the fact that PyTrue/False == 1/0 and use 1 and 0 to avoid the warnings. 2) Filling of certain types structs got 0's added for all not defined data and methods.  This is surely Python version specific, since these structs can change size and content at each major version number Python update.
2005-02-09 15:53:35 +00:00
Stephen Swaney
df1acca4c5 New methods: Curve.isCyclic(), CurNurb.isCyclic() for checking if curve is cyclic ( closed ). Both methods are boolean.
Patch contributed by Toni Alatalo.  Thanks.
2005-01-13 03:42:53 +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
7ed803f6a8 some code cleanup. minor bug fixage: don't try to free null ptrs.
accidentally ran CurNurb.c thru indent utility  Doh!
2004-07-29 12:00:34 +00:00
Stephen Swaney
bce2c02fdd New Curve method Curve.appendPoint( numcurve, newpoint ) to add
points to a Curve.

New supporting module CurNurb to provide access to the curves in a Curve
and their associated points.

Curve module now supports Python iterator and sequence protocols.
This allows typical python programming idioms using 'for' statement
and the [] operator.

# example 1
for curve in a_curve:
	for point in curve:
		print point

#example 2

curnurb = a_curve[0]
curnurb.append( [1,1,1,1] )

Still under construction.  Epydoc will follow.
2004-07-21 21:01:15 +00:00