Commit Graph

1352 Commits

Author SHA1 Message Date
1190b45263 Adding a new way of dealing with library data in blender, Blender.Base
Has a number of advantages over the existing method, described here.
http://wiki.blender.org/index.php/User:Ideasman42#Post_2.43_Update_to_the_Python_API

Only missing functionality is the ability to add new data through Base.scenes.new('name'), where scenes could be meshes, texts etc.

Other changes are minor,
Scene.h, bad var name in definition.
Text.c/h - moved the Python Struct into the header file, added BPy_Text_Check()
2007-02-22 14:37:30 +00:00
Stephen Swaney
5cc58ba8fe Doh! prototype for Armature_CreatePyObject() was already added.
I plead incompetence.  more coffee, please.
2007-02-22 10:46:02 +00:00
Stephen Swaney
5cb958f305 broken build!
FILE_MAX undefied in util.c
implicit method def Armature_CreatePyObject() in Armature.
2007-02-22 10:20:27 +00:00
fbd8a16933 Compiling bugfix:
Campbell's change from yesterday (renaming PyArmature_FromArmature
to Armature_CreatePyObject) broke compiling here - was missing change to
this file.
2007-02-22 10:00:47 +00:00
a2ce2600d9 renamed posebone.ik to hasIK, removed unused code, made the function name of Armatue's py object from Blender object consistant with others. 2007-02-21 23:14:01 +00:00
943007abbf text.makeCurrent() works now, it depends on the script menu type, so will only work from some menu's. 2007-02-21 13:00:12 +00:00
f71458b904 adding menu slot Armature
adding menu slot ScriptTemplate
new script scripttemplate_mesh_edit is a template for an editmesh script.

The function Text makeCurrent() is a dummy until I can get it working when the script runs from a menu.
2007-02-21 11:17:17 +00:00
6831c04533 * added MTex uvlayer string attribute
* added Pose attribute "ik" True/False depending on the pose bones IK.
  limitX/Y/Z bool's
  lockX/Y/ZRot bool's
  stiffX/Y/Z floats
  stretch (ikstretch) float
2007-02-20 23:23:54 +00:00
64231d19bf Object parentType could never match Object.ParentTypes.LATTICE, Id incorrectly assigned the lattice constant. Armature and Lattice parent types are the same. documented this. 2007-02-20 09:23:13 +00:00
78a12943b1 Bugfix #6049
Calling a pop_space_text(st) crashed in Python code that was drawing areas.
Why this was there? No idea... remainder of NaN days. Ugly, bad, go away!
2007-02-15 11:26:19 +00:00
Ken Hughes
4aa33f5633 Python API
----------
Bugfix for problem reported with ac3d importer; Object_getData() wasn't
setting the real object type before calling EXPP_add_obdata().
2007-02-14 17:40:31 +00:00
b90a0ce285 Made multires and shape keys throw errors when adding if the other existed (so both can never coexist) documented this too. 2007-02-11 02:21:26 +00:00
c7c0e7bf80 ==== bugfix ====
- fix for #5955
- fixing too short pathnames causing memory overwriting when
  starting blender from a path with a very long name.
2007-02-09 18:27:20 +00:00
b3e6a6a9c1 animation_trajectory - was printing deprecation warnings. cleaned up some of its code too.
Mesh - removing UV or Color layers didnt check if the active object was in vpaint of uv mode, removing the last layer could crash blender - now switch to object mode if its the last layer like the UI.
2007-02-07 07:43:10 +00:00
a185758581 added missing reference in the docs for the edgesplit modifier
Extended the add object tooltip to note that new objects cant be on a visible layer.
2007-02-06 07:11:44 +00:00
b67a6ac5b7 = python bugfix=
flareseed and haloseed minimums were off by one, thanks Carsten for the fix
2007-02-06 00:20:33 +00:00
Stephen Swaney
41911da258 Bugfix #5918 GE Crash when press Esc
Modifier.c had ref count problems from TypeDict being added twice
to module.

Congratulations due to Tom Musgrove (LetterRip) for chasing this down.
2007-02-05 05:09:15 +00:00
26eef30c1e updated epy doc reference to 2.43, fix broken link. 2007-01-31 21:30:27 +00:00
Stephen Swaney
f5a48dfd31 Bugfix for #5000
Setup for Armature weak ref list was missing from some places where
we execute py code.  This confused the interpreter and gave random
attribute/tuple parse errors.
Changed name of weak ref list to "__arm_weakrefs" to avoid name
collision with user variables.
2007-01-31 03:12:26 +00:00
9cf602b949 3ds_export - enabled textures as an option since it works with some appliactions (only way to get textured models from blender to google sketchup)
3ds_import - added option to disable recursive image searching (could be slow somtimes)
export_obj - when making group/object names only use both object and mesh name when they differ.
weightpaint_clean, weightpaint_grow_shrink - minor updates.
Render.py - own error in epydocs.
2007-01-31 01:18:51 +00:00
3ab085a5b6 =Python bugfix=
Armature code had missing NULL pointer check that crashed when used in pydrivers.
2007-01-30 22:38:43 +00:00
Ken Hughes
f0e18a8b94 Python API
----------
Fix typo in Constraint API examples
2007-01-30 17:55:39 +00:00
dcc834f3fa updated render settings to support recent changes.
options like saveBuffers are available from Python and threads can be set from 1 to 8
usefull for python based renderfarms.
2007-01-30 03:02:58 +00:00
Stephen Swaney
d89a7388ea Bugfix for #5846 erratic error with in "ob.getData(mesh=1)"
It looks like the changes for bug
  #5000 Changin EditMode in Script wrecks memory
break the python interpreter.

Since this is critical, I have #ifdef'ed those out of
BPY_interface.c and Window.c.  Did not touch Armature.c.
The ifdefs are tagged with /* bug 5000 */

This means bug #5000 is back in play.  Interesting to note
that according to #5846, only scripts run from the script menu
and not via Alt-P were broken.
2007-01-29 01:27:07 +00:00
5943ad8f65 update to the md2 importer.
* moved from NMesh to Mesh
* made newstyle classes (use less memory)
* optimized mesh creation
* Animation now imports and plays (Bugfix for 5834)
+ other small tweaks

Added mesh.key - was missing from docs
2007-01-28 12:33:04 +00:00
907d19b93d made Mesh.Get('foo') raise an error when foo dosnt exist rather then returning None (to work like other modules)
also update Metaball.Get() to be less messy - still functions the same.
2007-01-28 04:58:22 +00:00
8f075f9518 minor tweaks from testing scripts. correction in my last commit. 2007-01-27 04:58:09 +00:00
853785782e Updated docs not to use Object.New() in examples, use scn.objects.*
Bugfix from ZanQdo, MOT files wouldent load in lightwave. also made some minor improvements.
2007-01-27 02:15:14 +00:00
d79669ad9e added edge split access to modifiers API
Also renamed Type to Types to match with the rest of the API. Type is still there but removed from docs.
2007-01-26 15:43:11 +00:00
Ken Hughes
148a74988e Python API
----------
Replacing locally-declared function prototype with included one.
2007-01-25 19:31:39 +00:00
6446c23447 Needed an extra header to find offsetof
Kent
2007-01-25 16:21:11 +00:00
ea8189389c Bug fix for:
[ #5000 ] Changin EditMode in Script wrecks memory

Armatures create weakreferences in __main__.__dict__.  When Window.Editmode is called, the weaklist it iterated over and armatures are updated.
2007-01-25 15:19:28 +00:00
Nathan Letwory
35bb9dff1d * remove warning about add_only_object 2007-01-24 04:44:49 +00:00
702defaa81 use add_only_object to add a new object with defailts. 2007-01-23 16:51:14 +00:00
Ken Hughes
42ef81d88b Python API
----------
Bugfix #3233: throw an IOError exception in Library.Open() if the specified
library file cannot be opened.

This had been changed to a "feature request" but should have been a bug, even
though it worked as documented (or rather, the documentation described what
the function did).
2007-01-22 22:59:34 +00:00
Ken Hughes
f80ff6c7da Python API
----------
Fix minor typo in Mesh API docs.
2007-01-22 16:13:01 +00:00
a03c8ba8a0 creating new objects from
ob = scn.objects.new(arm_data)
didnt work.

Also added docs to Pose - that make an armature, add an action and add pose keyframes
2007-01-22 11:26:55 +00:00
33e8d4b3e2 Made scene.currentFrame(val) call scene_update_for_newframe if the scene being modified was G.scene
Before this, calling scene.currentFrame(val) would not work to update object displists where Blender.Set('curframe', val) did work.
Also used less python BuildValue calls.
2007-01-22 03:59:52 +00:00
25372193f5 Looking to see why SGI wont compile this.
fixed some getsetattr args that wernt cast to (void *)
this is now consistant with Object.c - but Im not sure why SGI has trouble.
2007-01-22 00:04:13 +00:00
38375784df [ #4786 ] if space in the Application path name, system() doesn't work on some platforms
commited temporary fix: executable name is quoted for all platforms except Windows now,
nicely wrapped in #ifdefs. Will be doing nice wrapper function BLI_system for system calls in blenlib
after release.
Please test on all platforms!
2007-01-20 08:01:56 +00:00
6b67ba00bb IDProp, removed reference to self - other EPYDocs dont use this and its confusing.
Differentiated properties and "game properties" in Object docs.

Also the new NLA/Pose key docs were added in the property class instead of Object, tsk tsk.
2007-01-18 18:09:28 +00:00
4d44475543 Bugfix #5732
Python scripts: when setting a layer for an object, the function assumed
the object had to be in the current scene, thus ignoring layers for other
objects.

Now the object->lay value is set always.
2007-01-17 21:07:10 +00:00
b9039611c6 bugfix for 5572, BLI_makestringcode was being used to join 2 paths, but adding c:\ to the start of a non root dir. it wold be nice to have a BLI_join_path for this to avoid #ifdef WIN32's in the main code and to check for existing slashes 2007-01-17 15:04:37 +00:00
b630794be7 bugfix for 5572, BLI_makestringcode was being used to join 2 paths, but adding c:\ to the start of a non root dir. it wold be nice to have a BLI_join_path for this to avoid #ifdef WIN32's in the main code and to check for existing shashes 2007-01-17 15:01:56 +00:00
c967679bb8 == Armature Joining Bugfixes ==
Since 2.40 (and a few pre-releases around then), armature joining has not
worked correctly. Constraints and other attributes of bones in posemode
(IK DOF limits, transform locks, custom shapes, etc.) were not preserved
on the armature(s) that were joined onto the last selected armature. This
was a serious production problem, as it meant that you could not easily
add pre-made rig segments and merge them with the rest of your rigs without
having to redo all the constraints. After a few attempts, I've finally
managed to fix this.

All constraints and parenting relationships get name corrections for the post-
merge armatures. Action channels in actions don't really get any corrections
yet unless the action is being used by an Action Constraint.

Python-API people: beware, I may have broken something in this commit.
2007-01-16 09:18:01 +00:00
Stephen Swaney
fbfe27761a fix for warning: implicit declaration of function 'id_us_plus'. tsk. 2007-01-16 05:20:39 +00:00
Stephen Swaney
d917157f59 bugfix: #5581 Joining python created curves crashes Blender
Curve_appendNurb() was incorrectly appending Nurb to Curve
rather than using BLI_addtail().
2007-01-16 04:08:12 +00:00
048bb84f82 Cleanup of pose insert methods for Armature objects, as planned in the post to bf-python.
Two sensible methods left in: armatureobject.insertPoseKey and .insertCurrentPoseKey,
but still left unofficial i.e. not published in the api doc yet, because of additional
error checking is still needed and more testing too. But at least is now in better shape to
work on to be published in a later release.
2007-01-15 16:00:36 +00:00
7a19fe19f6 =ID Property Script update and api bugfix=
Turned out somehow I managed to miss adding the proper
type refs in Blender.Types for IDGroupType and IDArrayType,
which made the script not work.  So, I've got it all fixed now.
Or at least hopefully :)
2007-01-15 07:54:08 +00:00
Ken Hughes
8ea091568f Python API
----------
Changed Mesh Primitives doc example to use scn.objects.new().
2007-01-13 18:37:14 +00:00