Surprising this wasnt noticed in a much more obvious case:
- Key Location, Move, Rotate, Undo-Rotate >> Resets to keyed location as well.
This was happening because DAG_on_load_update() was called on read_undosave(), flagging 'ob->adt->recalc |= ADT_RECALC_ANIM;'
Fix by adding an option to DAG_on_load_update(), not to recalculate time flags.
Using scrollwheel on properties window halted when it was over
a list-button. Now it disables handling wheel events when you use
scrollwheel outside of lists first.
Implementation note: UI event handlers have priority over other
keymaps. That's OK. In this case it's simple conflict, for which
no design solution exists... wouldn't know how to do this nicer!
Code is nice local and can be improved when we look into other
conflicts...
After using loop-cut with multiple edges, transform widget
disappeared. Reason was a variable being set in function
not being called on cancelled operators. Now it's in Posttrans()
Multi-layer images: clicking on the "Source" popup freed all memory
for multilayers, even when choosing the same "File" entry again.
Now it should work :)
Problem/Bug:
------------
There were no way to have proper unicode characters (e.g. Japanese) in Blender Game Engine. Now we can :)
You can see a sample here: http://blog.mikepan.com/multi-language-support-in-blender/
Functionality Explanation:
--------------------------
This patch converts the Blender Font Objects to a new BGE type: KX_FontObject
This object inherits KX_GameObject.cpp and has the following properties:
- text (the text of the object)
- size (taken from the Blender object, usually is 1.0)
- resolution (1.0 by default, maybe not really needed, but at least for debugging/the time being it's nice to have)
The way we deal with linked objects is different than Blender. In Blender the text and size are a property of the Text databock. Therefore linked objects necessarily share the same text (and size, although the size of the object datablock affects that too). In BGE they are stored and accessed per object. Without that it would be problematic to have addObject adding texts that don't share the same data.
Known problems/limitations/ToDo:
--------------------------------
1) support for packed font and the <builtin>
2) figure why some fonts are displayed in a different size in 3DView/BGE (BLF)
3) investigate some glitches I see some times
4) support for multiline
5) support for more Blender Font Object options (text aligment, text boxes, ...)
[1] Diego (bdiego) evantually will help on that. For the time being we are using the "default" (ui) font to replace the <builtin>.
[2] but not all of them. I need to cross check who is calculating the size/dpi in/correctly - Blender or BLF. (e.g. fonts that work well - MS Gothic)
[3] I think this may be related to the resolution we are drawing the font
[4] It can't/will not be handled inside BFL. So the way I see it is to implement a mini text library/api that works as a middlelayer between the drawing step and BLF.
So instead of:
BLF_draw(fontid, (char *)text, strlen(text));
We would do:
MAGIC_ROUTINE_IM_NOT_BLF_draw(fontir, (char *)text, styleflag, width, height);
[5] don't hold your breath ... but if someone wants to have fun in the holidays the (4) and (5) are part of the same problem.
Code Explanation:
-----------------
The patch should be simple to read. They are three may parts:
1) BL_BlenderDataConversion.cpp:: converts the OB_FONT object into a KX_FontObject.cpp and store it in the KX_Scene->m_fonts
2) KetsjiEngine.cpp::RenderFonts:: loop through the texts and call their internal drawing routine.
3) KX_FontObject.cpp::
a) constructor: load the font of the object, and store other values.
b) DrawText: calculate the aspect for the given size (sounds hacky but this is how blf works) and call the render routine in RenderTools
4) KX_BlenderGL.cpp (called from rendertools) ::BL_print_game_line:: Draws the text. Using the BLF API
*) In order to handle visibility of the object added with AddObject I'm adding to the m_scene.m_fonts list only the Fonts in a visible layer - unlike Cameras and Lamps where all the objects are added.
Acknowledgements:
----------------
Thanks Benoit for the review and adjustment suggestions.
Thanks Diego for the BFL expertise, patches and support (Latin community ftw)
Thanks my boss for letting me do part of this patch during work time. Good thing we are starting a project in a partnership with a Japanese Foundation and eventual will need unicode in BGE :) for more details on that - www.nereusprogram.org - let's call it the main sponsor of this "bug feature" ;)
Using RMB on menus to change hotkeys was broken.
- the input button was on a weird place outside menu, assign
would close pulldown, so you had to reopen to check
- ESC didn't close the button, but assigned ESC as hotkey.
This key is a protected key, and always should be escaping.
- Worst bug: if you used this on a 'user keymap' it removed
all entries from the map...
* Depsgraph wasn't updated properly for smoke flow collision object dependencies.
* Smoke also wasn't properly using the actual emission frame of the flow particles.
* There was a lot of bloated logic in some parts of particle code so this fix turned into a small scale cleanup operation.
** As a result particle updating and cache usage should be a bit more stable too.
Selecting graph keys would toggle channel selection if shift was held.
this was annoying when selecting 2+ unselected keys to have the channel change color each click.
Now set the channel based on the selection state of the point, as long as points are being selected the channel will stay selected too.
"Continuous grab": the boundary is now set to Area (editor), making it work
for operators started in other regions (like toolbar, or in quad view case)
Added support for working on delta transformations instead of plain
transform. this should help the fact that you cant randomize animated
objects (still need to check into that)
Removed minimun scale since it was not well done, need a stronger
version of this
Changing the edge crease median value often wouldn't result in the median value entered because of clamping from 0-1.
Now the median crease is applied by scaling the values up/down.
also add some simple checks to speed up updates,
- don't move verts or recalculate normals if only crease changes.
- don't apply crease changes if location is being edited.
Problem is is with operator redo which click-extrude exposed.
Check if redo operator can run, otherwise lock the UI and add a label that the operator doesn't support redo.
This is clunky but IMHO better then failing silently and leaving the user confused.
- Merged redo functions into ED_undo_operator_repeat(), code was duplicated in a few places.
- added WM_operator_repeat_check to check if WM_operator_repeat() can run, avoids an undo call when redo work.
Unrelated changes
- GHOST_SystemWin32.cpp set to utf8 encoding.
- cmake_consistency_check.py now checks source files are utf8.
Noise texture moved the edges of multires grids different, causing
tears in the mesh. Fixed with a call to re-stitch grids (but only done
if the brush texture is set to noise)
Submitted by Martijn Berger.
Make DocumentImporter class the actual IWriter implementation and move prototype to the header.
Group together functions that we should move out of the class.
No functional changes.
Graph Editor: "make selected channels visible" VKEY didn't
make unselected channels invisble.
What is left is that the active channel remains visible still.
Not sure if that's by design, for Joshua to answer.