Once again, I've recoded the constraints system. This time, the goals were:
* To make it more future-proof by 'modernising' the coding style. The long functions filled with switch statements, have given way to function-pointers with smaller functions for specific purposes.
* To make it support constraints which use multiple targets more readily that it did. In the past, it was assumed that constraints could only have at most one target.
As a result, a lot of code has been shuffled around, and modified. Also, the subversion number has been bumped up.
Known issues:
* PyConstraints, which were the main motivation for supporting multiple-targets, are currently broken. There are some bimport() error that keeps causing problems. I've also temporarily removed the doDriver support, although it may return in another form soon.
* Constraints BPy-API is currently has a few features which currently don't work yet
* Outliner currently only displays the names of the constraints instead of the fancy subtarget/target/constraint-name display it used to do. What gets displayed here needs further investigation, as the old way was certainly not that great (and is not compatible with the new system too)
build.
This is bug [#7387] Release files pack the .svn metadata directories
I took a breif look at the scons files and it looks like it has a fix
for them already. It would be great if someone that uses scons could
just do a quick double check and let me know if there are problems with it
and or just fix whatever slips through.
Kent
using the last selected face was almost good enough however when selecting verts and edges the last selected face would become inactive and the space image would flicker about too much.
The active face is used for getting the space image at the moment and keeps scripts that use this flag working also.
This has 2 commands to get and set, so the variable is not accessed directly.
all "UV Calculate" scripts work now
last commit crashed when in solid draw mode, it seems subsurf modifier is ignoring the displayMask since MTFACE is available. just made it do a null check for now.
uvcalc_follow_active_coords.py - should be done inC and put in the snap menu.
Changed how the sticky setting is stored in DNA - (as a char rather then 2 flags).
replaced the UV/FACE icon with another needed for the sticky menu.
removed 2 unused icons.
commented the UV transform panel since it only had 2 buttons in it.
depgraph update calls needed to be added to Ctrl+V/E/F menu's because some commands were crashing.
blender-2.44-linux-glibc2.5-x86_64.tar.bz2
is now:
blender-2.44-linux-glibc2.5-x86_64-py2.5.tar.bz2
I know know the same as scons builds but its cleaner with the Makefiles
this way. I could make it like the scons versions but will be more hackish
Kent
Initial commit of imagebrowser in trunk.
BIG COMMIT!
Main changes:
* completely reworked imasel space
* creation and storage of the preview images for materials, textures, world and lamp
* thumbnails of images and movie files when browsing in the file system
* loading previews from external .blend when linking or appending
* thumbnail caching according to the Thumbnail Managing Standard: http://jens.triq.net/thumbnail-spec/
* for now just kept imasel access mostly as old imgbrowser (CTRL+F4, CTRL+F1) a bit hidden still.
* filtering of file types (images, movies, .blend, py,...)
* preliminary managing of bookmarks ('B' button to add, XKEY while bookmark active to delete)
More detailed info which will be updated here: http://wiki.blender.org/index.php/User:Elubie/PreviewImageBrowser
Places that need special review (and probably fixes):
* BLO_blendhandle_get_previews in readblenentry
* readfile.c: do_version and refactorings of do_library_append
* UI integration
TODO and known issues still:
* Accented characters do not display correctly with international fonts
* Crash was reported when browsing in directory with movie files
* Bookmark management still needs some UI work (second scrollbar?), feedback here is welcome!
Credits:
Samir Bharadwaj (samirbharadwaj@yahoo.com) for the icon images.
Many thanks to everyone who gave feedback and helped so far!
However meshes that use an armature cant use object animation.
faster exporting for non modifier applied, armature meshes (transform all verts using wrapped C func)
* made name string cleaning function allow chars ,.()[]{} in fbx model names
* clamped export lamp intensity to 200
* each mesh only links to the image-textures it uses. (before it linked to ALL textures)
* added support for AllSame mapping, this means when a material or texture only uses one, a single mapping index can be given rather then a big list with the same value in it.
* improved material and texture mapping method
* material indicies were incorrectly exported
* export object materials using colbits
* scaled armatures would scale bones twice
* scenes with no world would raise an error
Additions
* added options for global scaling and rotating, defaults will load correctly in MotionBuilder
* modifiers can be applied to skinned meshes, the armatures are set to their rest positions for python to get the un-deformed mesh. This makes exporting a mesh with subsurf and armature applied work as expected.
* meshes with parent bones are exported as weighted meshes.
* use lamp modes for cast light and cast shadow FBX settings.
* batch exporter, scenes or groups can be exporter to a file each.
* help button to load the wiki exporter page.
* added a user interface
* added support for exporting multiple actions as FBX's 'Takes'
* added support for one armature effecting multiple meshes
* added support for multiple armatures (bone names wont have namespace collisions)
So it can be used to export walk cycles etc.
Animated armatures also work (import BVH and export as FBX for instance)
Pose data is transformation is key'd on every frame at the moment, so IK's and constraints are applied but blenders keyframes are not used.
at the moment one armature applied multiple meshes wont work properly and armatures cant have transformation.
I've added the ability for PyConstraints to define a function (doDriver) that is able to directly modify values of the owner/target, so that certain setups can be created reliably. Users should take note that this is against the basic concept of what a constraint does, and that under no circumstances may they set the values of any variables controlling the transforms. For more details, check out the information in the PyConstraint template script.
I've also updated PyConstraints to be aware of geometry targets. The script template has been updated with this information.
This averages the weights of vert groups per island (based on face connectivity)
Nice for making scales and works well with new dual-quat interpolation
This also helped me pinpoint a couple of off by one errors in the UV rasterizing code. One especially noteworthy was that all UV at 1.0 (on the 0..1 scale) didn't render properly.
its not hard coded if it trys to do a static build or not. It
uses the same vars that decide if your building a static blender to
determine if it should make a static package.
I also found a typo on OSX for make release and thats fixed now
Kent
Added new defines for the icons used to show this, on the request of Matt Ebb. For now, the eye icons have simply been duplicated to the new spaces, but 'more descriptive' icons should be made.
Here is a script template for the "Script Templates" menu in the Text Editor. It provides you with the necessary functions for a PyConstraint set up, and also includes descriptions on what is required in each function.
* Finally cleaned up the NSIS installer creation process
This is now a proper action and command, with simple printout
The 'nsis' target (only on Windows) now properly depends on
all the build process, and will be done as very last.
* Make LZMA (Solid) default compressor for installer (= the best)
Also removed the use of list.index() all over the place where the index was known. (saves searching the file and the possibility of duplicates messing it up)
Lattice.c - removed warning
Mesh.c - (own error) when running me.update(key="...") didnt update the right keyframe.
mesh_cleanup.py - Bugfix from a report by plumiferos that started uncovering all the memory leaks.
Removing NAN verts didnt work with mesh keyframes.
not found on their system, it will open a browser window to point them
at the download site.
DEV NOTES: Anyone building the NSIS installer will need the Moreinfo
plugin - http://nsis.sourceforge.net/MoreInfo_plug-in
- 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.
To use:
Make sure NSIS is in your %PATH% and type 'scons nsis'
It doesn't currently compile blender first, so make sure you do a
normal 'scons' before this.
* 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.