Patch provided by Ricki Myers. Works quite obvious, see Theme editor too!
Notes about the provided code;
- The default syntax colors were screaming! Toned it down to match the
default dark on lightgrey background better.
- Added: initializing colors in saved themes (usiblender.c)
- The implementation of the button for this option was quite clumsy...
Blender UI options services this a lot easier.
(Same fixed for 'line numbers' option)
- Bracket matching now uses as color a mix of backdrop and the
selected-text color. Noticed my texteditor did it too...
-> I really miss comments in code describing a little bit the thought
process behind the code. Like a short introduction on this feature
in the top of the drawtext.c, little remarks on new functions.
ALso in patch tracker or the mailinglist no docs was mentioned?
-> drawtext.c now gets messy quickly... lack of overview, structure,
and confusing mix of personal coding styles.
For not-active supported code dangerous...
should disable that, since animation systems remain in their own local
system time. Framemap is only for playback!
Not doing this caused corrupt baking, bug #2531 reported it.
- Bug #2530
The MMB Transform constraint 'chooser' used projection code that didnt
work when zoomed in extreme. Needed a correction to scale projected
coordinate according zoomlevel.
- NKEY panel for objects: click on left/right side of scale button now
goes with increments of 0.1 (was 1.0)
- Moving window edges in Screen: prevented top header from becoming too
small due to grid-snapping. Was visible now with using Texture Font.
Armatures with > 100 bones can deliver a 'parent IK menu' that doesn't
fit on screen anymore. Fixed it with changes;
- when menu doesnt fit to right/left, it places it aligned to left hand
of window
- when more than 8 collums in a menu exist, it makes collums 25 items
instead of 20.
Also fixed for the popup menu on Bone parenting. On a 1280 screen we now
can have a menu with over 300 bones (even more when you zoom down the
buttons window a bit). Still not optimal, but at least it's less annoying.
CTRL+V on buttons
NKEY Panels
join mesh
join curve
editing buttons
boolean
vpaint
faceselect
Manipulator
Also; Transform() got in useless loop when you entered without anything
selected. Not sure why Martin recoded it this way... maybe as a first
step to handlerify it? For evil Python Aussie Bosses? :P
Fun, the error is in code committed by Kent Mein, in a patch provided by
Campbell, who also reported the bug. :)
There was a line that set ALL selected objects (on click) to become active,
in succession, in a loop... very bad.
Activating in Oops better be restricted to ctrl+click. Fixed!
Using as Pivot the "individual object centers" didn't do any rotation or
scaling in editmode. I think it was supposed to give some kind of
'connected' centers, for individual faces/edges rotate. That'll be some
more coding work to get to work. :)
Note: currently the 'baking' stores the entire animation system, which
makes further animation refining (or duplicating) useless for a Baked
SoftBody. You can even delete the entire anim system.
This can be presented as a feature too (saves slow armature stuff).
However, I might check on a 'relative' bake too.
problem is solved now. Drawing of markers is little bit hackish, because it is
neccessary to draw unselected markers at the first time (unselected marker can't
hide selected marker ... visual information about selection would be lost)
Using the Play button in timeline, now uses an event-driven system to
update the animation system and signal windows to redraw. Meaning the
full UI remains responsive!
Check the new Pulldown "Playback" to set which windows you like to see
updated. Same settings is used for LMB 'dragging' frames in Timeline.
Implementation notes;
- the Icon for 'Pause' (or stop) has to be made yet, I commit this from
my laptop... all was coded during a 2 x 5 hour train ride to germany
- the anim playback system (ALT+A too) now uses correct "frames per
second" as maximum speed. Buttons can be found in 3 places in the UI,
also added it as pulldown item
- The system works with 'screen handlers', which has been coded with
using Python (networked) events or verse in mind too. A doc on that
will follow.
- the buttons code has been made 'resistant' to animated UIs too,
preventing flashing of hilites.
- All subloops (like transform) stop playback, with exception of MMB
view manipulations.
As extra; found tweak to make Textured AA fonts draw without distortion.
Looks perfect here on laptop now (like Pixmap fonts) and is 20x faster.
- Splited off the event treatment into a fonction of its own
- Splited off the initialisation phase into a function of its own (will have to do it for the manipulator function too)
Calling transform now works like this:
initTransform(mode, context)
- possible post init calls, constraints mostly
Transform()
- eventually, the postTransform function, so that Transform is just a simple big loop which could in the end just be tied in the blender event system instead.
- Added a state variable in TransInfo to replace the ret_val local variable. Possible values are: TRANS_RUNNING, TRANS_CANCEL, TRANS_CONFIRM
- Tied MMB and the hotkey select for constraint together, so selecting an axis with MMB and pressing the axis key after that goes to local mode on that axis. Much less confusing.
Fixed an as of yet unreported bug, linked data objects which have materials
linked to object instead of data have to be exported as normal, they cannot
be instanciated, otherwise they will all share the same material.
BPY_python.dsp need some changes too (adding Font.c and Font.h) but I've got other changes in there that I can't commit, so someone else will have to update.
parented linked data lamps made the export crash.
fix for two bugs reported by Diego Pino, an endian issue with vertex colors,
and the plugin code didn't export multiple colorbands correctly.
Updated the ortho camera export code for the new Blender ortho camera model.
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events). Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab. Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default. "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type. Cancel the popup to leave the string button empty (link exists, but has no script assigned). A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown. With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View, but it's trivial to add for others. There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window. Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu. Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
print "a"
elif evt == Draw.LEFTMOUSE:
print "left mouse button"
else:
return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers. Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable. Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are. The tooltips may not be accepted either, since other menus don't use them. Opinions welcomed.
Transform on "ipo keys" gave crash on ESC, due to non initialized pointer.
(Martin; that idea to not calloc new data... grumble!)
Note; that's another Margarita for Randall, at the Figueroa pool. :)
- Mkey while ALT+A inserts markers.
Note for Matt; You forgot to check for 'val'. The delay in tuho I brought
back to max 1 frame. Delays are common in realtime gfx apps, the picture
you see is old, and its possible you press a key while next frame is
already drawing, and then it has to increase the frame value still... :)
- RMB escapes from anim playback
- on activate object, Timeline redraws too
- Added keyline drawing for Material Ipos. The CTRL+Page keys work with it.
Softbody:
- Renamed buttons to call "Spring constant" now "Stiff(ness)" and the
"Friction" became "Damping".
Martin; I've added calls like:
BIF_TransformSetUndo("Add Duplicate");
In advance of calling transform itself, to indicate that this is the
string name to be used for Undo, and also has to be done on ESC.
To make that possible I had to add a memset() to zero the global struct
TransInfo. Nicely done with if(Trans.mode==TRANS_INIT)
Not sure how this relates to setting constraints in advance... I always
found it tricky to work a non-initalized global struct. :)
- TimeLine: Marker grabbing works now. Use GKEY or select+drag, as usual
Holding CTRL will step with 1 second (corrected for ntsc dudes yes!)
Also added this in header pulldown
- Time values and Time grid draw fixed for Seconds display. It used to
draw steps of 2/5/10/20/50/100 etc. frames. Now does steps in seconds.
Again corrected for "Frames/Sec" value.
- "Frames/Sec" button redraws TimeLine, Secquencer, etc
- Bug fixed in editing Theme for TimeLine (was editing Image Select...)
- Added Grid color to Theme choices for Ipo, TimeLine, Sequencer, NLA,
Action, Sound. Was missing!
Works nice quick to rotate a group of Objects around a defined center,
without hassle with the 3d cursor. Especially for the 3D Manipulator.
In EditMode/PoseMode this option falls back to "Centroid", as does the
"Individual centers" option already.
Hope Martin likes this simple hack. :)
Also; added flag in constraint to denote whether its local or not. That
way its possible to:
- prevent local scale and rotate on multiple objects to change own position
- draw constraint lines cleaner
Implementation had some issues though, since:
a) Blender has no stats available that tells amount of selected edges
b) Bypassing the popup should be 100% accurate
b) Once you do that, the popup should actually only show possible
choices as well.
So! I've added a G.totedge and G.totedgesel, also being printed in the
info header. Using this variable the extrude popups could be limited too.
Also: made 'normal alignment' for edge-only selections work when the
normal wasn't pointing OK. Now it aligns the Z axis with the edge itself
Exact algorithm for choosing a 'normal' and 'plane' still is weak.
- On leaving editmode, it deleted the Baked result automatically. Since
that's an invisible and destructive ction, I've inserted an "OK?" menu
here for it.
- Particle Deflectors themselves cannot be a Softbody (or viceversa).
Added a LABEL button to denote this when a user tries to set that.
started loop with "->last" instead of "->first".
This caused old faces that should be deleted on extrude to remain there.
Thanks Jean-Luc for finding it!
* add some ENV = os.environ's here and there (help those who have msvc toolkit installed)
Note for OSX users: check from your config.opts the correct info for the precompiled ftgl lib is used.
provided by Campbell Barton, thanks mate! :)
Note; this tool gives quickly bad results... also errors printed in the
give_quad_verts call. Who likes to attack this!
- Added Ckey for 'center view around current frame'.
- Completed View pulldown menu with remainder of options.
- prevented negative scaled views when start > end frame