* UI layout for scene buttons has quite some changes, I tried to
better organize things according to the pipeline, and also showing
important properties by default, and collapsing less important ones.
Some changes compared to 2.4x:
* Panorama is now a Camera property.
* Sequence and Compositing are now enabled by default, but will only
do something when there is a node tree using nodes, or a strip in the
sequence editor.
* Enabling Full Sample now automatically enables Save Buffers too.
* Stamp option to include info in file is removed, it now simply always
does this if one of the stamp infos is enabled.
* Xvid, H.264 and Ogg Theora are now directly in the file format menu,
but still using FFMPEG. Unfortunately Ogg is broken at the moment
(also in 2.4x), so that's disabled. And Xvid crashes on 64bit linux,
maybe solvable by upgrading extern/xvidcore/, using ubuntu libs makes
it work.
* Organized file format menu by image/movie types.
Added:
* Render layers RNA wrapped, operatorized, layouted.
* FFMPEG format/codec options are now working.
Defaults changed:
* Compositing & Sequencer enabled.
* Tiles set to 8x8.
* Time/Date/Frame/Scene/Camera/Filename enabled for stamp.
The autocomplete function is generic and could be made into its own module.
Examples:
b -> bpy
bpy.data.mes -> bpy.data.meshes
bpy.ops.OB -> bpy.ops.OBJECT_OT_
bpy.data.objects[0].a -> (options)
active_material, active_material_index, active_particle_system, active_particle_system_index, active_shape_key, active_shape_key_index, active_vertex_group, active_vertex_group_index, animation_data
* Objects now support up to 32767 material slots. It's easy to
increase this further, but I prefer not to increase the memory
usage of mesh faces, it seems unlikely that someone would
create 32767 distinct materials?
* Forward compatibility: the only thing you can potentially lose
reading a 2.5 file in 2.4 is object linking (instead of default
data), though usually that will go fine too. Reading files with
> 32 material slots in 2.4 can start giving issues.
* The ob->colbits variable is deprecated by the array ob->matbits
but I didn't remove the ob->colbits updates in very few places
it is set.
* I hope I changed all the relevant things, various places just
hardcoded the number 16 instead of using the MAXMAT define.
* Join Objects operator back. This is using the version from the
animsys2 branch coded by Joshua, which means it now supports
joining of shape keys.
* Fix for crash reading file saved during render.
- Keyed targets in one list instead of "chaining", this opens up many more possibilities than before and is much less obscure.
- Better keyed timing possibilities (time & duration in frames).
- Looping over keyed targets list.
Other changes:
- New child setting "length" with threshold (great for guard & underfur with a single particle system)
- Modularization of path interpolation code.
- Cleared "animateable" flags from many particle settings that shouldn't be animateable.
Fixes:
- Keyed particles weren't copied properly (ancient bug).
- Hair rotations depended on global z-axis for root rotation so downward facing strands could flip rotation randomly. Now initial hair rotation is derived from face dependent hair matrix. (This caused for example ugly flipping of child strands on some cases).
- Children from faces weren't calculated straight after activating them.
- Multiple disk cache fixes:
* Disk cache didn't work correctly with frame steps.
* Conversion from memory cache to disk cache didn't work with cloth.
* Disk cache crashed on some frames trying to close an already closed cache file.
* Trails didn't work with disk cached particles.
- Child rough effects were effected by emitter object loc/rot making them next to useless with animation, why didn't anybody tell me this!!
- Lots of random code cleanup.
Shift+Enter in the text editor executes the TEXT_OT_line_console operator defined in space_text.py
The operator's class stores a namespace for each text block.
Eventually this should have its own input rather then using the text editor.
Tested with py3.1 and 2.6
TEXT_OT_insert was only using the first char from a string, added support for inserting strings.
* Code to start moving 3D view header and panels to python, at
the moment the View menu and one empty panel is in python. The
C header code is wrapped in one template, so parts of that can
be moved over while still keeping things working.
* Fix for mistake in RNA enum commit yesterday, and some warning
fixes.
* Move Up/Down and Delete are now operators
* Made TrackTo constraint use expanded enum toggles for up axis too.
--> BUG ALERT: specifying name and expand in the arguments to itemR doesn't work (name gets skipped)
* Enums can now be dynamically created in the _itemf callback,
using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
for operators. This doesn't fit design well at all, needed to do
some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
_itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
(unselected, deselect), to make them consistent with other ops.
* Fix poll() callback changes in recent commit, note that these have
to work with pinned context too.
* Hide header for context panels in py layout.
* Don't jump back when collapsing a panel, allow the view to be
over some empty space until you scroll back.
* Fix follow context icon, order had to be reversed in icon file.
* ID template now has icon as part of browse button instead of
outside the buttons.
* Fixed some Bugs from Commit 21458.
* Show Preview Render only when there is an active id block.
* Some Code Cleanup (especially in polls). Please try to keep it clean ;-)
"moving the ID browser into its own panel. Eventually these panels should loose their headers to distinguish them from other, normal panels. Also a few other fixes for bones and armature panels."
* 3D view Mesh menu works again, but incomplete.
* Add Properties and Toolbar to 3D View menu.
* Added "specials" menus back, vertex/edge/face and general.
* Various fixes in existing mesh operators, some were not working.
* Add MESH_OT_merge.
* Merge all subdivide ops into MESH_OT_subdivide, subdivide code
changes to make smooth + multi give good results.
* Rename all select inverse ops to *_OT_select_inverse.
* Fix "search for unknown operator" prints at startup, and some
warnings in py code.
* Don't run .pyc files on startup.
* Remove unused image window header C code.
* Context panel now draws without header, with arrows, no scene name.
* Softbody vertex group search popup.
* Improve names for autogenerated shortcut keys in menus.
* Make most Select menus in the 3D view header work.
* Fix armature border select selection syncing.
* Add POSE_OT_select_constraint_target,
MESH_OT_select_by_number_vertices, MESH_OT_select_vertex_path.
* Merge mesh select similar into one operator.
* Don't give MESH_OT_select_random Space hotkey.
* Add DAG_object_flush_update to many mesh edit tools, not calling this
will crash with modifiers.
* RNA_def_enum_funcs for dynamic enums in operators, but not very useful
without context yet.
* Fix refresh issue with image window header + editmode.
* Fix drawing of shadow mesh for image painting.
* Remove deprecated uiDefMenuButO and uiDefMenuSep functions.
* Remove keyval.c, code is in wm_keymap.c already.
* Rename WM_operator_redo to WM_operator_props_popup.
* Previous/Next Folder browser
* bugfix: "open most recently opened directory".
* Previous and Next functionalities:
- use BACKSPACE to navigate to previous folders
- use SHIFT+BACKSPACE to navigate forward
- once you change the folder by other ways the forward folder list is cleared
* bug fix: the sfile->params->dir set through ED_fileselect_set_params wasn't correct. According to the code taking the settings from the existing (previous) filebrowser is a temp solution. In that case this is a fix for a temp solution :)
(changes in: wm_event_system.c, filesel.c and ED_fileselect.h)
** Andrea(elubie): we can get away of the folderlist_clear_next test if we manually pass a boolean to file_change_dir (e.g. file_change_dir(sfile, true)). I tried not to mess up with your changes here. It's slightly slower (and maybe hacky) but its's more conservative IMHO.
(my first commit to 2.5 ... that was a good reason to put my paper on hold :p)
* Baked normal particles can now use the "Path" visualization.
* Path "max length" & "abs length" are now history:
- New option to set path start & end times + random variation to length.
- Much more flexible (and calculated better) than previous options.
- This works with parents, children, hair & normal particles unlike old length option.
- Only known issue for now is that children from faces don't get calculated correctly when using path start time.
* New option "trails" for "halo", "line" and "billboard" visualizations:
- Draws user controllable number of particle instances along particles path backwards from current position.
- Works with children too for cool/weird visualizations that weren't possible before.
* Normal particle children's velocities are now approximated better when needed so that "line" visualization trails will look nice.
* New particle instance modifier options:
- "path"-option works better and has controllable (max)position along path (with random variation possible).
- "keep shape"-option for hair, keyed, or baked particles allows to place the instances to a single point (with random variation possible) along particle path.
- "axis" option to make rotation handling better (still not perfect, but will have to do for now).
Some fixes & cleanup done along the way:
* Random path length didn't work for non-child particles.
* Cached & unborn particles weren't reset to emit locations.
* Particle numbers weren't drawn in the correct place.
* Setting proper render & draw visualizations was lost somewhere when initializing new particle settings.
* Changing child mode wasn't working correctly.
* Some cleanup & modularization of particle child effector code and particle drawing & rendering code.
* Object & group visualizations didn't work.
* Child simplification didn't work.
* Lattices: properties editable, editmode operators, menus working
again. As a bonus you can now edit u/v/w in editmode.
* Shape Keys: some code cleanup, and added more buttons. The
value/min/max buttons don't work correct yet though.
* Fix issue with uv textures, vertex colors not being visible outside
editmode, and a few other issue. Mesh.edit_mesh is now NULL when
not in editmode.
All kinds of changes to get it ready for UI layouts. This means RNA
and operators should be working correct, but most buttons are still
not actually there yet.
* Added near empty soft body, fluid, field and collision panels,
tweaks to cloth panels.
* Fluid bake works, but without escape or showing any progress.
* Fluid/Softbody/Cloth/Collision can now be both added as modifiers
or in the physics panels.
* Missing: fields & soft body for particles.
* Missing: proper updating softbodies, guess this code still needs
updates after pointcache refactor?
RNA
* Added the relevant active_*_index properties, with proper
get/set/range, updates and notifiers.
* Context.tool_settings.
* ToolSettings.vertex_group_weight.
Operators
* MESH_OT_uv_texture_add/remove
* MESH_OT_vertex_color_add/remove
* MESH_OT_sticky_add/remove
* OBJECT_OT_vertex_group_add/remove/assign/remove_from/
select/deselect/copy/copy_to_linked
* OBJECT_OT_shape_key_add/remove
UI
* Some updates and cleanups in list template code.
Known issue: when going in & out of editmode, uv textures and vertex
colors dissappear. I thought me->edit_mesh would be NULL when not in
edit mode but it is not?
Image Window
* Unpack operator now works.
* Some small layout code tweaks.
Info Window Header
* Moved to python UI code.
* template_running_jobs, template_operator_search added.
* Ported external data operators: pack/unpack all, make
paths relative/absolute, find/report missing files.
Also
* Report RPT_INFO too, not only warnings and errors.
* Run UI handle functions after RNA and Operators.
* Rename particle system add/remove operators, to not
include "slot", that's only there for materials because
that's what they are called now in RNA.
* bookmark operators: add and delete bookmark
* first start at menus in file browser: Directory and Bookmarks
* Adding a bookmark via menu or via CTRL+B
* Remove a bookmark with the X button next to it.
* start of filebrowser RNA
* system files, bookmarks, etc. now nicely inside panels to allow collapsing etc.
* filebrowser header now defined in space_filebrowser.py
TODO:
* button type for bookmarks etc. not final yet, at least should get centered still. Suggestions welcome here.
image.has_data can't be called before you load an image, otherwise it will return false even for valid images.
The workaround is to try to run image.glLoad() before. That will crash if the image is corrupted (for we are using try/catch here).
Campbell (ideasman42) thinks it would be better to have an api call proper for that. Since 2.4xx is close to its end I really don't think it's time to keep working in its API. Specially if we have similar functions doing what we need.
@ Arystanbek (kazanbas): I'm done with the obj fixes I told you. You are free to go with the importers :)
You may want to take a look at implementing a proper image.load() to 2.5 as Campbell suggested.
* Adding/removing particle systems to an object.
* Changing of particle settings.
* Currently showing an object's particle systems in a list (like materials).
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
* Search popup + autocomplete for bones, vertex groups, etc. This
is done with layout.item_pointerR, specifying an RNA collection to
take the items from. Used by constraints and modifiers.
* Some tests with the List template, ignore those for now..
* Added SCROLL button type, use like a NUMSLI basically, with
a1 used to define the scroller size.
* Add scroll and toggle colors to the Theme (toggle was set to
draw like radio in a recent commit, but it's the intention
these look different).
* Added rudimentary list template, used for object material
slots, this is WIP though.
* In popup menu, split text with line breaks over multiple
lines, makes python errors display slightly nicer.
- allow RNA_property_enum_items to take the totitems int pointer as NULL (spares a loop on all the enum items). this change also makes enums types with no enum array crash in some places, could support these though Id rather disallow them, generating docs is a quick way to test for this.
- open recent file operator used and enum to open the recent file without an enum array, changed to an int type.
- added space_logic.py poll functions
* Menu and header more complete now.
* Clean up Game Properties panel and moved View Properties panel
to python.
* Fix some drawing issues when combining tiles, repeat and aspect,
some also from 2.4x, these options didn't work together 100%.
* Allows moving, rotating & scaling of particle simulations.
* Setting in particle render options.
* Changes viewed & rendered particles from global space to parent space.
* Doesn't effect simulations at all.
* Particles support larger than 1 frame changes, bigger frame changes can result in inaccurate results, but it's super fast and you get a nice feeling of how the particles behave!
* "Cache to current frame" button calculates the exact result of particles at current frame.
* Current state of cache can be protected by making it a bake.
* Cache is now in memory by default, disk cache is an option.
* Only "viewport %" number of particles are calculated and cached in viewport, baking and rendering calculate all particles.
* Info on cached frames and memory usage given in ui.
* Support for exact "autocaching" of changes and large frame changes(disabled for now until exact place in event system is decided)
* "Continue physics" is probably deprecated after this and should be removed once sb & cloth use the new cache code.
Todo:
* Make softbody & cloth use the new cache things.
Other changes:
* Some cleanup of particle buttons.
Note's
* exports the mesh without modifiers or transformations applied
* supports UV's vertex colors
* no support for normals yet (missing from data api)
* registers an operator called EXPORT_OT_ply
* no file selector yet. can only fun from python currently
bpy.ops.EXPORT_OT_ply(filename="/tmp/test.ply")
* removed double lookups on the vertex dict, build face verts to write allong the way.
Updated Mathutils.Vector/Euler/Quaternion/Matrix so these are types rather then module methods, each type now has a tp_new function, matching python builtins float/int/str.
Also cleaned up float conversion and arg passing.
Changed buttons_objects.py...
if ob in groups.objects: # no longer works
if ob.name in groups.objects: # is the new syntax
...its more dict like and a lot faster (avoids python iterating over each item and comparing each, use a single rna lookup instead).
* Fix context.cloth, was not being set correct.
* Fix errors with context pinning, scripts should
not assume context.object to be there.
* Always show preview even if e.g. the material is not
set, to keep ID buttons from jumping while you're
using them.
- added export Cameras (ortho and persp) to VPORTs, incl. clipping
- added export Cameras (ortho and persp) to VIEWs, incl. clipping
- export multiple-instances of Mesh-Objects as BLOCK/INSERTs
- on start prints dxfLibrary version
* Close some material/texture panels by default.
* Update material buttons to use more diffuse/specular variables.
* Don't show texture mapping/influence when the texture is pinned.
* Small visual tweak for sequencer header menus.
* Started porting over to python, menus nearly done, header WIP.
* Game Properties panel is in python too
* Deprecated "Tiles" as a per face flag here, now it's always on
the image, used to be both, working in a very confusing way.
Unlikely someone actually had a purpose for this being per face.
* Remove GPC_PolygonMaterial.cpp/h, it's not actually used anymore,
so I don't want to bother updating it.
* Fix crash in image painting (own mistake in porting over bugfix
from 2.4x).
* Added more material buttons by William. Thanks.
I made some minor adjustments and added Specular Shader Model RNA.
* Code cleanup and some consistency tweaks of button files.
Notes: Preview render now only shows up when there is an active world, material, texture or lamp.
* Made sure initial panels with ID Datablocks are shown, even when no block is active.
- Changing visible layers for armatures now sends notifiers
- Made the bone buttons show the layers data
TODO:
I also tried making the bone buttons show for 'PoseChannels' instead of the raw bones since this is more correct for most editing that can be done (i.e. when posing). For editmode though, we'd need to wrap EditBones in some way? However, I couldn't seem to get this to work due to the way paths are resolved.
Added a new template for layer-buttons, which auto-determines the layout of the buttons instead of relying on some hardcoded pattern for n-layers (i.e. 16 or 20 currently). This is a still bit rough, and could do with some refining to allow us to define what extra info (icons) should get drawn on the buttons or so.
Currently, this is only used in the Armature buttons to allow showing/hiding layers.
* Missing changes to release/windows/installer
* Sequencer fixes in source/blender/src/seqaudio.c dont apply to 2.5
* brechts fix for #18855 r20763 wasnt merged, does this apply to 2.5?
* Wasn't setting the curve 3D option
* The nurbs object name could be None which caused an error, check its set.
OBJ Export
* Off by 1 error on closed nurbs was incorrect, broke other importers but worked with blender.
* Nurbs verts were not adding to the total vert count, scrambling meshes added after (somehow my first test case had all the curve objects last)
Imports nurbs with orderU and endpointU (inferred from weights).
No support for vert-weights, surfaces, 2D curves or non-bspline's yet.
fix for exporting closed nurbs, was overlapping too much of the curve.
...is the same as
elif rd.file_format in "OPENEXR": # ("OPENEXR",) <- syntax for a single tuple
At the moment its using pythons syntax for a string search which works but isnt whats intended. Replaced in with ==
(Also use '' for enums rather then "")
If a total of 30 subdirs was hit, or 4 dirs deep was hit - script scanning would quit, skipping files in the root scripts path too.
To work around this the script pack included some of blenders scripts twice just so they would get into the menu but this is a dodgy workaround.
* dont stop scanning for scripts when limits are reached (just dont scan further).
* global 30 dir limit per scan is silly - removed.
* limit recursive depth is kept but keep scanning at lower depths.
* bumped recursive limit from 4 to 6
* flt_properties.py had #!BPY without a menu header.
Adds access to...
- Anisotropy
- Mirr Threshold
- Trans Threshold
Breaks rule of no additions but python data access is quite safe, vray exporter needed these attributes.
[#18891] BGE Convert script Python 2.5 compatible
eg, layout.operator_context = 'INVOKE_REGION_WIN'
Needed to set the context that menu item operators are executed in.
fixed missing NULL check with anim system debug printing.
- uiItemEnumO_string, forgot to actually set the enum value
- added more sequencer header buttons (these should probably be moved to a view panel eventually)
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD
Notes:
* Game and sequencer RNA, and sequencer header are now out of date
a bit after changes in trunk.
* I didn't know how to port these bugfixes, most likely they are
not needed anymore.
* Fix "duplicate strip" always increase the user count for ipo.
* IPO pinning on sequencer strips was lost during Undo.
- Move buttons into the sequencer Nkey region
- Made the header and menu items use the python api, still need to get more buttons working.
- Fixed some minor problems
v1.34 - 2009.06.08
- export Lamps and Cameras as POINTs
- export passepartout for perspective projection
- added option for export objects only from visible layers
v1.34 - 2009.06.07 by migius
- cleaning code for release
- fix nasty bug in getExtrusion()
- support text-objects, also in ortho/persp-projection
- support XYmirrored 2d-curves to 2dPOLYLINEs
* Context now allows pinning a datablock, independent of
selection.
* Initial ID browse buttons for most buttons tabs.
* Browsing from world to texture now displays world textures
again, but is a bit of a hack, not sure there is a right
way to do this.
* There's a button to switch between active materials and
textures now, only temporary though.
* There's some code to put context part in own region,
disabled still because it doesn't work that well yet.
* layout.split() now takes a percentage argument to control
the split position.
* ID template now works for more than just the Text ID type,
includes and icon, and some other fixes.
* Added a constraint tab in the buttons window.
* Added more sequencer buttons (effect strips).
Note: Sequencer buttons will go into the sequencer itself (n-key Panel) later.
* Particle button tweaks by William Reynish. Thanks!
* Some RNA fixes and new properties.
-Many things not yet working properly :)
-Experimental new (hopefully more logical) categorization of buttons, feedback on this is very welcome.
-Separate render & draw types, for example now there is actually a render option "halo" instead of all the different point draw types.
-Particles get recalculated only from buttons that actually change something that has to be recalculated, for example changing visualization doesn't reset particles any more.
-Boid physics buttons are still missing as I'm currently redoing the whole boids code.
-Point caching is still very wip, so baking is not possible for example, but I added a few cache baking flags for rna that were/will be needed for particle buttons logic.
DXF-Library log:
v1.31 - 2009.06.02 by migius
- modif _Entity class: added paperspace,elevation
v1.30 - 2009.05.28 by migius
- bugfix 3dPOLYLINE/POLYFACE: VERTEX needs x,y,z coordinates, index starts with 1 not 0
DXF-Importer: minor changes
DXF-Exporter log:
v1.34 - 2009.06.02 by migius
- support XYmirrored 2d-curves to POLYLINEs: works correct only for rotX,rotY==0.0
- support thickness and elevation for curve-objects
- fix extrusion 210-code (3d orientation vector)
- fix POLYFACE export, synchronized with dxfLibrary.py
- changed to the new 2.49 method Vector.cross()
- output style manager (first try)
v1.33 - 2009.05.25 by migius
- bugfix flipping normals in mirrored mesh-objects
- added UI-Button for future Shadow Generator
- support curve objects in projection-2d mode
- UI stuff: camera selector/manager
- script template use new property syntax
- Python could set the axis/hat to a negative index and crash blender (nobody complained)
- Servo control UI had overlapping text
- CValue warning ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); had false positives because of python using getattr() internally. Only show the wanring now when a CValue is found.
- Py functions that accepted a vector and a GameObject were slowed down by PySequence_Check() first called on the GameObject, though this would fail it would try and get attributes from the game object - ending up in ~8 attribute lookups each time. Avoiding PySequence_Check() makes ob.getDistanceTo(otherOb) over twice as fast.
- Joystick hat events could crash the BGE for joysticks with more then 4 hats.
- PLY Import failed on PLY files from Carve, added some extra types.
Cleanup commit:
- Yafray removed. Also did cmake/scons files, but didn't compile with it,
so test would be appreciated :)
- Removed old crap from Windows release dir, should be checked on
further by windows release builder later.
* Wrapped the constraint layout to python and deleted the corresponding C code.
ToDo: 4 constraints are still C code (IK, Script, Action and Rigid Body Joint)
* Some Constraint RNA fixes.
* Wrapped the Shrinkwrap Constraint in RNA.
* Added panels with dummy preview template.
* Added constraints panel for bones next to objects, though it
doesn't work that well yet, the operators and code need to be
changed so they don't assume it is one or the other in/out
of posemode.
* Added some graying out in the scene and world buttons.
Brecht, would you be able to have a look at this if you have time - I can't
figure out how to trigger the python file to register the header instead of
what's in outliner_header.c.
note: The new 'Toggle' options in the UI api should be
avoided for normal text buttons, and used sparingly
otherwise. We want to avoid having two inconsistent
appearances for the same type of buttons.
Separated out the code for defining the layout for the constraint targets since its practically the same (with a few minor variations) for all of the other constraints.
* Added Constraints template and Add Constraint operator.
* Added toggle=True/False parameter to uiItemR, to get a
toggle button (actual button) rather than an "option"
button (checkbox)
* Added OPTION/OPTIONN button type, to distinguish with
TOG/TOGN.
RNA:
* Make all modifier pointers editable, including correct updates.
* Added notifiers and updates to constraints.
* Fix a stack corruption, pointed out by Andrea, and potentially
causing crashes.
* object_drop.py - option to orient to face normal (useful for scattering objects over terrain), accounts for normal flipping and can adjust the orientation %.
- Fixed some deprecation warnings in documentation.
- Added more conversions to script.
- Added more attributes to script todo list.
- Print out name of text buffer when encountering an error in batch mode.
- Refactor: Simplified attribute map.
- Added notImplemented function to print warnings for missing conversions. References documentation.
This includes a bunch of new object primitive icons
which would be great to get into the 'add object' menus,
they're not there yet. The specific lamp data type icons
are now used in the outliner though, which is very helpful.
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.