Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-11-19 13:55:07 +0300
committerTon Roosendaal <ton@blender.org>2005-11-19 13:55:07 +0300
commitec2e8d53801fad23e30294e28f1b83681d4d0f1f (patch)
tree7a73b33c1b5e8e6775b2b4791332653763e469ed /source/blender/src/drawarmature.c
parent97c13508ff67ed95eb9a87f3173992115bcd3f82 (diff)
Finally switched to porting UI stuff from tuhopuu!
This commit is based on the patch & cool design work of Matt. It includes the new Lamp drawing style, and replaces the Object center dots with a similar styled OpenGL drawn dot. Important side-note is that removing the old glDrawPixels() for centers or lamps will not only make Blender faster, but also prevents crashing on a couple of cheaper 3d cards (as reported for S3 and Intel on-board cards) Notes: - The new default only draws Object centers when selected or active. If you like to see them always, use the View Properties Panel. You can also save that in the .B.blend - The size for centers (and lamps) is in the User settings "View & Controls" - Unselected Lamps, and their offset lines from zero Z, are drawn in a new Theme color Changes and additions in Matt's patch: - Lamps and centers are drawn fixed size, in pixels. Also the 'sun' lamp draws screen aligned now. - Center dots now also draw in blue to denote Library linkage or to show that an Object has been linked to other scenes. - When objects are empty (no vertices) they will always draw a center dot. Otherwise these objects would never be selectable anymore! - Added theme setting for center size, and initialization - Removed the old redundant code for drawing centers - Cleanup of drawing routines, made center dots faster - Started removing calls to glBlendFunc(). Regular alpha drawing should become standard, and the (very) occasional exception should return this to default after usage.
Diffstat (limited to 'source/blender/src/drawarmature.c')
-rw-r--r--source/blender/src/drawarmature.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c
index 8834fa52514..e2edf634d30 100644
--- a/source/blender/src/drawarmature.c
+++ b/source/blender/src/drawarmature.c
@@ -1815,14 +1815,12 @@ static void draw_ghost_poses(Base *base)
}
-/* called from drawobject.c */
-void draw_armature(Base *base, int dt)
+/* called from drawobject.c, return 1 if nothing was drawn */
+int draw_armature(Base *base, int dt)
{
Object *ob= base->object;
bArmature *arm= ob->data;
-
- /* only set once */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ int retval= 0;
if(dt>OB_WIRE && arm->drawtype!=ARM_LINE) {
/* we use color for solid lighting */
@@ -1844,7 +1842,7 @@ void draw_armature(Base *base, int dt)
}
else{
/* Draw Pose */
- if(ob->pose) {
+ if(ob->pose && ob->pose->chanbase.first) {
/* drawing posemode selection indices or colors only in these cases */
if(G.f & G_PICKSEL) {
if(ob->flag & OB_POSEMODE) arm->flag |= ARM_POSEMODE;
@@ -1869,10 +1867,12 @@ void draw_armature(Base *base, int dt)
if(ob->flag & OB_POSEMODE)
BIF_ThemeColor(TH_WIRE); /* restore, for extra draw stuff */
}
+ else retval= 1;
}
/* restore */
glFrontFace(GL_CCW);
+ return retval;
}
/* *************** END Armature drawing ******************* */