Added subdivide operator and button for multires.
Since this seems to be the only modifier with an operator defined, I'm not sure if I put it in a good place or not, someone can check on this?
Patch from Alex Fraser (z0r)
- All attributes in the conversion map have been checked against the docs. More ambiguities have been resolved.
- Added option to convert all text buffers in Blender.
- Updated GameTypes.py: there were inconsistencies.
The script works well (causes no errors) with 0_FPS_Template.blend and vehicle_demo.blend from the
physics-2.43-physics-testfiles pack.
Caveats:
- Conversions were checked against other deprecated attributes. I may have missed some cases where a deprecated attribute
has the same name as a non-deprecated attribute. I did catch a few though.
- As with the last version, the conversion is purely text-based and doesn't compile the code. It's easy to create a
script that would break on conversion.
Still, it should get you 90% of the way to a converted script.
V2.00 22/05/09 by Aaron Keith
- Better error checking.
- Lock Nut and Hex Nut meshes added.
- Pre-sets for common metric bolts and nuts.
- Improved GUI.
- Meshes scaled to a smaller size
- Fixed bug when using crest and root percent other than 10%
- Can now create meshes in Edit Mode. This will add to the
current mesh and align with the current view.
[#18765] Update of the rvk1_torvk2.py bundled script:
The script has been modified to use the last management of the modifiers in the python api and corrected too. Now it
can copy the mesh object when it is alone and also a shape keys to the second one if needed.
Simple UI script fix, wanted to check... works all nice. :)
For ui scripters: keep track of alignment flags!
("Border" button was aligned with above button)
* template_modifier creates the modifier box, and returns a layout
to put the buttons in.
* Only the armature modifier is now done with python code, all other
modifiers use C code. To convert a modifier to python, remove the
corresponding C code and create a function in DATA_PT_modifiers.
* Some modifiers still require some RNA work to get it working well,
especially to make pointers editable. Mostly that is a matter of
defining an own _set callback and put some of the modifier C code
into it.
* Still various buttons that don't work, like for hooks or mesh
deform binding.
* Fix for crashing decimate modifier (still disabled).
* Removed UI_BUT_NO_HILITE, HMENU.
* Make uiLayoutBox work with align.
* turned some slider UI controls back into number fields
Note: Sliders should only be used when representing a property that's
conceptually a percentage or ratio. For arbitrary numbers, use a number field.
For example, a lamp's energy can theoretically be anything - 0.1, 3.5, 125.0, it
doesn't matter - it's just a number, not a percentage. So this should be a
number field.
Patch from Roger Wickes update to 2.48 sFrame, eFrame, fps.
[#18794] GE API conversion script: 2.48 -> 2.49
patch from Alex Fraser (z0r), will test further in the next few days.
---
This is text plug in and standalone script that updates Blender 2.48 Game Engine scripts to be compatible with the 2.49
API.
The script contains a mapping of attribute names to functions that do the conversion. Most of the mappings were extracted
from the documentation in GameTypes.py. Where the conversion is ambiguous, the script will not change the source except
to insert a warning as a comment. This means that the script does not completely automate the conversion process, but
will do a lot of the work.
The script still needs a fair bit of testing. Many of the mappings have not been tested and could result in broken scripts.
I'm submitting this patch now to start the review process early. I think I might need help if it is to be included in
2.49.
* Added material "type" property, with Surface/Volume/Halo
options, compatible with sim_physics, as requested for
material buttons layout. Obviously the Volume setting
does nothing currently.
* Deprecated MA_HALO flag in favor of this.
* Fix buttons jumping around when resizing and zoom. Part of this was
adding a tiny a 0.001f offset in UI_view2d_view_ortho, otherwise the
rounding is unpredictable (used to be 0.375f, but that was disabled).
* Fix various issues with zooming, panning panels. V2D_LOCKOFS_X/Y is
now taken into account in more places in the view2d code, to avoid
zooming into the center or panning out of the view.
* Remove "Free" align mode in buttons window (it's not really useful).
* View3D/Graph/Image editors now use the same PanelType system as the
buttons window, means some deprecated panel code could be removed.
* Some small visual tweaks for panels.
* View 2D Reset operator (Home key), to reset zoom and panning for panels.
* Added argument to set number buttons as sliders (slider=True for itemR).
* Ignore labels for button alignment (doesn't look right).
* Fix some use of context.main in py scripts, should get data from active
object instead.
* Fix autotexspace -> auto_texspace in py script.
* Added new modifier tab.
* Fixed problems when no object was selected after delete.
* Added initial Armature, Bone, Curve and Font panels, by William Reynish (Billrey). Thanks!
* Small RNA changes
* Commit revision 20240 and 20268 from trunk. ("Mouse wheel zoom lost after rendering.")
* Added new Buttons Tab "Bone" for Armature objects.
* Validation of buttons selection, when object selection is changed.
* added missing notifier for camera type and small layout change to the panel.
* more shading color changes for menu and checkbox.
in 2.48 constant interpolations meant that wasnt a problem but since it now uses linear interp. you can notice errors with animated characters because the 2 eulers are not compatible.
Added optional euler_compat argument to matrix.toEuler(eul) and quat.toEuler(eul) so when getting the euler rotations from a list of matrices the animation curve will be continues.
Also added euler.makeCompatible(euler).
- warning silenced for imagepaint.c
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
* FBX Bugfix, was exporting all animation curves as 'Constant' type (no docs for this so could only guess), Thanks to Sander Brandenburg for spotting this problem.
Also improved keyframe removal to work on animation curves an angle
from Paolo Ciccone (pciccone)
Im not that keen on this functionality since vertex groups in blender are for weight painting and OBJ's groups are more like sub-objects, The conversion between these is a poor approximation (one vertex group per face).
But this is still useful for using blender with poser so accepting these 2 patches.
Made some changes from the patch
*Export*
- vgroup off by default, since this is mainly useful for corner cases
- findVertexGroupName() - changed how exporting selects a vertex group for a face, use the highest combind weight for each group instead of the number of checking how many times the verts are in a group because they could have a zero weight.
- findVertexGroupName() - would fail if a faces verts were not in any groups, now return a (null) group
- Allow modifiers to export with vgroups
*Import*
- disable by default
- ignore (null) groups
- fixed a problem where the patch broke SPLIT_GROUPS
- move the group definition out of global namespace, breaks importing as a module.
--- Patch submission info
The import/export scripts included with Blender 2.48 don't save/preserve groups defined in OBJ file. This presents a
couple of issues: users loading an obj file with groups are not able to use a rather important set of data. When the
file is then saved the groups are lost bringing up both the issue of data loss and loss of functionality as groups are
used for rigging and morph target creation for Poser/DAZ Studio and all compatible applications. Of course other
animation/modeling packages that use OBJ files might be affected.
The solution that I present here simply patches the excellent python scripts written by Campbell Barton and Jiri Hnidek.
The new code implements the preservation of groups by creating Blender vertex groups during import and by re-writing
those groups in the OBJ file during export. Of course group ownership is idetermined at the face/polygon level and not
at the vertex level.
This rather simple solution makes Blender instantly one of the better tools to create Poser Morph targets (Full Body
Morphs) and conforming figures and clothing. Of course it's also adding a more complete support for the whole OBJ spec.
The patches are fitting well inside the established logic, have a minimal impact and are totally transparent to the
user. See the attached video (about 7 minutes long) for more details.
I noticed that the original scripts are formatted with tabs. I think it would be a good idea to follow the standard
Python recommendation and convert the scripts to use spaces. I didn't want to do it on my side as it would generate
a patch that replaces the whole file, not something that I wanted to do with my first submission :) But it would help
if people with access to SVN could do it.
Here is a short video that demonstrates the updates:
http://www.paolociccone.com/blender_obj_scripts.html
Cheers!
----
After quite a bit of searching, I finally found where the various UI functions were wrapped for use in Py Layouts.
For the reference of others, check out editors/interface/interface_api.c
nobody seriously uses this format for graphics these days, and if they did, the export from blender is unlikely be to be useful, its just different views of the mesh edges projected into a 2D xfig file (quantized to int's too).
from Kevin Morgan (forTe)
imports images as quads in the 3D view
made some changes
- images that fail to import give an error popup rather then a script error
- extension input is only shown for batch directory importing
- extension comparison is now case insensitive
- importing images from "/" failed, (bug in Blender.sys.dirname), use os.path.dirname since os is needed for batch import in other places.
- disable Esc for quitting because escaping from the file selector would quit the script too.
Minor changes are...
- default size is smaller then it was but still too big IMHO, presets are huge.
- deselect all objects and make the new bolt active
- place the new bolt at the 3D cursor location
*Added initial material buttons (Material Color, Ray Transparency, Ray Mirror, Subsurface Scattering)
Only works for default material atm.
*some layout tweaks to the lamp panels.
* Split the buttons_data.py into separate files, this makes it easier to maintain them.
Notes: Added an extra modifier file, because modifiers are for different object types.
* Added basic lamp buttons and Sun/Sky settings.
As the camera buttons they only work for the default light object for now.
* Some minor code cleanup
even though the format allows materials and textures to be written separately the textures wont load right in maya or 3dsmax unless each texture has its own material.
* Added camera buttons.
* Added poll to check on active object type.
ToDo:
* Lens Unit "lens" and "angle" don't update each other. Needs RNA fix.
* Buttons only work for default camera now, needs better context.
- when the attribute check function failed it didnt set an error raising a SystemError instead
- Rasterizer.getMaterialMode would never return KX_BLENDER_MULTITEX_MATERIAL
- PropertySensor value attribute checking function was always returning a fail.
- Vertex Self Shadow python script didnt update for meshes with modifiers.
This has been wrapped under Scene.RenderData, and can currently be accessed under the 'Image' panel in the Scene settings.
As in the old code, image types are only included if they are enabled when compiling. Also note that image-type specific settings have not been wrapped yet.
* Made separator item work horizontal & vertical.
* Add colon (:) automatic for int/float/enum/string.
* Added space variables to uiStyle and use them in the
layout engine.
* Added initial World buttons by Thomas Dinges, thanks!
* Added some code for modifiers in the Object Data context.
This will become a template though.
* Use a common poll() callback in the scripts to reduce code.
* Headers and menus can now be created in python.
* Replaced the uiMenuItem functions to create menus with equivalent
uiItem functions using a layout, removing duplicated code.
* More uiItem functions are now exposed to python.
* The text editor header, panels and one of its menus are now created
in space_text.py.
* Buttons window data context icon new changes depending on active
object.
Issues
* Icons are not wrapped yet, hardcoded ints at the moment.
* The ID browse template is unfinished.
* Changed the buttons window contexts to be like the mockups:
scene, world, object, data, material, texture, particles, physics
* Removed temporary C layout code for buttons and scene.
The Python API to define Panels and Operators is based on subclassing,
this makes that system more generic, and based on RNA. Hopefully that
will make it easy to make various parts of Blender more extensible.
* The system simply uses RNA properties and functions and marks them
with REGISTER to make them part of the type registration process.
Additionally, the struct must provide a register/unregister callback
to create/free the PanelType or similar.
* From the python side there were some small changes, mainly that
registration now goes trough bpy.types.register instead of
bpy.ui.addPanel.
* Only Panels have been wrapped this way now. Check rna_ui.c to see
how this code works. There's still some rough edges and possibilities
to make it cleaner, though it works without any manual python code.
* Started some docs here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNATypeRegistration
* Also changed some RNA_property and RNA_struct functions to not
require a PointerRNA anymore, where they were not required (which
is actually the cause of most changed files).
* Don't call generic layout hints templates anymore, i.e.
TemplateRow becomes Row, etc.
* Added more general layout nesting, using uiLayoutSplit()
and uiLayoutBox() functions, for which the sublayouts
can then be accessed using uiLayoutSub(), to put items
in those sublayouts.
* Some steps to make the layout decisions, like which items
to put in which columns, independent of the width of the
window or the text in the buttons. We want the layout to
be stable under resizes and translations.
* Added an "expand" parameter to uiItemR, used now to expand
enums into a row instead of using a menu.
There is a problem importing 3ds files where I cant find a way to check if the transforms are applied to the vertex locations or not.
Since 2.44 I made the importer assume they were not since you can manually remove transformations, but not reverse.
Nevertheless most 3ds files have the matrix applied, better not give a bad import by default.
Did some research and other 3ds importers (lib3ds for eg), have the same problem and just assume the transformations applied.
3dsMax imports both correctly so there must be a way to tell but I could not link it to the 3ds version or other mesh options.
Added an option to workaround this problem in rare cases where its needed.
- KX_GameObject.cpp & KX_Scene.cpp, clear the dict before removing the reference in case there is a circular reference.
- added DWG support, adapted Stani Michiels idea for binding an extern DXF-DWG-converter
The external DXF-DWG converter "dconvertcon.exe" 355kb comes from openDesignAlliance www.opendwg.org, is free, but not opensource, not GPL-compatible (can not be bundled with commercial programs), so must be downloaded and installed in Blender script folder by user. It is a DOS console application, can be started in background mode, works on Windows, and in Wine on Linux and OSX. Version 1.0 (2002) supports conversion between DXF<->DWG for autocad release: 2.5, 2.6, 9, 10, 11, 12, 13, 14, 2000, 2002.
Version string is compatible with all previous releases, but report
subversion if not 0.
Keep distribution dir so you can run from there without needed of unpack,
and make messages and cmds be in sync.
The bug was todo with bpy.data and bpy.types becoming invalid, temporary fix is to re-assign them to the bpy module before running python operators or panels.
will look into a nicer way to get this working.
this means it caches the compiled pyc files after importing fro the first time.
My times for importing 501 buttons_objects.py files were.
- running each as a script 1.9sec
- importing for the first time 1.8sec
- importing a second time (using pyc files) 0.57sec
Also added "bpy" to sys.modules so it can be imported.
* Added very basic loading of .py files on startup to define panels.
It now executes all .py files in .blender/ui on startup. Right now
this contains the object buttons, the C code for it is commented out.
These files should get embedded in the blender executable as well
eventually, that's a bit more complicated so this works for now.
* For scons and cmake it seems to copy & find the files OK, for make
only "make release" works (same with scripts/ folder it seems).
* Added BLI_gethome_folder function in BLI_util.h. This is adapted
from bpy_gethome, and gives the path to a folder in .blender like
scripts or ui.
There's plenty of things to figure out here about paths, embedding,
caching, user configs ...
Notes:
* Sequence transform strip uses G.scene global, this is commented
out now, should be fixed.
* Etch-a-ton code was most difficult to merge. The files already in
2.5 got merged, but no new files were added. Calls to these files
are commented out with "XXX etch-a-ton". editarmature.c and
transform_snap.c were complex to merge. Martin, please check?
* Game engine compiles and links again here for scons/make/cmake
(player still fails to link).
* added filter buttons to header
* changed large icon for movie files to match small icon
* fixed small stack corruption in interface_draw.c (Matt, check if this is ok)
* moved nice display of file size to storage.c, where string is created.
- cleaned up warnings (mostly unneeded variables)
- new icons for filebrowser (large refresh and parent icons missing though)
- fixed error in large icon drawing due to texture coordinates calculated outside subpart of texture.
- removed library loading stuff from filelist
There was very little structure in this code, using many globals
and duplicated code. Now it should be better structured. Most
things should work, the main parts that are not back yet are the
python plugins and markers. Notes:
* Blenfont is used for drawing the text, nicely anti-aliased.
* A monospace truetype font was added, since that is needed for
the text editor. It's Bitstream Vera Sans Mono. This is the
default gnome terminal font, but it doesn't fit entirely well
with the other font I think, can be changed easily of course.
* Clipboard copy/cut/paste now always uses the system clipboard,
the code for the own cut buffer was removed.
* The interface buttons should support copy/cut/paste again now
as well.
* WM_clipboard_text_get/WM_clipboard_text_set were added to the
windowmanager code.
* Find panel is now a kind of second header, instead of a panel.
This needs especially a way to start editing the text field
immediately on open still.
* Operators are independent of the actual space when possible,
was a bit of puzzling but got it solved nice with notifiers,
and some lazy init for syntax highlight in the drawing code.
* RNA was created for the text editor space and used for buttons.
* Operators:
* New, Open, Reload, Save, Save As, Make Internal
* Run Script, Refresh Pyconstraints
* Copy, Cut, Paste
* Convert Whitespace, Uncomment, Comment, Indent, Unindent
* Line Break, Insert
* Next Marker, Previous Marker, Clear All Markers, Mark All
* Select Line, Select All
* Jump, Move, Move Select, Delete, Toggle Overwrite
* Scroll, Scroll Bar, Set Cursor, Line Number
* Find and Replace, Find, Replace, Find Set Selected,
Replace Set Selected
* To 3D Object
* Resolve Conflict
This patch solves some major problems of the svg script :
- reading of the inkscape svg format
- parsing of the scientific numbers
- redundant arc data in the same path for only one command "a"
- blending of curves after several files import and at the end a more correct management of the current point.
- Scripts Help Browser: error parsing doc info wrapped in triple single quotes, like done in the 3ds importer. Thanks Jean-Michel (jms) for informing me about it.
- visualizing data, rendering scenes automatically and character rendering on a server.
This example script shows how you can run blender in background mode, parse arguments from the command line to generate a simple scene and render/save it.
- Scripts Help Browser: Brendon Murphy requested and Kevin Morgan implemented a "run script" button.
- AC3D importer: option to store emis color from .ac file in mirror color in Blender (the exporter has the option to export mirror color as emis). Patch by Francesco Brisa.
Thanks for the contributions.
Brecht, please let me know if I haven't done the right thing with the RNA stuff - I thought it was easier to ask for forgiveness than approval in this case :)
* Added a cute 'RNA' icon
* After several hours of manual dragging and typing the icon file is now
enlarged and completely reorganised logically, rather than scattered
throughout. This should provide a lot more room for growth, and is a
lot easier to work with (also allowing more space for toggle buttons
that require two icon slots next to each other). The icon grid has now
25 x 24 icons - hopefully this might last us for a couple more years :)
Some of the naming of icon defines is a bit ancient and can be cleaned
up a bit further. Other devs, if when bringing spaces back, it's
finding the wrong icon, or missing a define, try and look to see if
it's already existing in the new icon file, or drop me a note and I'll
fix it up.
Note: after these changes, older custom blender 2.4 icon
files won't work and will need to be updated to the new layout.
* Enlarged the icons themselves from 15x16 pixels to 16x16 pixels (icon
designer request). This is a more standard size, and is easier to fit
stuff in proportionally.
* Added a bunch more of jendrzych's icons that weren't added previously
since there wasn't space in the icon file (including a few more
modifier icons)
* Tweaked the outliner somewhat, so that instead of just showing a
generic 'object' icon for all objects, it shows 'object type' icons,
per object type. This makes the outliner a lot more useful for browsing
at a glance - a huge row of identical 'object' icons doesn't really
give much useful information. See here:
http://mke3.net/blender/devel/2.5/outliner_obtypes.png
* Improved compatibility with VRML files
* Extract strings so they dont get modified for parsing, filename URL's with {} [] dont break importing anymore.
* Cameras were rotated incorrectly
* inline files were not opened with GZip
* Animation Support - currently only loc/scale/rot (scale untested)
* Lists of image URLs now use the first image from the list since there is no support for dynamic switching.
* use imagemagick to convert GIF's so they load in linux. (WIP - could be extended, At least it should not break anything)
BPyMathutils angle2ToLength function could be simplified (pointed out by brecht)
Part 3/3: new icons
- Icon set done by jendrzych! Great job!
- cleaned up unnecessary includes and removed commented out code
- preview icons (for materials, textures,..) don't work yet, have to be ported to new event system
to compile blender with gcc on IRIX, IRIX_USE_GCC needs to be set to true in
user-def.mk.
Other changes related to irix:
* compile solid from extern/
* don't build plugins (yet) with "make release" when using gcc (the shell
script used assumes MIPSpro is installed)
* use statvfs instead of statfs on irix, like done on solaris
* use external libs from $(LCGDIR) instead of /usr/freeware
* use glew header files from $(LCGDIR)/glew instead of the ones installed on
the system (this applies to other platforms as well)
* ffmpeg support currently is disabled on irix