Commit Graph

180 Commits

Author SHA1 Message Date
Maxime Curioni
eda7cdc81d soc-2008-mxcurioni: merged changes to revision 15441 2008-07-05 13:30:48 +00:00
Campbell Barton
484ac5ea1a [#14405] New python Script - Bake Constraints
AGAIN PLEAST USE TABS, lost quite some time with mixed tab/space adjustments alone.
Other then that, patch is very useful ;)

---Text from patch submission --- 
Using a slightly revised BPy_Armature, this script takes any non-armature object type and creates an Action that keys
the object location (by default, for every frame). If it is an Armature, it goes into each bone and keys the locrot
of the bone. You can now edit the armature, but the motions still rotate the bones. This enables the next step, re-targeting,
which changes bone lengths to fit a mesh. High-level, we are working toward:

1. import mocap (bvh or c3d)
2. bake to make an action library (using this script)
3. re-target and use the actions to drive/deform any character mesh (theeth)
2008-06-22 22:46:02 +00:00
Maxime Curioni
59df5a23b4 soc-2008-mxcurioni: merged changes to revision 14967 2008-05-25 18:28:52 +00:00
Remigiusz Fiedler
61fa5f9126 remove module dxfImportObjects.py. It is obsolete since 2.43, then all functions integrated in the main dxf-importer code 2008-05-22 08:29:54 +00:00
Campbell Barton
58e6861aea fix for [#11542] "Add -> Mesh -> Torus" adds corrupt mesh
previous fix only worked in object mode
2008-05-16 13:05:36 +00:00
Campbell Barton
8f6eda7e5d need to recalc normals for meshes added in object mode 2008-05-09 12:37:26 +00:00
Remigiusz Fiedler
3faf127707 DXF-importer prepared for ProE files, which are outside of DXF-specification. 2008-05-08 15:58:00 +00:00
Campbell Barton
4255f3c7ab made python add mesh module respect blenders user settings for editmode and view align.
added sys.cleanpath() was a patch in the tracker but blender's internal path cleaning is now more general and can be used from 
python.
2008-05-06 17:54:55 +00:00
Campbell Barton
34c1699e7e fix for [#9649] svg2obj.py needs a patch,
slight change to the fix suggested, the svg imported was assuming that
"fill:" and "#" being in a string meant there was "fill:#", but the # could be used for other properties.
2008-04-28 19:13:38 +00:00
Campbell Barton
235f793f28 Made aspx/y into floats so we can render precise regions (for apricot terrain baking) 2008-04-09 15:46:26 +00:00
Martin Poirier
79ed118fd4 Potential fix for [#8113] Blender.Registry segfault when no permission to write
This converts exceptions in Warning in selected points of the registry module.

While I couldn't reproduce the segfault ( I received the Py error as expected), this isn't a bad idea anyway, since the BPy C counterpart was discarding the error anyway, making it a warning is a bit more inline with its meaning.

The exception is not preventable nor fixable from a script's point of view, so better to silence it and print a warning to the console instead.
2008-04-07 20:56:45 +00:00
Campbell Barton
8960f53676 some fixes for python baking function
needed to add a small value to the baking distance for it to include faces of that distance (maybe should make this happen from the user interface too)
2008-03-29 14:50:05 +00:00
Campbell Barton
e7651c53c3 baking normals could crash in rare cases because the intersection data wasn't copied when the lambda was bigger then the previous or initialized.
python baking script had a simple error.
2008-03-27 16:28:21 +00:00
Campbell Barton
7287bea1d9 wasnt returning the images in python bake api 2008-03-13 18:34:23 +00:00
Stephen Swaney
4247984df3 French text was breaking python interpreters.
Add character encoding to file like this:
# -*- coding: latin-1 -*-

Thanks to eago for the bug report.
2008-03-13 03:32:23 +00:00
Campbell Barton
8b63333f8c image render to billboard was rotating UV's incorrectly, also make use of texface alpha rather then making many materials with textures. 2008-03-12 10:00:52 +00:00
Campbell Barton
0e935e397b * Displacement baking wasnt working with negative distances.
* Added Normalize option for diplacement so everything in the 'Dist' range is mapped 0-1
* Increased the maximum Dist and Bias to1000.0 (was 10.0)
* Added python utility function in BPyRender.py - bakeToPlane(...), to automate heightmap, normalmap generation for Crystalspace.
2008-02-22 14:27:46 +00:00
Campbell Barton
746522a0ad Standalone reads a list of scene, start frame, end frame from blend files without having to load them in blender.
Scenes must be tagged to render, (old render daemon button) but selecting scenes in the data browser (shoft+f4) sets this also.

Using this script to generate jobs for the renderfarm much faster then loading blender.
2008-01-30 16:16:38 +00:00
Campbell Barton
a038363124 mesh_wire.py - gave an error with no faces,
wizard_curve2tree.py - didnt work with no bevel object
Curve.py - ext1, ext2 didnt reference the interface names.
2007-11-22 16:30:14 +00:00
Kent Mein
4e2143f639 This commit fixes up a bunch of svn properties to hopefully make things a little nicer for everyone.
Patch provied by gsrb3d

bug tracker #7061

Kent
2007-08-28 10:07:08 +00:00
Campbell Barton
bba7506598 own dumb mistake missing a return 2007-08-24 11:57:26 +00:00
Campbell Barton
0d5f195ba7 left a print in and didnt account for no vgroups BPyMesh also had an error when meshWeight2List was called on a mesh with no vgroups 2007-08-12 01:38:12 +00:00
Campbell Barton
dfa6e0b8d6 bugfix's for 6917 and 6913 - Both were because I forgot to check all other selected meshes for faceUV's
Also made image_auto_layout.py use blenders internal boxpacking rather then the slower python one.
2007-07-09 17:33:38 +00:00
Campbell Barton
7df1d78a99 renaming to match JMS's names 2007-05-21 16:01:49 +00:00
Campbell Barton
ae5c665abe updated rvk1_torvk2 from JMS and added GPL headers 2007-05-21 15:26:50 +00:00
Campbell Barton
22da7d6829 updates from JMS. scripts assumed new data would be last in the list. 2007-05-06 20:03:18 +00:00
Campbell Barton
98d797f156 Update to svg import from JMS
0.5.9d : - 2007/4/5
              -  when a svg file containts several curves they can be imported in
                 separate object.
              -  managment of paths' name when paths are imported as separate curves.
              -  a menu was added to select between separate or joined curves
              -  management of colors

     0.5.9e : - 2007/4/7
              - corrected a scale problem that only appears when one uses beveldepth
              - in separate curve option, name is also given to the curve data
              - added the list of svg's color names (147) and modified the color's method
                to work with.

     0.5.9h : - 2007/5/2
              - script was updated with the modifs by cambo
              - removed all debug statements
              - correction of a zero division error in the calc_arc function.
2007-05-03 00:06:07 +00:00
Campbell Barton
c24aa10561 Made it so blender has an active render layer for Uv and Vertex color mesh layers.
This means changing the active UV/VCol layers wont change what renders.
needed to adjust the minor version so old files will copy the active layer to the render-uv/vcol layer.

boxpack2d.py - redoen in C now, dont need python version.
2007-05-02 00:01:23 +00:00
Campbell Barton
99135b0674 dont use tface hide or select anymore, since maintaining 2 sets of hide/select data for each face is annoying.
using mface->flag for both.

Also found that the cdDM_drawMappedFaces and cdDM_drawFacesTex_common could get normals mixed up when rendering hidden faces. because hidden/invisible faces used continue without advancing to the next normal.
2007-04-29 13:39:46 +00:00
Campbell Barton
3bd0d2e227 Draw.c - error setting the callback button values when using UIBlock (was not offset)
BPyMesh.py - own dumb error, was using dir as an arg (which is a py keyword)

object_drop.py - new script, the first to use UIBlock, it drops objects into terrain, either a group or the active object. on teh Z axis or view axis.
2007-04-27 23:54:30 +00:00
Campbell Barton
d2fb4afb7c BPyArmature - has a function that gets final pose locations/rotations. the data it returns can be swaped with IPO curve/locations, so exporters can use this to export bones with IK's/constraints.
export_cal3d.py - option to export with baked animation from posebones, added popup UI with some options, fixed object scaling, get the meshes armature if its not selected.
2007-04-25 05:13:03 +00:00
Campbell Barton
60af30ec8a lightwave_import - tested with many more new files, fixed a rare error (probably bad file)
export_fbx - export lamps, (point/spot/sun), Mesh edges, Dupli'Objects and static particles as edges. bug fix in material export and better reuse of some standard text chunks.
fly mode, added acceleration on mouse-wheel and +/- so flicking the mousewheel has more effect and dosnt feel so slugish.
BPySys.py - cleanName, dumb mistake.
2007-04-21 11:23:45 +00:00
Campbell Barton
c7b1e5c11d export_fbx.py - support scene start/end frames, fpx, mist settings, better default camera writing.
BPyObject.py - function for getting an objects armature, look at both parent and modifier.
editmesh_add.c and BPyAddMesh.py - check for multires
filesel.c, Append/Link had a bug where files linked in, didnt have the LIB_APPEND_TAG unset, and appending these into a new blend file would link instead.
BKE_library.h, library.c - utility functions for flagging listbases flag_all_listbases_ids and and flag_listbase_ids
2007-04-20 18:48:30 +00:00
Campbell Barton
60b3268c32 adding a python function for cleaning strings (for filenames and export names) BPySys.py - used fotr obj and fbx export.
view.c - missed one smoothview/camera.
Brigg's hide object patch didnt change the object selection flag, other minor changes also.
2007-04-19 20:58:09 +00:00
Campbell Barton
3e1a5ce7a2 PyAPI.
moved bpy into bpy.data and bpy will be eventually replace the root level 'Blender' module.
currently we have bpy.library bpy.config and bpy.data
2007-04-18 14:40:01 +00:00
Campbell Barton
063605b279 Python API registry SetKey() had a limit of 60 that would keep counting up every time you used SetKey() until it would always be 60 and nothing would save.
removing limits for now, no other areas of blenders API have limits like this (even if those limits make sense in most cases)
we may add warnings later.

also use faster dict syntax too.
2007-04-17 14:23:19 +00:00
Campbell Barton
bd142ac2f4 Anti - NMesh commit.
unweld - warn that this tool destroys MultiUV/Col's (because of NMesh)
API_intro and NMesh - note that NMesh is maintained but deprecated.
2007-04-09 07:03:26 +00:00
Campbell Barton
244c925421 Adding a 'solid wire' script.
http://members.optusnet.com.au/cjbarton/teapot.jpg
2007-04-08 09:35:05 +00:00
Campbell Barton
76420c2fec appending libdata no longer breaks all external references.
Existing data is flagged with LIB_APPEND_TAG and all_local only has an option to only operate on un-flagged data.

If you append an object thats linked to a material alredy linked in your scene, the material will not be made local.
So at worst youll need to make local some of the datablocks.

This is fairly simple and though my tests show it to work, do some tests on your own libraries before assuming its problem free.


scripttemplate_mesh_edit wasnt updated with PyAPI changes and moved some functions into generic places.
2007-04-07 17:35:47 +00:00
Campbell Barton
985fb03478 * Changed mesh so all new data is selected (fits in with blender's UI and other areas of Python API), this could break existing scripts that count on new data being unselected (unlikely)
* Added a keyword argument to mesh.transform() - "selected_only" so you can transform the selected verts. this wont break existing scripts.
* Documented these changes in epydocs.
* used these functions in BPyAddMesh
2007-04-05 07:45:11 +00:00
Campbell Barton
b2084d49ff This script 2 functions for use with the add mesh slot in the menu.
*add_mesh_simple* - add a mesh from vert/edge/face data.
It deals with setting the mesh rotation and location based on the cursor and view rotation, vertex and object selection etc.
so adding a python object works just like other blenders internal add functions, in editmode and object mode.

*write_mesh_script* - writes a Py script containing the active mesh, this can be put in the user scripts dir so users can define their own objects in the addd menu.

Currently neither of these are accessed by the user however heres a script that uses add_mesh_simple and was written with write_mesh_script.
http://members.optusnet.com.au/cjbarton/add_mesh_teapot.py
2007-04-02 18:51:17 +00:00
Campbell Barton
71843bf103 Updating JMS's SVG Importer script from 0.5.6 to 0.5.9b
Changelog

0.5.7 : - Wash down of some handle problems.

0.5.8 : - 2007/3/9
        Wash down of the last exec and correction of a
        problem with the curve's first beztriple handle
        which was not recorded at first time .
       - Added some units managements
       - Correction of the  rotate matrix
       - Correction of the  skew  matrix
       - change in the wash_DATA function suggested by cambo
       - added __slot__ in class Bez, ITEM and CURVE suggested by cambo
       - remove unused properties in class ITEM and CURVE

0.5.9 : - 2007/3/28
        -  many improvements for faster and clearer code suggested by cambo and martin.
           replacement of "%s" statement by str function.
        -  correction of an error in the scale transform management
        -  correction in the management of the stack transformation that rise an error
           under python 2.5 but curiously not with  python 2.4

.5.9a : - 2007/3/29
        -  Again a lot of minors corrections
        -  Backward to 0.5.8 of the function that manages float numbers exported
           by the  Adobe Illustrator's SVG.  After a lot of tests it seems that this oldest
           version is also faster too .
        -  correction (bad) on handle management with V and H commands.
.5.9b : - 2007/3/31
       -  one or two minor corrections :
          now the new object curve is added in the current layer.
          short modif in the scale menu...
2007-03-31 11:19:18 +00:00
Campbell Barton
30fb777971 py api
bpy.*libBlickSeq*.new() - name is now an optiona arg.
moved some more scripts to bpy.* api.
2007-03-27 14:49:37 +00:00
Campbell Barton
2b8bed8598 py api
* stopped bpy from importing automaticaly as decieded in the meeting.
* removed Blender.Main, since we agree it will be called bpy, renamed files also.
* updated epydocs from this and last commit.
* updated scripts to use bpy.*, and bugfix's for widgetwizard
2007-03-26 19:44:44 +00:00
Campbell Barton
aa33c4fad7 mesh_skin - syntax error stopped ths script from working.
svg2obj.py update from JMS
 - Exec was removed from the collect_ATTRIBUTS function .
 - Other uses was evaluated.
2007-03-05 13:07:31 +00:00
Campbell Barton
9759a373d7 Updating own scripts to use Blender.Main, remove Base files. 2007-02-22 15:48:26 +00:00
Campbell Barton
bc15d06cfe * own error, importer would never load images.
* moved from NMesh to Mesh
* added more error checking.
* tested with 1660 lightwave models
* faster dictionary usage.

BPyImage - disallowed recursive searching of '/' or a windows drive letter.
2007-02-08 00:27:01 +00:00
Campbell Barton
35e96bc991 added messages to scripts, stopping them from modifying multires meshes.
object_cookie_cutter - can now also use curves to cut holes in a mesh.
2007-02-06 11:16:49 +00:00
Campbell Barton
5817876307 fixed nieve use of type()..
type(foo) == type(list()) can be done as
type(foo) == list:
2007-02-01 05:27:49 +00:00
Campbell Barton
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