Commit Graph

1573 Commits

Author SHA1 Message Date
a164d91d42 missing include and added a warning to UIBlock 2007-07-27 09:30:54 +00:00
3031f1f2bd =Draw Module Fixed=
This commit fixes the Draw module.  All buttons/widgets created via the Draw
module in a SpaceScript area are now inserted into a global list attached to
the SpaceScript data.  This list is cleared before each draw, when freeing
the space, and when the area is switched to another space.c

This is necessary to prevent Blender's internal UI code from getting invalid
pointers to python data.  In addition, it allows storing widget tooltips
inside the python Button objects, which solves that little bit of stupidity.

Note that this reverts the previous weaklist solution.  In fact, I had to go
over each previous commit by Campbell after this code originally branched
before the weaklist commit and re-add each commit.  So if anything is
missing, just tell me, or feel free to re-add it.
2007-07-27 06:14:25 +00:00
670cf8c5a9 fix from 2.44 for adding new curves. 2007-07-26 14:32:32 +00:00
534ba14d2b == PyAPI - Constraints Space Conversion Access ==
Now, for the constraints that support Constraint Space Conversion, those settings can now be set from the PyAPI too.
2007-07-26 12:15:55 +00:00
29660ac778 PyAPI Simple Bugfix:
This fixes a bug reported in IRC. getParentBoneName() was returning a string (most likely from an old bone-parent that got removed), even when the parent wasn't an Armature.
2007-07-26 06:11:58 +00:00
17533e534f removing unneeded checks 2007-07-25 04:45:20 +00:00
89792eb7ee fixed some bugs in Draw.c
* incorrect args to Draw.Create() would crash blender because it wasnt deallocating the value properly.
* deallocation of an uninitialized button could also try and free uninitialized memory if the type happened to be a STRING.
* removed the unused tooltip pointer from teh Draw.h's Button struct.
2007-07-21 23:24:08 +00:00
74ca178199 == Transformation Constraint ==
This commit adds a new constraint to Blender: the Transformation Constraint. This constraint gives you more freedom to choose how transforms are copied from one object/bone to another object/bone. 

You can assign the Loc/Rot/Scale channels of a source to the Loc/Rot/Scale channels of a destination, specifying the range of motion (per axis) from the source to consider, and the range of motion (per axis) that will be applied to the destination. Also, for each destination axis, you can choose which of the source axes to copy from. 

A similar constraint was coded by Jason Blary (snark), as Patch #4991. This constraint is basically rewritten from scratch, although there are some elements of the original patch which may be borrowed in future.

Various notes:
* PyAPI access has been coded. 
* Space conversion is also enabled for this constraint.
* Also the useless get_constraint_col function has been removed
* Doing a rotation copy with a ratio that is not 1:1 doesn't always work correctly yet (like for the Copy Rotation constraint).
2007-07-21 07:26:15 +00:00
c924fc542b fix for Curve appendNurb 2007-07-21 03:54:20 +00:00
f8a1397b67 removing 2 getset duplicates 2007-07-20 02:23:55 +00:00
ff6c3dd0ae == Constraints Work - PyAPI ==
A few tweaks to documentation and implementation of PyAPI access for constraints following Constraints recode. Just doing a little bit of cleanup.
2007-07-17 12:03:17 +00:00
8f6c18dc17 was missing colorband from the flags in the epy docs 2007-07-15 19:31:45 +00:00
af55d208f4 == Constraints System ==
After just over a week of coding, I've finished doing a major refactor/cleanup of the constraints code. In the process, quite a few old kludges and ugly hacks have been removed. Also, some new features which will greatly benefit riggers have been implemented.

=== What's New ===
* The long-awaited ``ChildOf Constraint'':
This allows you to animate parent influences, and choose which transformation channels the parent affects the child on (i.e. no translation/rotation/scaling). It should be noted that disabling some combinations may not totally work as expected. Also, the 'Set Inverse' and 'Clear Inverse' buttons at the bottom of this constraint's panel set/clear the inverse correction for the parent's effects. Use these to make the owner not stick/be glued to the parent.
* Constraint/Target Evaluation Spaces:
In some constraints, there are now 1-2 combo boxes at the bottom of their panel, which allows you to pick which `co-ordinate space' they are evaluated in. This is much more flexible than the old 'local' options for bones only were.
* Action Constraint - Loc/Rot/Size Inputs
The Action Constraint can finally use the target's location/rotation/scaling transforms as input, to control the owner of the constraint. This should work much more reliably than it used to. The target evaluation should now also be more accurate due to the new space conversion stuff.
* Transform - No longer in Crazy Space (TM)
Transforming objects/bones with constraints applied should no longer occur in Crazy Space. They are now correctly inverse-corrected. This also applies to old-style object tracking.

=== General Code Changes ===
* solve_constraints is now in constraints.c. I've removed the old `blend consecutive constraints of same type' junk, which made the code more complex than it needed to be.
* evaluate_constraint is now only passed the constraint, and two matrices. A few unused variables have been removed from here.
* A tempolary struct, bConstraintOb, is now passed to solve_constraints instead of relying on an ugly, static workobject in some cases. This works much better.
* Made the formatting of constraint code consistent
* There's a version patch for older files so that constraint settings are correctly converted to the new system. This is currently done for MajorVersion <= 244, and SubVersion < 3. I've bumped up the subversion to 3 for this purpose. However, with the imminent 2.45 release, this may need to be adjusted accordingly.
* LocEulSizeToMat4 and LocQuatSizeToMat4 now work in the order Size, Rot, Location. I've also added a few other math functions.
* Mat4BlendMat4 is now in arithb. I've modified it's method slightly, to use other arithb functions, instead of its crazy blending scheme. 
* Moved some of the RigidBodyJoint constraint's code out of blenkernel, and into src. It shouldn't be setting its target in its data initialisation function based + accessing scene stuff where it was doing so.

=== Future Work ===
* Geometry to act as targets for constraints. A space has been reserved for this already. 
* Tidy up UI buttons of constraints
2007-07-15 03:35:37 +00:00
Ken Hughes
0f692d999a Python API
----------
Remove unused variable declaration which caused gcc warnings.
2007-07-13 14:38:44 +00:00
4f240c7982 Revision: 11257 from 2.44 stable 2007-07-12 20:49:36 +00:00
Ken Hughes
229e4674f8 Python API
----------

Fix uninitialized variable in MEdge_setSel.
2007-07-12 15:32:15 +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
052a15d4b4 Was a missing -DWITH_FFMPEG here so I added it.
Kent
2007-07-09 16:17:33 +00:00
Ken Hughes
1d1faacdff Bug #6924: Add WITH_FFMPEG compilation switch when WITH_BF_FFMPEG is true for
scons.  

Can someone verify that other build systems are also including this?
2007-07-09 16:03:26 +00:00
Ken Hughes
db2cc09913 Correct comments in example for Python Ipo module doc.
Remove redundant description of yafrayGIMethod in Python Render module doc.
2007-07-07 17:33:46 +00:00
cff039bc58 Ipo doc correction thanks to kempoller 2007-07-05 11:28:11 +00:00
727216f9e1 was missing a decref and leaking ram when building the static particle list 2007-07-03 16:04:41 +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
f6090e814a reversing unintentional changes. 2007-06-30 00:18:10 +00:00
7b05c1023d mixed decloration, own Lattice typo's 2007-06-30 00:00:04 +00:00
d31999767b same as 2.44 stable - missing NULL checks. 2007-06-29 13:46:15 +00:00
e192e7e024 remove unneeded checks from the python API 2007-06-29 08:59:26 +00:00
684869fd74 patch from harkyman to make it possible to extend images to span more frames in the sequencer.
Link includes example script
https://projects.blender.org/tracker/?func=detail&aid=6893&group_id=9&atid=127
2007-06-29 05:33:43 +00:00
85bbc4c3e2 Mesh.c - added missing error checking for vert ranges and that verts are valid.
Mesh.c - removed unneeded checks for creating ints.
Text3d.c - own error - setting the 3d text didnt work, 1 liner fix.
2007-06-28 13:46:42 +00:00
296758ff01 PyAPI - incorrect docstrings for colorbands 2007-06-23 12:39:22 +00:00
62ac9cba9c (Python Object API)
setting object layers didnt break once the base of an object was found.
DAG update and countall ran even when the object wasnt in the scene.
2007-06-22 13:38:15 +00:00
3d4a9c1c43 Silenced a few compiler warnings 2007-06-21 11:24:42 +00:00
8975e34439 == PyConstraints - 2 Fixes ==
* Error print for getSettings was lacking a newline
* When adding a PyConstraint using Ctrl-Alt-C, the script is now queried to find out whether it uses a target.
2007-06-20 09:58:16 +00:00
d6330266f2 changed floating point values in python to display one more decimal place- BMAE script needed to display more (as it worked with 2.41) and it seems resionable to add. 2007-06-19 18:40:17 +00:00
25ec0533a9 == PyConstraints - BPy API Access ==
The BPy Access to PyConstraints. I have not implemented the setter for the PyC-ID-Properties access as I'm not too sure how this should be done.

Also fixed a few typos in the py-docs for the Limit Scale constraint.
2007-06-18 10:39:50 +00:00
01e8789f3f == PyConstraints ==
At last! The ability to code constraints in Python. This opens up many interesting rigging possibilities, as well as making prototyping constraints easier.

* A PyConstraint script must begin with the line 
#BPYCONSTRAINT
* It must also define a doConstraint function, which performs the core actions of the constraint.
* PyConstraints use IDProperties to store custom properties for each PyConstraint instance. The scripter can choose which of these ID-Properties to expose to a user to control the behaviour of the constraint. This must be done using the Draw.PupBlock method.

Credits to Joe Eager (joeedh) for coding the original patch on which this is based. I've made heavy revisions to large parts of the patch.

For more detailed information, and some demo scripts, see the following page:
http://aligorith.googlepages.com/pyconstraints2
2007-06-18 07:41:21 +00:00
770291b9ea missing decref.. win Window.RedrawAll() pointed out by ken 2007-06-16 13:57:39 +00:00
84749aa3ff Python API, more METH_VARARGS to METH_O 2007-06-16 13:17:41 +00:00
Ken Hughes
3e490c0203 Fix a Python memory leak with the armature weakref code. setup_armature_weakrefs() wasnt't deallocating the old list, instead just adding a new one to the dictionary. 2007-06-16 13:01:10 +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
82eab51a29 fix own error - EXPP_getScriptLinks, was returning an unset list. 2007-06-12 05:17:35 +00:00
3db1a55b2d added an optional window ID arg to Window.ViewLayers so you can set the layer for each viewport. 2007-06-08 15:41:31 +00:00
25baab252c yafray settings access from Py API 2007-06-06 19:12:07 +00:00
d01d36ddd6 Another bug found thanks to Coverity.
typo was indexing past last element in an array.

Kent
2007-06-05 15:11:39 +00:00
ba958bea0f -> Custom Properties for Mesh entities
In order to give import/export script authors the ability to add properties
to inidividual faces, vertices and edges in the same manner as they are able
to do with ID structures three new custom data types have been added to blender
for floats, integers and strings.

Things to note:

-Since property Layers are custom data, they are added to all verts, edges 
 or faces at once.
-Only one property layer for each unique property name may exist. In  other 
 words, you cannot have a float layer as well as an integer layer
 both with the same name.
-No user interface for this exists at the moment.

The following methods and attributes have been added to the Blender.Mesh
Python module and it's object types:

->MVert/Edge/FaceSeq:
	addPropertyLayer(name, type)
	removePropertyLayer(name)
	renamePropertyLayer(original name, new name)
	properties(readonly list.)

->MVert/Edge/Face
	getProperty(name)
	setProperty(name, value)

->Mesh module
	PropertyTypes (readonly dictionary)
2007-06-04 19:18:19 +00:00
f368b60baf OBJ smooting groups exported enabled for by default for the first smooth group (should have been disabled)
gen_library.c - Own error, hashing did not decref the tuple it created.
Draw.c - callback also missed a decref
2007-06-04 08:15:27 +00:00
f579a66d7b made change to NMesh decrefing suggested by theeth, and added 2 more missing decrefs in new_NMFace 2007-06-02 02:02:33 +00:00
228e927c04 pointInside wasnt working properly (did work with the examples I was using with many small faces) 2007-06-02 00:31:20 +00:00
f0fe6833db when removing py_build value I removed this but shouldnt have, however theres no need to parse the value in Blender_Redraw since its done in the Window module. 2007-06-01 05:54:16 +00:00
3d6f9b804f buttons editing didnt let lib-obdata to changed once set (thanks for the report broken)
NMesh (error in last commit).
2007-06-01 02:48:36 +00:00