- Scripts config editor was not working due to changes in module BPyRegistry.py.
- AC3D exporter: a little cleanup + small improvements like sorting objects.
added a constant dict "Blender.Object.IpoKeyTypes" to pass to ob.insertIpoKey(keytype), previously these constants were not documented well and added to Blender.Object directly
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.
* Export edges instead of faces
* dont export fgon edges
* export all objects (not just active) including Dupli Objects and static particles
* use PupBlock rather then a gui that uses a window.
* write the file normaly rather then redirecting stdout
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.
Also added an option to remove all white vcol layers. this is usefull when loading old blend files where every mesh has vcolor's even if they are all white (because of how texface used to be stored before vcol layers)
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.
replaced with a help_bpy_api.py, that opens a web browser at the Blender Python API page.
Camera.c - added a veriable .angle to camera, same as .lens but adjusts the camera angle in degrees (like the D button)
export_fbx.py - use the the camera angle property.
object_cookie_cutter.py - use PointInTriangle2D rather then own function.
buttons_shading.c - added OB: and tooltip to object world mapping.
interface_draw.c - (Simple theme) text buttons looked exactly like normal buttons (more confusing when they had no text), made the text and ID buttons render inset so you can tell them apart.
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.
export_fbx - blender cameras now work properly (converted lens angle, rotate to the right axis)
Made meshes, armatures and cameras use the same namespace.
DirectX8Exporter - update from David Teviotdale, change names of exported objects so some DX readers dont fail
xsi_export - Null materials made the export fail (python error).
This may not be a correct solution since material indicies could be messed up now. I have no way of reading these files.
buttons_editing.c - negative camera lense was possible with (Deg) button enabled
export_cal3d.c - minor changes
object_batch_name_edit.py - check for data and object libdata before renaming.
Mostly problems with vertex index, and splitting off new verts.
removing truespace_export.py truespace_import.py, (decieded by letterrip and myself)
both truespace and blender have enough formats in common that we dont need to support this format thats spesific to truespace and not used for 3d data interchange.
* added support for blenders materials
* added support for multiple materials per mesh
* added Multiple UV's per vert, as well as using multiple images (Blenders TEXFace)
removed radiosity support.
According to the author -
"The Radiosity file format is my own personal format. I created it to
learn how meshes and vertex colors were stored. See IO-Examples.zip, the
example *.radio files on my web page."
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.
Bone.c - return an empty list rather then None for bone.children bone.getAllChildren()
Draw.c - per button callbacks are now have (event, value) passed
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.
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
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.
* Support for fgons (dont make wire on fgon edges)
* added new wire type (extra sharp)
* also fixed editnmesh problem
* mistake in previous commit log (mesh_solidifym meant mesh_wire)
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.
* 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
*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
console - Ctrl+Tab was autocomplete but that conflicted with weightpaint. Use Ctrl+Enter and Shift+Enter for newline without executing.
also made console.py import bpy.
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...
import OBJ dosnt raise a Py Error when no image is given for a material
export FBX works much better, tested 179 models and dosnt crash on any now. tested import export with large scene, 375,000 tri's.
Mesh.py doc note about UV coords,,
editmesh_add minor typo
curve - added curve_type() to return the curve type
BPyModule & gen_library - works with text3d now, can also make new text3d through bpy.curves.new
Added Draw.Label() so scripts can draw can using freetype.
widgetwizard - use Draw.Label
* 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
[ #6450 ] Save UV Layout: Overflow Error
This error was caused by excentric UV faces being exported (I'm talking things like 3443870976 as UV coord, in a range of 0..1).
Edges with extreme coordinates are now ignored (for TGA only, they are exported to SVG) and a warning is printed (at most once) to the console.
I chose to still export them to SVG because they don't affect the running time of the script while exporting them to TGA is just insanely long.
packing 2400 rectanges is about 38x faster.
Use the C implimentation in uvcalc_lightmap and uvcalc_smart_project
Blender.c - filename returning None raises errors with existing scripts, just return "" so string functions on the filename dont raise an error.
bvh_import.py
- delaying IPO updates gives a significant speedup.
- IPO's use linear interpolation now
- Added an option to loop the animation.
- fix for own bug, importing to empties never worked.
- Updated ac3d exporter to use first material found in the mesh for loose edges (lines) color. Inspired by bug report from Stewart Andreason. Also made a few updates to very old parts of the code, got rid of two "try/except".
- Updated ac3d importer to be even more forgiving to bad data. Also added option to turn transparency on in the 3D View for models using materials with alpha < 1.0. Added optional support for ac3d's subdiv tag, works by adding a subsurf modifier to the imported model(s) that have this tag, so they appear as intended.
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.
object_sel2dupgroup, creates a dupliGroup from a set of selected objects, using the active as the transformation for the dupli-ob. The advantage of using thus script is that objects have this transformation removed.
* Redraw the 3d view only when importing. (Not all windows)
* Select all verts at once rather then 1 by 1.
* dont print polygons when importing. (Would be better to use the progress bar for this)
- A few imported .ac models had wrong uv's, as reported by Melchior Franz (thanks). Well known reason: the vertex indices order in new faces is rearranged if the 3rd or 4th vindex is equal to 0, because of how Blender checks for tris/quads.
Fixing with that old trick of adding a vertex at index 0 in mesh.verts, adding 1 to each face vertex index, then removing the extra vertex after the model has been imported.
- Minor updates to the ac3d importer to support bad files (with more data than reported, this time) and properly handle texture paths with win separators ('\') and spaces. Again, thanks Melchior Franz for testing and reporting.
- Fixing bug #5950 reported by Stewart Andreason (thanks):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=5950&group_id=9
Importing .ac models created Blender objects with user count equal to 2, instead of 1 (so they couldn't be deleted in Blender), because the script kept a second reference to each created Blender object and so Python didn't deallocate things properly at the end of the script.
Now these extra references are deleted in the script, preventing the problem. But this is surely something to fix in the API itself.
* 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.
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.
- Making the ac3d importer discard bad faces in the imported model (faces that reference a vertex index more than once). Thanks Melchior Franz for reporting this one, too.
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.
disp_paint.py - Displacement modifier and sculpt mode replace.
uv_paint.py - making can be used to write colors to an image.
animation_empties2armature.py - Was made when BVH importer could not import direct to armature, Resulting animation has visible errors, errors have been known about for a long time and not fixed.
knife.py - Old slow code, No Multi-UV's, We now have a knife tool that has snap!
If anyone wants to maintain these scripts and have them added back in, mail the bf-python ML.
Scripts that are removed can be found here.
http://projects.blender.org/viewcvs/viewcvs.cgi/blender/release/scripts/Attic/?cvsroot=bf-blender
- Fixed a few bugs in the ac3d importer, found by Melchior Franz (thanks!). Also automatically turning on ztransp for materials with alpha < 1.0 and then also transp shadows for all imported materials.
* 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
basic workings are the same but its generaly more efficient.
The main problem was it could get the data from every object across all scenes!
This means that on framechange, every mesh would be copied into an NMesh just to see the type was a camera.
* fixed errors with Null materials
* faster material exporting
* export with modifiers applied
* faces with invalid material indicies work now (maybe should be delt with in the Py API)
* removed per vert col code since all colors are pre face now.
removed image support, Blender could import but not 3dsmax :/ - even managed to get 3dsdump to report a blender and max file to have the same data but max still dosnt like.
Also made some changes
- fly mode keys have changed and added snap key
- using "i=list.index(val)" is slow, use "for i,val in enumerate(list)" instead.
- dont use "i in range(start, end)" - silly to make a list when you can do "min < val < max"
JMS, please update from this version.
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 :)
Misc updates to the ac3d importer and exporter:
- use Mesh instead of NMesh;
- properly export modified data and materials from either ob or obdata (thanks for mesh.getFromObject :) );
- option to export local rot and loc info;
- better import / export of hierarchies;
- + tiny updates here and there to support old or weird .ac files.
tex2uvbaker is now redundant with buitin functionality so thank you for maintaining this script in the past. nendo is a marginal format and the scripts are not maintained so removing
* use mesh.transform instead of a python matrix multiplication function.
* use the image filename rather then ID name for the URL
* use the scenes world rather then the first world for getting world data.
* mesh.verts.index(face.vert[i]) is extreamly slow!, use face.vert[i].index instead. also got rid of a face loop in a face loop that didnt do anything.
Still need to move this script to Mesh from NMesh
update by the script author - may have killed some changes cambo did to the previous version but the layout of the script is too significantly different to merge them.
Window.c was calling undo_push_mesh, even for non mesh objects, exiting editmode would crash for any non mesh object (found with the armature symmetry script), bad juju.
big speedup to loop detection
added support for skinning open loops (could be improved, dosnt work that well when open loops have different vert counts)
speedup elsewhere with LC's
the tip isnt used for a label anyway. added comments explaining whats going on. only effects clever numbuts internaly.
type fixes for weightpaint_envelope_assign.py
-Added missing access to Node win theme (thanks Mickaël Le-bihan for pointing) and also options group and group_active.
-Added Node space to Window.Types dict.
-Tiny update to the save theme script version numbers (keeping 2.42 for now to avoid popups, but should change to 2.43 right before release).
BTW: Happy New Year everyone :).
* added .iconTheme variable
* bugfix. drawType was not being saved because Py_BuildValue and __members__ was missing an "s"
* added Blender.Get('icondir')
scn.objects.selected = [] # deselect all
scn.objects.selected = scn.objects # select all
scn.objects.context = [ob1, ob2...]
Added epydoc examples and updates importer scripts to use this de-select-all method.
continual script stuff, minor stuff..
fix for bad return in group.
Added back group.objects.append/remove but print deprectaed warning. also some epydoc changes.
weightpaint_envelope_assign - can update active vgroup only
weightpaint_normalize - fixups
BKE_plugin_types - made the max length 32 ratehr then 16 so you can fill the text space in pupBlock
- moved to the weightpaint menu
- Use a group for envelope objects, no special names.
- Can use non mesh data for envalopes (anything that can be converted into a mesh - metaballs, text, surface)
- Dosnt rely on applying loc/size/rot for it to work properly
- Uses a good point-inside-mesh method (optimized with mesh and face bounding checks)
- uses Mesh instead of NMesh
todo, only update active vgroup
Stupid typo in script, you couldn't go into
a subgroup if it was the first property in
the list.
Also, name collision code needed a little work.
This could result in overwriting properties
with the New button, which should instead
work as the rest of blender and add .XXX
to the name.
Added a test gui script for ID Properties. To use,
just select ID Property Browser from the help menu.
You can browse, create and edit ID Properties
for several library block types. Should be
fairly straightforward to use.
This is a test gui script; once an actual ID property
gui is implemented in blender it will be removed. It
is *not* going to be in the release, obviously, so once
the real gui is implemented this script will be removed.
Also, this being a testing non-release script it seems to me
to be okay to add it without all the proper review stuff. If
not, I can remove it.
I believe a test script is really, really needed to properly
test/review id properties, so I feel this is worth it.
- Dont allow it to apply the matrix twice to a linked-dupe. (Same as Apply Loc/Size/Rot)
- Make sure that the source object is active, not just the first selected object.
- Use Mesh instead of NMesh.
- use mesh.transform(mat) rather then vert by vert vec*mat
Other scripts had pupBlock changes for better layout.
Click project, a nifty 3 click way to use a face to set a projection aurientation and then 2 more clicks for the U and V scales
with realtime updating as you move the mouse
should be faster then using view project all the time because you dont have to line the view up with the faces.
off_export - minor changes
uv_archimap - cleanup. slightly slower but less duplicate code
uv_from_adjacent - nothing
BPY_menus - renamed py slot UvCalculation to UVCalculation to be consistant
Changed...
me = NMesh.GetRaw(ob.data.name)
To
me = NMesh.GetRaw(ob.getData(name_only=1))
The line above converts the entire mesh to a python thick wrapper just to get its name, then only to that that same mesh again??
A lot of older scripts did this but theres no reason to do it.
in most (all?) cases..
me = ob.data - should be ok, but theres a subtle difference and I dont want to break anything.
xfig_export, xsi_export and videoscape_export need error checking too.
Minor changes to radiosity_export, updated to work with the new API (vertexColors MTFace)
obdatacopier - was getting the selection but not using it. made it ignore some read only properties.
BPyMesh - minor change: use face iterator rather then making a tuple()
console.py - if the scriptdir didnt exist it would do an error, now just ignore and dont try to do the console_autoexec.py stuff
doc_browser.py - If you typed in an invalid module it would give an error and exit, now have a message instead.
added restrictDraw/Select/Render to objects in python
updated group and scene docs for last commit
made 3ds import use new scn.objects rather then Object.New() - (removed import as instance for now)
fixes off import error from this report http://blenderartists.org/forum/showthread.php?t=84182
curve2vecs(ob, WORLDSPACE= True):
'''
Takes a curve object and returns a list of vec lists (polylines)
one list per curve
This is usefull as a way to get a polyline per curve
so as not to have to deal with the spline types directly
'''
There was an integer division error in md2_export.py,
where values were getting clamped to either 0 or 1.
Fixed it by putting the appropriate vars in float().
Reported by deltab on IRC.
Python 2.4+ supports large list processing with generators, but
Python 2.3 will break if you use that syntax. Until we depend on
the newer versions, I have commented out the generator syntax and
only use the list-comprehension type instead.
* SVG export support (thanks to Jarod's patch in the tracker)
* Faster tga export (from Jarod's patch too)
* Fixes from the review thread and the wiki:
** No longer adds the extension (tga or svg) if already there
** Adds the object name in between the filename and extension (and not after the extension if it was already present)
** Renamed options here and there.
The VRML97 exporter was rounding a lot of stuff to three decimal points.
This is silly, since the spec says single-precision floats are used for
most things, which gives about 7 decimal points precision.
Added a new script - 'Dump All Images to Path'
This script copies all the images used by 1 blend to a spesified path and references the new images from Blender
Usefull for moving projects between computers or when you reference many images. naming collisions and multiple images using the same image path are delt with properly only creating new image names when needed.
Blender images will reference the newly copied files - So be mindfull when you save your blend after running the script.
Notes, images with the path "Untitled will be ignored"
Image path collisions are managed by enumerating the path names so images will never be overwritten at the target path.
an error in Scene.c - scn.Layers disallowd all layer bits to be set.
made image_billboard.py rotate all images to be verticle for more efficient packing, added the option not to pack resulting images into 1.