This adds a RenderEngine type to RNA, which can be subclassed
in python (c++ will follow once we support subclassing there).
It's very basic, but plugs into the pipeline nicely. Two example
scripts:
http://www.pasteall.org/6635/pythonhttp://www.pasteall.org/6636/python
Issues:
* Render runs in a separate thread, and there is unrestricted
access, so it's possible to crash blender with unsafe access.
* Save buffers and full sample are not supported yet.
* ID blocks can now get RNA properties defined from python, e.g.:
bpy.types.Scene.BoolProperty(..)
* RNA structs/functions/properties can now get pointers duplicated
(mostly strings), since we can't point to some static string then.
* Added ExtensionRNA struct to add into *Type structs for subclassing,
is a bit more compact than defining the 4 variables each time.
Only disadvantage is it requires including RNA in more places.
* Windows fixes for texture filter & bump patches, thanks
Jean-Michel Soler for noting.
* Added sqrtf/sinf/fabsf/... fallback #ifdefs in BLI_arithb.h,
those should be safe to use now. Replacing the double for the
float version throughout the code can be done once, but would
need proper testing.
Patch by Alfredo de Greef. Considerably improves the quality of bump
mapping, and texture filtering for displacement and warp too. Mainly
this is achieved by getting the texture derivatives just right in
various cases, many thanks to Alfredo for figuring this one out, works
great.
This is enabled by default now, but disabled still for existing
textures to preserve backwards compatibility. Can be enabled with
the "New Bump" option in the material texture slot in the outliner.
Also, I made the range for the normal factor a bit smaller since this
gives stronger effects, but note that you can still type in larger
values than the slider allows.
Patch by Alfredo de Greef with high quality image texture filters.
This adds 3 new filters:
* SAT: Summed Area Tables. This is like mipmaps, but using somewhat
more memory avoids some artifacts.
* EWA: Ellipitical Weighted Average, anisotropic filter.
* FELINE: Fast elliptical lines for anisotropic texture mapping.
The one change I made to this was to try to fix an alpha/premul
problem, hopefully I didn't break anything, it looks compatible
with the existing filter now for me.
* Buttons in header now use operators too. The paste-flipped button needs attention though, since the flipped argument isn't set yet
* Assigned Ctrl-C, Ctrl-V, and Ctrl-Shift-V to Copy/Paste/Paste-Flipped respectively for now.
* Auto-Keying for this doesn't work again yet. On todo for later...
---
* Also, new armatures now get the flag to show custom bone colours enabled by default.
* World and Lamp previews now working here too.
* Experiment with list template, showing only icons. Unfortunately
texture icon render crashes combined with preview render so it
shows all icons the same.
* Influence panels updated, with slider for each option. The values
are still linked though, will fix that later.
* Image texture controls a bit more complete, still WIP.
* Color ramp back.
* Added a new UI Template for the 3-colour picker used to visualise + select the custom colours for a bone group.
* Finished wrapping the colour properties for Bone Groups in RNA. Although changing the colour-set used will change the displayed/cached colours, changing the colours via the colour wells will not change the colour set to 'custom' (as per 2.4x) yet. This needs a nice solution...
* Fixed context-related bugs with the Assign/Remove operators for bone groups. These were using context-iterators for selected posechannels, but that was only defined/valid for the 3d view (but not for the buttons window), hence a failure in that case.
Modal keymaps.
I've tried to make it as simple as possible, yet still using sufficient facilities to enable self-documenting UIs, saving/reading in files, and proper Python support.
The simplicity is: the 'modal keymap' just checks an event, uses event matching similarly to other keymap matching, and if there's a match it changes the event type, and sets the event value to what the modal keymap has defined. The event values are being defined using EnumPropertyItem structs, so the UI will be able to show all options in self-documenting way.
This system also allows to still handle hardcoded own events.
Tech doc:
1) define keymap
- Create map with unique name, WM_modalkeymap_add()
- Give map property definitions (EnumPropertyItem *)
This only for UI, so user can get information on available options
2) items
- WM_modalkeymap_add_item(): give it an enum value for events
3) activate
- In keymap definition code, assign the modal keymap to operatortype
WM_modalkeymap_assign()
4) event manager
- The event handler will check for modal keymap, if so:
- If the modal map has a match:
- Sets event->type to EVT_MODAL_MAP
- Sets event->val to the enum value
5) modal handler
- If event type is EVT_MODAL_MAP:
- Check event->val, handle it
- Other events can just be handled still
Two examples added in the code:
editors/transform/transform.c: transform_modal_keymap()
editors/screen/screen_ops.c: keymap_modal_set()
Also: to support 'key release' the define KM_RELEASE now is officially
used in event manager, this is not '0', so don't check key events with
the old convention if(event->val) but use if(event->val==KM_PRESS)
* Added Bone Groups UI to 'Armature' context buttons for now. Later, it may be more convenient to have these with bones instead?
* Added operators for the operations that can be performed on these groups. Moved the core adding/removing functions to blenkernel so that they can be used elsewhere in future if need be.
* Properly wrapped bone groups in RNA. Copied the way that Vertex Groups are wrapped, since they share some similarities. Setting colours for bone groups still needs more work though.
for a while py2.x will work but eventually be dropped when most OS's support it, so Id recommend upgrading.
The following instructions are only needed if you don't use python3.1 installed in the default location.
For releases users wont have to worry about this.
# in python3.1 source dir, build and install into your own dir, /opt/py31 is just an example.
./configure --prefix="/opt/py31"; make; make install
# In the scons user-config.py...
BF_PYTHON = "/opt/py31"
# ... now build ...
#
# Blender now needs 2 things to run. ./lib/libpython3.1.so and the python modules.
# Symlink (or copy) python modules, blender sets this path for modules on startup if it is found.
ln -s /opt/py31/lib/python3.1 ~/.blender/python
# Currently static linking is not working without hacks because of limitations in scons.
# for releases we can workaround, but for now its easier to set an environment variable.
# To start blender so it can find libpython3.1.so make this into a shell script to save yourself typing it in all the time.
export LD_LIBRARY_PATH="/opt/py31/lib/"
./blender
Moved Shade Smooth/Flat from Mesh obdata panel to tools area. These kinds of operator tools aren't really allowed in the buttons window anymore - whole point of new tools area :)
The only operators that are allowed in buttons window are things that act on the RNA fields, like add/remove buttons for adding vertex groups etc.
* Add/Remove IK now works again using Shift-I and Ctrl-Alt-I as before. The code for this is now located in editconstraint.c for now...
* Adding constraints with automatically added targets works again. It's a relief that the old code still works (with a minor tweak)
* Names for newly added constraints are now derived from the type of constraint, making it easier to identify the type of constraint
* Fixed crash when renaming constraints (due to invalid pointer being passed for the 'old' string name)
* List template visual changes. Items now look different,
and it expands to size 5 as more items are added.
* Added LISTROW and LISTBOX elements. The former is like
a typical ROW button, but looks diffrent. The latter
looks like a BOUNDBOX, and has no extra features yet.
* Fix some glColor3ubv warnings with casting, did not find
a nicer way.
* Added suppport for generating code without verifying with DNA,
this doesn't give good errors and is more error prone, but makes
it easier to wrap things like EditBone which are not in DNA.
* RNA_define_verify_sdna(0), and set to 1 again afterwards.
* Revert lamp sampling/buffers change. The right enum items should
be defined in RNA, not the layout, so that it works in outliner,
python api too.
* Also changed type popup to radio buttons again, and removed the
icons. This is more consistent, and I don't think it's a good idea
to start using icons for these things, too much clutter.
* Replace Mesh with Normals panel in the mesh buttons.
* Remove Material panel from mesh buttons.
* Added name fields for shape/vgroup/vcol/uv.
* Spacing tweak to Object and Bone names.
* Fix some naming conflicts in RNA, with "name" and "type" properties
being defined twice in the same struct.
* context.scene.tool_settings -> context.tool_settings.
Too many new features to list! But here are the biggies:
- Boids can move on air and/or land, or climb a goal object.
- Proper interaction with collision objects.
* Closest collision object in negative z direction is considered as ground.
* Other collision objects are obstacles and boids collide with them.
- Boid behavior rules are now added to a dynamic list.
* Many new rules and many still not implemented.
* Different rule evaluation modes (fuzzy, random, average).
- Only particle systems defined by per system "boid relations" are considered for simulation of that system.
* This is in addition to the boids own system of course.
* Relations define other systems as "neutral", "friend" or "enemy".
- All effectors now effect boid physics, not boid brains.
* This allows forcing boids somewhere.
* Exception to this is new "boid" effector, which defines boid predators (positive strength) and goals (negative strength).
Known issue:
- Boid health isn't yet stored in pointcache so simulations with "fight" rule are not be read from cache properly.
- Object/Group visualization object's animation is not played in "particle time". This is definately the wanted behavior, but isn't possible with the current state of dupliobject code.
Other new features:
- Particle systems can now be named separately from particle settings.
* Default name for particle settings is now "ParticleSettings" instead of "PSys"
- Per particle system list of particle effector weights.
* Enables different effection strengths for particles from different particle systems with without messing around with effector group setting.
Other code changes:
- KDTree now supports range search as it's needed for new boids.
- "Keyed particle targets" renamed as general "particle targets", as they're needed for boids too. (this might break some files saved with new keyed particles)
Bug fixes:
- Object & group visualizations didn't work.
- Interpolating pointcache didn't do rotation.
(it's the 3rd commit in a row. But as they say, the 3rd is always a charm ;)
I still think we have a little mess with the DEFINE parameters in BGE (as in RAS_IRasterizer::StereoMode).
We used to have them duplicated and hardcoded in 2.4xx, but I think we can do it in another way now.
(I didn't change gameplayer, but I can do it once we have it linking and building properly)
Changed order of panels in scene buttons to better follow order of importance, putting the post-processing options further down.
Cleaned up game physics properties
Logic Panel:
- world settings (moved from world)
... that includes physic engine selection + gravity
- game player (from gamesettings, it wasn't wrapped)
- stereo/dome (from gamesettings, it wasn't wrapped)
... separated stereom into stereoflag and stereomode
- properties
... (didn't touch it)
Buttons Game Panel:
(wip panel)
- Physics (moved from Logic Panel)
... it will be a datablock in the future (right Campbell ?)
- Material Physics (not currently implemented)
... a datablock link to the materials of an object + the dynamic physic variables
* NOTE:
in readfile.c::do_version I couldn't do if(scene->world). There is something wrong with scenes with an unlinked world. So so far we are ignoring the old values....
Constraints:
* Adding constraints with targets should now work.
-- (When no target is provided, the code to create a new target is not yet in place again yet)
* Constraints can be added in Object and PoseModes again using the Ctrl-Shift-C hotkey.
* All constraints can now be cleared from the active Object or selected Bones using the Ctrl-Alt-C hotkey.
* Added warnings when adding constraints invalid for the current context, and removed the old add_constraint() function.
* Buttons window updates correctly after adding keyframes now
Keyframes Drawing:
* Removed un-necessary extra function-call for RB-Tree implementation, by inlining a special one-off case.
* Keyframe diamonds which are not within the viewable area are now not drawn (but filtering will still need to find them).