From 60795c508ee8baa5e21dee7dd990a5276cc02176 Mon Sep 17 00:00:00 2001 From: Cinder Biscuits Date: Mon, 14 Apr 2014 23:08:50 +0000 Subject: OPEN-215: Replace deprecated call to kCGLRPTextureMemory with kCGLRPTextureMemoryMegabytes --- indra/llwindow/llopenglview-objc.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index b393a3796d..9155e59a1d 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -101,20 +101,20 @@ attributedStringInfo getSegments(NSAttributedString *str) - (unsigned long)getVramSize { CGLRendererInfoObj info = 0; - GLint vram_bytes = 0; + GLint vram_mbytes = 0; int num_renderers = 0; CGLError the_err = CGLQueryRendererInfo (CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &num_renderers); if(0 == the_err) { - CGLDescribeRenderer (info, 0, kCGLRPTextureMemory, &vram_bytes); + CGLDescribeRenderer (info, 0, kCGLRPTextureMemoryMegabytes, &vram_mbytes); CGLDestroyRendererInfo (info); } else { - vram_bytes = (256 << 20); + vram_mbytes = 256; } - return (unsigned long)vram_bytes / 1048576; // We need this in megabytes. + return (unsigned long)vram_mbytes; } - (void)viewDidMoveToWindow -- cgit v1.2.3 From 18556491335ce4d8b2c0469ec1e8ebff74e6a386 Mon Sep 17 00:00:00 2001 From: Cinder Biscuits Date: Wed, 6 Aug 2014 00:59:24 +0000 Subject: STORM-2053 - applicationShouldTerminate returns an NSApplicationTeminateReply, not NSApplicationDelegateReply --- indra/newview/llappdelegate-objc.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 988058aad3..aad5dbae7d 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -84,7 +84,7 @@ callWindowUnfocus(); } -- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender { if (!runMainLoop()) { -- cgit v1.2.3 From ca6103f57c452c9e3bb23a94899725d4f7ca8197 Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 6 Aug 2014 21:56:32 -0400 Subject: Fix for BUG-6895. This brings projector reflections more in line with the originally intended behavior of environment reflections. --- indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 0e6ab80d4d..c299d89455 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -323,7 +323,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 8d8a6c9dde..5094513e52 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -334,7 +334,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index c20e00163c..2117056b6c 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -347,7 +347,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*shadow*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb * shadow * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 7689b72d20..08f5438e8a 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -348,7 +348,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*shadow*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb * shadow * envIntensity; } } } -- cgit v1.2.3 From 2ffa387560d26acdd90a32321f593036fa36c294 Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 7 Aug 2014 16:50:36 -0400 Subject: Glossy reflections for projectors. --- .../app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 6 +++--- .../newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 6 +++--- .../app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 8 ++++---- .../newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index c299d89455..63ad6fa7c7 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -314,16 +314,16 @@ void main() stc /= stc.w; if (stc.z > 0.0) { - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); + float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 5094513e52..6d282115dd 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -324,17 +324,17 @@ void main() { stc.xy /= stc.w; - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); + float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 2117056b6c..d5bc56e27a 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -338,16 +338,16 @@ void main() if (stc.z > 0.0) { - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); + + stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb * shadow * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * shadow * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 08f5438e8a..56b01eff8c 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -338,17 +338,17 @@ void main() { stc.xy /= stc.w; - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); + float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb * shadow * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * shadow * envIntensity; } } } -- cgit v1.2.3 From 703be164cf4205117fa0e1adc9316fb77645ce25 Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 7 Aug 2014 17:27:34 -0400 Subject: Code cleanup for BUG-6898 --- .../app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 8 +++++--- .../newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 7 +++---- .../app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 8 ++++---- .../newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 7 +++---- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 63ad6fa7c7..62acbbf36b 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -311,12 +311,14 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - stc /= stc.w; + if (stc.z > 0.0) { - float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); + stc /= stc.w; + + //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); - stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); + //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 6d282115dd..10b47291e3 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -322,12 +322,11 @@ void main() if (stc.z > 0.0) { - stc.xy /= stc.w; + stc /= stc.w; - float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); + //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); + //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index d5bc56e27a..dd99c029e6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -334,13 +334,14 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - stc /= stc.w; if (stc.z > 0.0) { - float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); + stc /= stc.w; - stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); + //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); + + //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && @@ -352,7 +353,6 @@ void main() } } } - //not sure why, but this line prevents MATBUG-194 col = max(col, vec3(0.0)); diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 56b01eff8c..acf474c489 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -336,12 +336,11 @@ void main() if (stc.z > 0.0) { - stc.xy /= stc.w; + stc /= stc.w; - float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); + //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); + //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && -- cgit v1.2.3 From e2370f6f2d6c794f74622b379321fafd60f8e8ff Mon Sep 17 00:00:00 2001 From: Pell Smit Date: Thu, 14 Aug 2014 15:20:58 +0900 Subject: fixed: inline backspace bug --- indra/llwindow/llopenglview-objc.mm | 71 +++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 017ea3769c..e07fc2bd42 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -472,31 +472,58 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange { - if ([aString class] == NSClassFromString(@"NSConcreteMutableAttributedString")) + // Apple says aString can be either an NSString or NSAttributedString instance. + // But actually it's NSConcreteMutableAttributedString or __NSCFConstantString. + // I observed aString was __NSCFConstantString only aString was null string(zero length). + // Apple also says when aString is an NSString object, + // the receiver is expected to render the marked text with distinguishing appearance. + // So I tried to make attributedStringInfo, but it won't be used... (Pell Smit) + + if (mMarkedTextAllowed) { - if (mMarkedTextAllowed) + unsigned int selected[2] = { + selectedRange.location, + selectedRange.length + }; + + unsigned int replacement[2] = { + replacementRange.location, + replacementRange.length + }; + + int string_length = [aString length]; + unichar text[string_length]; + attributedStringInfo segments; + // I used 'respondsToSelector:@selector(string)' + // to judge aString is an attributed string or not. + if ([aString respondsToSelector:@selector(string)]) + { + // aString is attibuted + [[aString string] getCharacters:text range:NSMakeRange(0, string_length)]; + segments = getSegments((NSAttributedString *)aString); + } + else + { + // aString is not attributed + [aString getCharacters:text range:NSMakeRange(0, string_length)]; + segments.seg_lengths.push_back(string_length); + segments.seg_standouts.push_back(true); + } + setMarkedText(text, selected, replacement, string_length, segments); + if (string_length > 0) { - unsigned int selected[2] = { - selectedRange.location, - selectedRange.length - }; - - unsigned int replacement[2] = { - replacementRange.location, - replacementRange.length - }; - - unichar text[[aString length]]; - [[aString mutableString] getCharacters:text range:NSMakeRange(0, [aString length])]; - attributedStringInfo segments = getSegments((NSAttributedString *)aString); - setMarkedText(text, selected, replacement, [aString length], segments); mHasMarkedText = TRUE; - mMarkedTextLength = [aString length]; - } else { - if (mHasMarkedText) - { - [self unmarkText]; - } + mMarkedTextLength = string_length; + } + else + { + // we must clear the marked text when aString is null. + [self unmarkText]; + } + } else { + if (mHasMarkedText) + { + [self unmarkText]; } } } -- cgit v1.2.3 From bef17f2af78c9f351ecbe80740ae71a61985d06e Mon Sep 17 00:00:00 2001 From: Pell Smit Date: Thu, 14 Aug 2014 15:21:53 +0900 Subject: fixed: modifier key bug --- indra/llwindow/llopenglview-objc.mm | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index e07fc2bd42..76eefbf5b1 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -270,14 +270,14 @@ attributedStringInfo getSegments(NSAttributedString *str) !([theEvent modifierFlags] & NSFunctionKeyMask) && !([theEvent modifierFlags] & NSHelpKeyMask)) { - callRightMouseDown(mMousePos, mModifiers); + callRightMouseDown(mMousePos, [theEvent modifierFlags]); mSimulatedRightClick = true; } else { if ([theEvent clickCount] >= 2) { - callDoubleClick(mMousePos, mModifiers); + callDoubleClick(mMousePos, [theEvent modifierFlags]); } else if ([theEvent clickCount] == 1) { - callLeftMouseDown(mMousePos, mModifiers); + callLeftMouseDown(mMousePos, [theEvent modifierFlags]); } } } @@ -286,21 +286,21 @@ attributedStringInfo getSegments(NSAttributedString *str) { if (mSimulatedRightClick) { - callRightMouseUp(mMousePos, mModifiers); + callRightMouseUp(mMousePos, [theEvent modifierFlags]); mSimulatedRightClick = false; } else { - callLeftMouseUp(mMousePos, mModifiers); + callLeftMouseUp(mMousePos, [theEvent modifierFlags]); } } - (void) rightMouseDown:(NSEvent *)theEvent { - callRightMouseDown(mMousePos, mModifiers); + callRightMouseDown(mMousePos, [theEvent modifierFlags]); } - (void) rightMouseUp:(NSEvent *)theEvent { - callRightMouseUp(mMousePos, mModifiers); + callRightMouseUp(mMousePos, [theEvent modifierFlags]); } - (void)mouseMoved:(NSEvent *)theEvent @@ -341,12 +341,12 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) otherMouseDown:(NSEvent *)theEvent { - callMiddleMouseDown(mMousePos, mModifiers); + callMiddleMouseDown(mMousePos, [theEvent modifierFlags]); } - (void) otherMouseUp:(NSEvent *)theEvent { - callMiddleMouseUp(mMousePos, mModifiers); + callMiddleMouseUp(mMousePos, [theEvent modifierFlags]); } - (void) otherMouseDragged:(NSEvent *)theEvent @@ -366,12 +366,18 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) keyUp:(NSEvent *)theEvent { - callKeyUp([theEvent keyCode], mModifiers); + callKeyUp([theEvent keyCode], [theEvent modifierFlags]); } - (void) keyDown:(NSEvent *)theEvent { uint keycode = [theEvent keyCode]; + // We must not depend on flagsChange event to detect modifier flags changed, + // must depend on the modifire flags in the event parameter. + // Because flagsChange event handler misses event when other window is activated, + // e.g. OS Window for upload something or Input Window... + // mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit) + mModifiers = [theEvent modifierFlags]; bool acceptsText = mHasMarkedText ? false : callKeyDown(keycode, mModifiers); if (acceptsText && !mMarkedTextAllowed && @@ -398,11 +404,6 @@ attributedStringInfo getSegments(NSAttributedString *str) } } -- (void)flagsChanged:(NSEvent *)theEvent { - mModifiers = [theEvent modifierFlags]; - callModifier([theEvent modifierFlags]); -} - - (BOOL) acceptsFirstResponder { return YES; -- cgit v1.2.3 From ebd94bf07a02beee8fbf84ec172bcbf1ac3d475f Mon Sep 17 00:00:00 2001 From: Pell Smit Date: Fri, 15 Aug 2014 03:52:22 +0900 Subject: fixed: unwanted input window on OSX --- indra/llwindow/llopenglview-objc.mm | 11 +++++------ indra/llwindow/llwindowmacosx.cpp | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 76eefbf5b1..7b562e3382 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -379,15 +379,14 @@ attributedStringInfo getSegments(NSAttributedString *str) // mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit) mModifiers = [theEvent modifierFlags]; bool acceptsText = mHasMarkedText ? false : callKeyDown(keycode, mModifiers); + unichar ch; if (acceptsText && !mMarkedTextAllowed && + !(mModifiers & (NSControlKeyMask | NSCommandKeyMask)) && // commands don't invoke InputWindow ![(LLAppDelegate*)[NSApp delegate] romanScript] && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDeleteCharacter && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSBackspaceCharacter && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDownArrowFunctionKey && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSUpArrowFunctionKey && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSLeftArrowFunctionKey && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSRightArrowFunctionKey) + (ch = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]) > ' ' && + ch != NSDeleteCharacter && + (ch < 0xF700 || ch > 0xF8FF)) // 0xF700-0xF8FF: reserved for function keys on the keyboard(from NSEvent.h) { [(LLAppDelegate*)[NSApp delegate] showInputWindow:true withEvent:theEvent]; } else diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 18d5152015..75900c3cb4 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1805,8 +1805,6 @@ static long getDictLong (CFDictionaryRef refDict, CFStringRef key) void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) { - allowDirectMarkedTextInput(b, mGLView); - if (preeditor != mPreeditor && !b) { // This condition may occur by a call to @@ -1836,6 +1834,7 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) return; } mLanguageTextInputAllowed = b; + allowDirectMarkedTextInput(b, mGLView); // mLanguageTextInputAllowed and mMarkedTextAllowed should be updated at once (by Pell Smit } void LLWindowMacOSX::interruptLanguageTextInput() -- cgit v1.2.3 From ce7e8eb95276ed1407c5bf6f98ac5b9784abc473 Mon Sep 17 00:00:00 2001 From: Pell Smit Date: Thu, 14 Aug 2014 15:19:19 +0900 Subject: fixed: bad behavior of input window --- indra/llwindow/llopenglview-objc.h | 1 + indra/llwindow/llopenglview-objc.mm | 62 ++++++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index f1fab3b2c6..072d40f739 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -79,6 +79,7 @@ @interface LLNonInlineTextView : NSTextView { LLOpenGLView *glview; + unichar mKeyPressed; } - (void) setGLView:(LLOpenGLView*)view; diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 7b562e3382..b5983504f5 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -642,37 +642,63 @@ attributedStringInfo getSegments(NSAttributedString *str) @implementation LLNonInlineTextView +/* Input Window is a legacy of 20 century, so we want to remove related classes. + But unfortunately, Viwer web browser has no support for modern inline input, + we need to leave these classes... + We will be back to get rid of Input Window after fixing viewer web browser. + + How Input Window should work: + 1) Input Window must not be empty. + It must close when it become empty result of edithing. + 2) Input Window must not close when it still has input data. + It must keep open user types next char before commit. by Pell Smit +*/ + - (void) setGLView:(LLOpenGLView *)view { glview = view; } -- (void) insertText:(id)insertString +- (void)keyDown:(NSEvent *)theEvent { - [[self inputContext] discardMarkedText]; - [self setString:@""]; - [_window orderOut:_window]; - [self insertText:insertString replacementRange:NSMakeRange(0, [insertString length])]; + // mKeyPressed is used later to determine whethere Input Window should close or not + mKeyPressed = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]; + // setMarkedText and insertText is called indirectly from inside keyDown: method + [super keyDown:theEvent]; } -- (void) insertText:(id)aString replacementRange:(NSRange)replacementRange +// setMarkedText: is called for incomplete input(on the way to conversion). +- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange { - [glview insertText:aString replacementRange:replacementRange]; + [super setMarkedText:aString selectedRange:selectedRange replacementRange:replacementRange]; + if ([aString length] == 0) // this means Input Widow becomes empty + { + [_window orderOut:_window]; // Close this to avoid empty Input Window + } } -- (void) insertNewline:(id)sender +// insertText: is called for inserting commited text. +// There are two ways to be called here: +// a) explicitly commited (must close) +// In case of user typed commit key(usually return key) or delete key or something +// b) automatically commited (must not close) +// In case of user typed next letter after conversion +- (void) insertText:(id)aString replacementRange:(NSRange)replacementRange { - [[self textStorage] setValue:@""]; - [[self inputContext] discardMarkedText]; + [[self inputContext] discardMarkedText]; [self setString:@""]; -} - -- (void)doCommandBySelector:(SEL)aSelector -{ - if (aSelector == @selector(insertNewline:)) - { - [self insertNewline:self]; - } + [glview insertText:aString replacementRange:replacementRange]; + if (mKeyPressed == NSEnterCharacter || + mKeyPressed == NSBackspaceCharacter || + mKeyPressed == NSTabCharacter || + mKeyPressed == NSNewlineCharacter || + mKeyPressed == NSCarriageReturnCharacter || + mKeyPressed == NSDeleteCharacter || + (mKeyPressed >= 0xF700 && mKeyPressed <= 0xF8FF)) + { + // this is case a) of above comment + [_window orderOut:_window]; // to avoid empty Input Window + } } @end -- cgit v1.2.3 From b99d57fbdeda3f012e090bb610f9d3fb44f4248f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 23 Oct 2014 06:20:10 -0400 Subject: MAINT-4196 WIP, including clearer inventory warnings for attachment errors --- indra/newview/llappearancemgr.cpp | 7 ++++++- indra/newview/llinventorybridge.cpp | 20 ++++++++++++-------- indra/newview/llviewerinventory.cpp | 16 ++++++++++++---- indra/newview/llviewerinventory.h | 6 ++++-- indra/newview/llvoavatarself.cpp | 18 +++++++++++++++--- indra/newview/llvoavatarself.h | 2 +- indra/newview/llwearableitemslist.cpp | 10 ++++++++-- indra/newview/skins/default/xui/en/strings.xml | 8 ++++++-- 8 files changed, 64 insertions(+), 23 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 29534a4382..fba2b9d3a4 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2699,7 +2699,12 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointergetIsLinkType() && item->getLinkedUUID() == item_id) { - remove_inventory_item(item->getUUID(), cb); + bool immediate_delete = false; + if (item->getType() == LLAssetType::AT_OBJECT) + { + immediate_delete = true; + } + remove_inventory_item(item->getUUID(), cb, immediate_delete); } } } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 33e557cddd..1b44049067 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5326,16 +5326,20 @@ std::string LLObjectBridge::getLabelSuffix() const { return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); } - std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID); - if (attachment_point_name == LLStringUtil::null) // Error condition, invalid attach point + std::string attachment_point_name; + if (gAgentAvatarp->getAttachedPointName(mUUID, attachment_point_name)) { - attachment_point_name = "Invalid Attachment"; - } - // e.g. "(worn on ...)" / "(attached to ...)" - LLStringUtil::format_map_t args; - args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name); + LLStringUtil::format_map_t args; + args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name); - return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); + return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); + } + else + { + LLStringUtil::format_map_t args; + args["[ATTACHMENT_ERROR]"] = LLTrans::getString(attachment_point_name); + return LLItemBridge::getLabelSuffix() + LLTrans::getString("AttachmentErrorMessage", args); + } } return LLItemBridge::getLabelSuffix(); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 4e4c3471be..39267e8834 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1450,7 +1450,8 @@ void update_inventory_category( void remove_inventory_items( LLInventoryObject::object_list_t& items_to_kill, - LLPointer cb) + LLPointer cb + ) { for (LLInventoryObject::object_list_t::iterator it = items_to_kill.begin(); it != items_to_kill.end(); @@ -1462,12 +1463,13 @@ void remove_inventory_items( void remove_inventory_item( const LLUUID& item_id, - LLPointer cb) + LLPointer cb, + bool immediate_delete) { LLPointer obj = gInventory.getItem(item_id); if (obj) { - remove_inventory_item(obj, cb); + remove_inventory_item(obj, cb, immediate_delete); } else { @@ -1477,7 +1479,8 @@ void remove_inventory_item( void remove_inventory_item( LLPointer obj, - LLPointer cb) + LLPointer cb, + bool immediate_delete) { if(obj) { @@ -1487,6 +1490,11 @@ void remove_inventory_item( { LLPointer cmd_ptr = new RemoveItemCommand(item_id, cb); cmd_ptr->run_command(); + + if (immediate_delete) + { + gInventory.onObjectDeletedFromServer(item_id); + } } else // no cap { diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index d345c49cfb..ca92565600 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -394,11 +394,13 @@ void remove_inventory_items( void remove_inventory_item( LLPointer obj, - LLPointer cb); + LLPointer cb, + bool immediate_delete = false); void remove_inventory_item( const LLUUID& item_id, - LLPointer cb); + LLPointer cb, + bool immediate_delete = false); void remove_inventory_category( const LLUUID& cat_id, diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 42a7c2e576..ccc30c448d 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1093,9 +1093,19 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id) return NULL; } -const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const +bool LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const { + if (!gInventory.getItem(inv_item_id)) + { + name = "ATTACHMENT_MISSING_ITEM"; + return false; + } const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id); + if (!gInventory.getItem(base_inv_item_id)) + { + name = "ATTACHMENT_MISSING_BASE_ITEM"; + return false; + } for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -1103,11 +1113,13 @@ const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id const LLViewerJointAttachment* attachment = iter->second; if (attachment->getAttachedObject(base_inv_item_id)) { - return attachment->getName(); + name = attachment->getName(); + return true; } } - return LLStringUtil::null; + name = "ATTACHMENT_NOT_ATTACHED"; + return false; } //virtual diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index e03de9fa0b..369c15d0f9 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -293,7 +293,7 @@ public: void addAttachmentRequest(const LLUUID& inv_item_id); void removeAttachmentRequest(const LLUUID& inv_item_id); LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); - const std::string getAttachedPointName(const LLUUID& inv_item_id) const; + bool getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const; /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object); static BOOL detachAttachmentIntoInventory(const LLUUID& item_id); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index ca60b79f9d..fac0fd63ee 100755 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -364,8 +364,14 @@ void LLPanelAttachmentListItem::updateItem(const std::string& name, LLViewerInventoryItem* inv_item = getItem(); if (inv_item && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(inv_item->getLinkedUUID())) { - std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID())); - title_joint = title_joint + " (" + joint + ")"; + std::string found_name; + bool found = gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID(),found_name); + std::string trans_name = LLTrans::getString(found_name); + if (!found) + { + LL_WARNS() << "invalid attachment joint, err " << found_name << LL_ENDL; + } + title_joint = title_joint + " (" + trans_name + ")"; } LLPanelInventoryListItemBase::updateItem(title_joint, item_state); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 5dcb8e2cdf..945a77c071 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2307,6 +2307,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. Loading contents... No contents + Yes @@ -2433,9 +2434,12 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. Stomach Left Pec Right Pec - Neck - Avatar Center + Neck + Avatar Center Invalid Attachment Point + Error: missing item + Error: missing base item + Error: object is in current outfit but not attached [AGEYEARS] [AGEMONTHS] old -- cgit v1.2.3 From aa96b808981d9453c49d749308a98173ce1864bb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 15 Aug 2014 10:38:46 -0400 Subject: MAINT-4158 WIP - fix for at least some forms of distortion. I can't repro the drastic height changes, so not positive it addresses that. --- indra/llcharacter/lljoint.cpp | 4 ++-- indra/newview/llvoavatar.cpp | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index dbd6d48a95..c78c38c3a7 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -275,7 +275,7 @@ void LLJoint::storeScaleForReset( const LLVector3& scale ) //-------------------------------------------------------------------- void LLJoint::restoreOldXform( void ) { - mXform = mDefaultXform; + mXform = mOldXform; mResetAfterRestoreOldXform = false; mDirtyFlags = ALL_DIRTY; } @@ -432,7 +432,7 @@ const LLMatrix4 &LLJoint::getWorldMatrix() //-------------------------------------------------------------------- void LLJoint::setWorldMatrix( const LLMatrix4& mat ) { -LL_INFOS() << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << LL_ENDL; + LL_INFOS() << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << LL_ENDL; // extract global translation LLVector3 trans( mat.mMatrix[VW][VX], mat.mMatrix[VW][VY], diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 22b979aa09..6987f69b7e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7676,6 +7676,15 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara } } + avatar_joint_list_t::iterator iter = mSkeleton.begin(); + avatar_joint_list_t::iterator end = mSkeleton.end(); + for (; iter != end; ++iter) + { + LLJoint* pJoint = (*iter); + const LLVector3& pos = pJoint->getPosition(); + apr_file_printf( file, "\t\t\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2]); + } + apr_file_printf( file, "\t\n" ); apr_file_printf( file, "\n\n" ); -- cgit v1.2.3 From ba95b8badea1fe97546a050d9fa2ccffe3983a1e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 15 Aug 2014 15:50:51 -0400 Subject: more joint info in ArchetypeXML dump file --- indra/newview/llvoavatar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6987f69b7e..c32a44b779 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7682,7 +7682,9 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara { LLJoint* pJoint = (*iter); const LLVector3& pos = pJoint->getPosition(); - apr_file_printf( file, "\t\t\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2]); + const LLVector3& scale = pJoint->getScale(); + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); } apr_file_printf( file, "\t\n" ); -- cgit v1.2.3 From fc0d618c2f3489e62b28d6e83978d39ea70c1e7e Mon Sep 17 00:00:00 2001 From: Whirly Date: Wed, 20 Aug 2014 23:41:33 +0100 Subject: STORM-2078 Editing an objects rotation with the rotation rings often causes the object to jump to position <0,0,0> on the region and rotation changes to <0,0,0> --- indra/newview/llmaniprotate.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 7861573908..50863ac970 100755 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1241,9 +1241,9 @@ LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y ) LLVector3 axis = mMouseDown % mMouseCur; axis.normVec(); - F32 angle = acos(mMouseDown * mMouseCur); + F32 angle = atan2(sqrtf(axis * axis), mMouseDown * mMouseCur); LLQuaternion sphere_rot( angle, axis ); - + if (is_approx_zero(1.f - mMouseDown * mMouseCur)) { return LLQuaternion::DEFAULT; @@ -1638,9 +1638,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) mInSnapRegime = FALSE; } - angle = acos(mMouseCur * mMouseDown); - - F32 dir = (mMouseDown % mMouseCur) * constraint_axis; // cross product + LLVector3 cross_product = mMouseDown % mMouseCur; + angle = atan2(sqrtf(cross_product * cross_product), mMouseCur * mMouseDown); + F32 dir = cross_product * constraint_axis; // cross product if( dir < 0.f ) { angle *= -1.f; -- cgit v1.2.3 From 5634cc990d71d34e330f87e838be44f60f496bd9 Mon Sep 17 00:00:00 2001 From: Whirly Date: Thu, 21 Aug 2014 01:07:26 +0100 Subject: STORM-2078 Make atan2() work with the unnormalized axis --- indra/newview/llmaniprotate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 50863ac970..b2350e5a75 100755 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1240,8 +1240,8 @@ LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y ) F32 dist_from_sphere_center = sqrt(delta_x * delta_x + delta_y * delta_y); LLVector3 axis = mMouseDown % mMouseCur; - axis.normVec(); F32 angle = atan2(sqrtf(axis * axis), mMouseDown * mMouseCur); + axis.normVec(); LLQuaternion sphere_rot( angle, axis ); if (is_approx_zero(1.f - mMouseDown * mMouseCur)) -- cgit v1.2.3 From b67bff90369ada09f9f30055bebd49af3906565f Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 21 Aug 2014 13:08:24 -0400 Subject: Removal of commented out code. --- .../newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 4 ---- indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 4 ---- .../newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 4 ---- indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 4 ---- 4 files changed, 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 62acbbf36b..39613c2872 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -315,10 +315,6 @@ void main() if (stc.z > 0.0) { stc /= stc.w; - - //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 10b47291e3..b8cb6b6491 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -323,10 +323,6 @@ void main() if (stc.z > 0.0) { stc /= stc.w; - - //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index dd99c029e6..7a0641084e 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -338,10 +338,6 @@ void main() if (stc.z > 0.0) { stc /= stc.w; - - //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index acf474c489..a61e66e0fa 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -337,10 +337,6 @@ void main() if (stc.z > 0.0) { stc /= stc.w; - - //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5); if (stc.x < 1.0 && stc.y < 1.0 && -- cgit v1.2.3 From 79bb641310775c56cb742c5ea938d5681117585c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 21 Aug 2014 14:18:35 -0400 Subject: MAINT-4158 WIP - fix for bug caused by multiple wearables with the same asset id --- indra/llappearance/llavatarappearance.cpp | 21 +++++++++++++++++++++ indra/newview/llagentwearables.cpp | 5 +++++ indra/newview/llvoavatar.cpp | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 6fdf9e2e07..c1107f674e 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -480,6 +480,18 @@ void LLAvatarAppearance::computeBodySize() knee.mV[VZ] * hip_scale.mV[VZ] - ankle.mV[VZ] * knee_scale.mV[VZ] - foot.mV[VZ] * ankle_scale.mV[VZ]; + // if (isSelf()) + // { + // LL_INFOS("Avatar") << "mAvatarOffset.mV[VZ] " << mAvatarOffset.mV[VZ] << LL_ENDL; + // LL_INFOS("Avatar") << "mPelvisToFoot " << mPelvisToFoot << LL_ENDL; + // LL_INFOS("Avatar") << "- hip.mV[VZ] " << hip.mV[VZ] << LL_ENDL; + // LL_INFOS("Avatar") << "- pelvis_scale.mV[VZ] " << pelvis_scale.mV[VZ] << LL_ENDL; + // LL_INFOS("Avatar") << "- knee.mV[VZ] " << knee.mV[VZ] << LL_ENDL; + // LL_INFOS("Avatar") << "- ankle.mV[VZ] " << ankle.mV[VZ] << LL_ENDL; + // LL_INFOS("Avatar") << "- knee_scale.mV[VZ] " << knee_scale.mV[VZ] << LL_ENDL; + // LL_INFOS("Avatar") << "- foot.mV[VZ] " << foot.mV[VZ] << LL_ENDL; + // LL_INFOS("Avatar") << "- ankle_scale.mV[VZ] " << ankle_scale.mV[VZ] << LL_ENDL; + // } LLVector3 new_body_size; new_body_size.mV[VZ] = mPelvisToFoot + @@ -490,6 +502,10 @@ void LLAvatarAppearance::computeBodySize() neck.mV[VZ] * chest_scale.mV[VZ] + chest.mV[VZ] * torso_scale.mV[VZ] + torso.mV[VZ] * pelvis_scale.mV[VZ]; + // if (isSelf()) + // { + // LL_INFOS("Avatar") << "new_body_size.mV[VZ] " << new_body_size.mV[VZ] << LL_ENDL; + // } // TODO -- measure the real depth and width new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH; @@ -502,6 +518,11 @@ void LLAvatarAppearance::computeBodySize() { mBodySize = new_body_size; } + + // if (isSelf()) + // { + // LL_INFOS("Avatar") << "mBodySize.mV[VZ] " << mBodySize.mV[VZ] << LL_ENDL; + // } } //----------------------------------------------------------------------------- diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 49fedb8df8..3928bbadc8 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1009,6 +1009,10 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it continue; } + // Don't care about this case - ordering of wearables with the same asset id has no effect. + // Causes the two-alphas error case in MAINT-4158. + // We should actually disallow wearing two wearables with the same asset id. +#if 0 if (curr_wearable->getName() != new_item->getName() || curr_wearable->getItemID() != new_item->getUUID()) { @@ -1019,6 +1023,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it mismatched++; continue; } +#endif // If we got here, everything matches. matched++; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c32a44b779..53da1dbfb8 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5625,7 +5625,7 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o } //----------------------------------------------------------------------------- -// attachObject() +// getNumAttachments() //----------------------------------------------------------------------------- U32 LLVOAvatar::getNumAttachments() const { -- cgit v1.2.3 From 33f66ac2344f996a2310b179173232b98c8bd026 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Aug 2014 16:52:52 -0400 Subject: WIP on attachment offset management in joints --- indra/llcharacter/lljoint.cpp | 82 +++++++++++++++++++++++---------- indra/llcharacter/lljoint.h | 29 +++++++++--- indra/newview/llfloatermodelpreview.cpp | 3 +- indra/newview/llviewerobject.cpp | 11 +++++ indra/newview/llviewerobject.h | 2 + indra/newview/llvoavatar.cpp | 14 +++--- indra/newview/llvoavatar.h | 2 +- indra/newview/llvovolume.cpp | 4 +- 8 files changed, 105 insertions(+), 42 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index c78c38c3a7..f6e95fdc8d 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -52,7 +52,6 @@ void LLJoint::init() mOldXform.setScale(LLVector3(1.0f, 1.0f, 1.0f)); mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY; mUpdateXform = TRUE; - mResetAfterRestoreOldXform = false; } LLJoint::LLJoint() : @@ -245,7 +244,7 @@ void LLJoint::setPosition( const LLVector3& pos ) //-------------------------------------------------------------------- -// setPosition() +// setDefaultFromCurrentXform() //-------------------------------------------------------------------- void LLJoint::setDefaultFromCurrentXform( void ) { @@ -253,14 +252,62 @@ void LLJoint::setDefaultFromCurrentXform( void ) } //-------------------------------------------------------------------- -// storeCurrentXform() +// addAttachmentPosOverride() //-------------------------------------------------------------------- -void LLJoint::storeCurrentXform( const LLVector3& pos ) -{ - mOldXform = mXform; - mResetAfterRestoreOldXform = true; - setPosition( pos ); - touch(ALL_DIRTY); +void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const std::string& attachment_name ) +{ + if (attachment_name.empty()) + { + return; + } + if (m_attachmentOverrides.empty()) + { + LL_WARNS() << "saving m_posBeforeOverrides " << getPosition() << LL_ENDL; + m_posBeforeOverrides = getPosition(); + } + AttachmentOverrideRecord rec; + rec.name = attachment_name; + rec.pos = pos; + m_attachmentOverrides[attachment_name] = rec; + LL_WARNS() << "addAttachmentPosOverride for " << attachment_name << " pos " << pos << LL_ENDL; + updatePos(); +} + +//-------------------------------------------------------------------- +// removeAttachmentPosOverride() +//-------------------------------------------------------------------- +void LLJoint::removeAttachmentPosOverride( const std::string& attachment_name ) +{ + if (attachment_name.empty()) + { + return; + } + attachment_map_t::iterator it = m_attachmentOverrides.find(attachment_name); + if (it != m_attachmentOverrides.end()) + { + LL_WARNS() << "removeAttachmentPosOverride for " << attachment_name << LL_ENDL; + m_attachmentOverrides.erase(it); + } + updatePos(); +} + +void LLJoint::updatePos() +{ + LLVector3 pos; + attachment_map_t::iterator it = std::max_element(m_attachmentOverrides.begin(), + m_attachmentOverrides.end()); + if (it != m_attachmentOverrides.end()) + { + AttachmentOverrideRecord& rec = it->second; + LL_WARNS() << "updatePos, winner is attachment " << rec.name << " pos " << rec.pos << LL_ENDL; + pos = rec.pos; + } + else + { + LL_WARNS() << "updatePos, winner is posBeforeOverrides " << m_posBeforeOverrides << LL_ENDL; + pos = m_posBeforeOverrides; + } + setPosition(pos); } //-------------------------------------------------------------------- @@ -276,7 +323,6 @@ void LLJoint::storeScaleForReset( const LLVector3& scale ) void LLJoint::restoreOldXform( void ) { mXform = mOldXform; - mResetAfterRestoreOldXform = false; mDirtyFlags = ALL_DIRTY; } //-------------------------------------------------------------------- @@ -325,7 +371,7 @@ void LLJoint::setWorldPosition( const LLVector3& pos ) //-------------------------------------------------------------------- -// mXform.getRotation() +// getRotation() //-------------------------------------------------------------------- const LLQuaternion& LLJoint::getRotation() { @@ -548,20 +594,6 @@ void LLJoint::clampRotation(LLQuaternion old_rot, LLQuaternion new_rot) break; } } - - // 2003.03.26 - This code was just using up cpu cycles. AB - -// LLVector3 old_axis = main_axis * old_rot; -// LLVector3 new_axis = main_axis * new_rot; - -// for (S32 i = 0; i < mConstraintSilhouette.size() - 1; i++) -// { -// LLVector3 vert1 = mConstraintSilhouette[i]; -// LLVector3 vert2 = mConstraintSilhouette[i + 1]; - - // figure out how to clamp rotation to line on 3-sphere - -// } } // End diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index b65d6979d4..f6f1cd2fe4 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -88,8 +88,6 @@ public: U32 mDirtyFlags; BOOL mUpdateXform; - BOOL mResetAfterRestoreOldXform; - // describes the skin binding pose LLVector3 mSkinOffset; @@ -103,6 +101,25 @@ public: static S32 sNumTouches; static S32 sNumUpdates; + struct AttachmentOverrideRecord + { + AttachmentOverrideRecord() + { + } + LLVector3 pos; + std::string name; + + bool operator<(const AttachmentOverrideRecord& other) const + { + return name < other.name; + } + }; + typedef std::map attachment_map_t; + attachment_map_t m_attachmentOverrides; + LLVector3 m_posBeforeOverrides; + + void updatePos(); + public: LLJoint(); LLJoint(S32 joint_num); @@ -188,15 +205,13 @@ public: void setDefaultFromCurrentXform( void ); void storeCurrentXform( const LLVector3& pos ); + void addAttachmentPosOverride( const LLVector3& pos, const std::string& attachment_name ); + void removeAttachmentPosOverride( const std::string& attachment_name ); + //Accessor for the joint id LLUUID getId( void ) { return mId; } //Setter for the joints id void setId( const LLUUID& id ) { mId = id;} - - //If the old transform flag has been set, then the reset logic in avatar needs to be aware(test) of it - const BOOL doesJointNeedToBeReset( void ) const { return mResetAfterRestoreOldXform; } - void setJointResetFlag( bool val ) { mResetAfterRestoreOldXform = val; } - }; #endif // LL_LLJOINT_H diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index b17ce97a2e..039ff848cb 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1935,7 +1935,8 @@ bool LLModelLoader::doLoadModel() LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint ); if ( pJoint ) { - pJoint->storeCurrentXform( jointTransform.getTranslation() ); + LL_WARNS() << "Aieee, now what!" << LL_ENDL; + //pJoint->storeCurrentXform( jointTransform.getTranslation() ); } else { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 4f992fc184..97cefaf33c 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -6193,6 +6193,17 @@ const LLUUID &LLViewerObject::extractAttachmentItemID() return getAttachmentItemID(); } +const std::string& LLViewerObject::getAttachmentItemName() +{ + static std::string empty; + LLInventoryItem *item = gInventory.getItem(getAttachmentItemID()); + if (isAttachment() && item) + { + return item->getName(); + } + return empty; +} + //virtual LLVOAvatar* LLViewerObject::getAvatar() const { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index bab107cc57..22ac4ce0db 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -170,6 +170,8 @@ public: void setOnActiveList(BOOL on_active) { mOnActiveList = on_active; } virtual BOOL isAttachment() const { return FALSE; } + const std::string& getAttachmentItemName(); + virtual LLVOAvatar* getAvatar() const; //get the avatar this object is attached to, or NULL if object is not an attachment virtual BOOL isHUDAttachment() const { return FALSE; } virtual BOOL isTempAttachment() const; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 53da1dbfb8..6bd6570589 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5058,9 +5058,9 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) return jointp; } //----------------------------------------------------------------------------- -// resetJointPositionsToDefault +// resetJointPositionsOnDetach //----------------------------------------------------------------------------- -void LLVOAvatar::resetJointPositionsToDefault( void ) +void LLVOAvatar::resetJointPositionsOnDetach(const std::string& attachment_name) { //Subsequent joints are relative to pelvis avatar_joint_list_t::iterator iter = mSkeleton.begin(); @@ -5072,17 +5072,16 @@ void LLVOAvatar::resetJointPositionsToDefault( void ) { LLJoint* pJoint = (*iter); //Reset joints except for pelvis - if ( pJoint && pJoint != pJointPelvis && pJoint->doesJointNeedToBeReset() ) + if ( pJoint && pJoint != pJointPelvis) { pJoint->setId( LLUUID::null ); - pJoint->restoreOldXform(); + pJoint->removeAttachmentPosOverride(attachment_name); } else - if ( pJoint && pJoint == pJointPelvis && pJoint->doesJointNeedToBeReset() ) + if ( pJoint && pJoint == pJointPelvis) { pJoint->setId( LLUUID::null ); pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); - pJoint->setJointResetFlag( false ); } } @@ -5746,7 +5745,8 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig && pSkinData->mAlternateBindMatrix.size() > 0 ) { - LLVOAvatar::resetJointPositionsToDefault(); + const std::string& attachment_name = pVO->getAttachmentItemName(); + LLVOAvatar::resetJointPositionsOnDetach(attachment_name); //Need to handle the repositioning of the cam, updating rig data etc during outfit editing //This handles the case where we detach a replacement rig. if ( gAgentCamera.cameraCustomizeAvatar() ) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 42ff7bff92..66a357ff62 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -199,7 +199,7 @@ public: virtual LLJoint* getJoint(const std::string &name); - void resetJointPositionsToDefault( void ); + void resetJointPositionsOnDetach(const std::string& attachment_name); /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a83e2e020e..0ef48c4c70 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4626,7 +4626,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //Set the joint position - pJoint->storeCurrentXform( jointPos ); + const std::string& attachment_name = drawablep->getVObj()->getAttachmentItemName(); + //pJoint->storeCurrentXform( jointPos ); + pJoint->addAttachmentPosOverride( jointPos, attachment_name ); //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) -- cgit v1.2.3 From 2cb14c7fdcf835816176d6edc0c05b99bcb39873 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 Aug 2014 17:32:22 -0400 Subject: MAINT-4158 WIP - track position overrides requested by attachments so they can be undone intelligently --- indra/llappearance/llavatarappearance.cpp | 2 +- indra/llappearance/llpolyskeletaldistortion.cpp | 2 +- indra/llcharacter/lljoint.cpp | 56 +++++++++++-------------- indra/llcharacter/lljoint.h | 17 +------- indra/newview/llfloatermodelpreview.cpp | 3 +- indra/newview/llvovolume.cpp | 3 +- 6 files changed, 31 insertions(+), 52 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index c1107f674e..9904f454d6 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -605,7 +605,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent info->mRot.mV[VZ], LLQuaternion::XYZ)); joint->setScale(info->mScale); - joint->setDefaultFromCurrentXform(); + //joint->setDefaultFromCurrentXform(); if (info->mIsJoint) { diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index ea29cbd451..fbc312c426 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -213,7 +213,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) LLVector3 scaleDelta = iter->second; newScale = newScale + (effective_weight * scaleDelta) - (mLastWeight * scaleDelta); //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached - joint->storeScaleForReset( newScale ); + // needed? // joint->storeScaleForReset( newScale ); joint->setScale(newScale); } diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index f6e95fdc8d..bad9c198ad 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -36,6 +36,20 @@ S32 LLJoint::sNumUpdates = 0; S32 LLJoint::sNumTouches = 0; + +//----------------------------------------------------------------------------- +// LLJoint::AttachmentOverrideRecord::AttachmentOverrideRecord() +//----------------------------------------------------------------------------- +LLJoint::AttachmentOverrideRecord::AttachmentOverrideRecord() +{ +} + +template +bool attachment_map_iter_compare_name(const T& a, const T& b) +{ + return a.second.name < b.second.name; +} + //----------------------------------------------------------------------------- // LLJoint() // Class Constructor @@ -48,8 +62,6 @@ void LLJoint::init() mParent = NULL; mXform.setScaleChildOffset(TRUE); mXform.setScale(LLVector3(1.0f, 1.0f, 1.0f)); - mOldXform.setScaleChildOffset(TRUE); - mOldXform.setScale(LLVector3(1.0f, 1.0f, 1.0f)); mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY; mUpdateXform = TRUE; } @@ -242,15 +254,6 @@ void LLJoint::setPosition( const LLVector3& pos ) touch(MATRIX_DIRTY | POSITION_DIRTY); } - -//-------------------------------------------------------------------- -// setDefaultFromCurrentXform() -//-------------------------------------------------------------------- -void LLJoint::setDefaultFromCurrentXform( void ) -{ - mDefaultXform = mXform; -} - //-------------------------------------------------------------------- // addAttachmentPosOverride() //-------------------------------------------------------------------- @@ -262,14 +265,14 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const std::string& } if (m_attachmentOverrides.empty()) { - LL_WARNS() << "saving m_posBeforeOverrides " << getPosition() << LL_ENDL; + LL_DEBUGS("Avatar") << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL; m_posBeforeOverrides = getPosition(); } AttachmentOverrideRecord rec; rec.name = attachment_name; rec.pos = pos; m_attachmentOverrides[attachment_name] = rec; - LL_WARNS() << "addAttachmentPosOverride for " << attachment_name << " pos " << pos << LL_ENDL; + LL_DEBUGS("Avatar") << getName() << " addAttachmentPosOverride for " << attachment_name << " pos " << pos << LL_ENDL; updatePos(); } @@ -285,46 +288,35 @@ void LLJoint::removeAttachmentPosOverride( const std::string& attachment_name ) attachment_map_t::iterator it = m_attachmentOverrides.find(attachment_name); if (it != m_attachmentOverrides.end()) { - LL_WARNS() << "removeAttachmentPosOverride for " << attachment_name << LL_ENDL; + LL_DEBUGS("Avatar") << getName() << " removeAttachmentPosOverride for " << attachment_name << LL_ENDL; m_attachmentOverrides.erase(it); } updatePos(); } +//-------------------------------------------------------------------- +// updatePos() +//-------------------------------------------------------------------- void LLJoint::updatePos() { LLVector3 pos; attachment_map_t::iterator it = std::max_element(m_attachmentOverrides.begin(), - m_attachmentOverrides.end()); + m_attachmentOverrides.end(), + attachment_map_iter_compare_name); if (it != m_attachmentOverrides.end()) { AttachmentOverrideRecord& rec = it->second; - LL_WARNS() << "updatePos, winner is attachment " << rec.name << " pos " << rec.pos << LL_ENDL; + LL_DEBUGS("Avatar") << getName() << " updatePos, winner of " << m_attachmentOverrides.size() << " is attachment " << rec.name << " pos " << rec.pos << LL_ENDL; pos = rec.pos; } else { - LL_WARNS() << "updatePos, winner is posBeforeOverrides " << m_posBeforeOverrides << LL_ENDL; + LL_DEBUGS("Avatar") << getName() << " updatePos, winner is posBeforeOverrides " << m_posBeforeOverrides << LL_ENDL; pos = m_posBeforeOverrides; } setPosition(pos); } -//-------------------------------------------------------------------- -// storeScaleForReset() -//-------------------------------------------------------------------- -void LLJoint::storeScaleForReset( const LLVector3& scale ) -{ - mOldXform.setScale( scale ); -} -//-------------------------------------------------------------------- -// restoreOldXform() -//-------------------------------------------------------------------- -void LLJoint::restoreOldXform( void ) -{ - mXform = mOldXform; - mDirtyFlags = ALL_DIRTY; -} //-------------------------------------------------------------------- // getWorldPosition() //-------------------------------------------------------------------- diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index f6f1cd2fe4..0ef054d9c1 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -79,8 +79,6 @@ protected: // explicit transformation members LLXformMatrix mXform; - LLXformMatrix mOldXform; - LLXformMatrix mDefaultXform; LLUUID mId; @@ -103,16 +101,9 @@ public: struct AttachmentOverrideRecord { - AttachmentOverrideRecord() - { - } + AttachmentOverrideRecord(); LLVector3 pos; std::string name; - - bool operator<(const AttachmentOverrideRecord& other) const - { - return name < other.name; - } }; typedef std::map attachment_map_t; attachment_map_t m_attachmentOverrides; @@ -177,7 +168,7 @@ public: // get/set local scale const LLVector3& getScale(); void setScale( const LLVector3& scale ); - void storeScaleForReset( const LLVector3& scale ); + // get/set world matrix const LLMatrix4 &getWorldMatrix(); void setWorldMatrix( const LLMatrix4& mat ); @@ -200,10 +191,6 @@ public: virtual BOOL isAnimatable() const { return TRUE; } S32 getJointNum() const { return mJointNum; } - - void restoreOldXform( void ); - void setDefaultFromCurrentXform( void ); - void storeCurrentXform( const LLVector3& pos ); void addAttachmentPosOverride( const LLVector3& pos, const std::string& attachment_name ); void removeAttachmentPosOverride( const std::string& attachment_name ); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 039ff848cb..93c18c5c8b 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1935,7 +1935,8 @@ bool LLModelLoader::doLoadModel() LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint ); if ( pJoint ) { - LL_WARNS() << "Aieee, now what!" << LL_ENDL; + pJoint->addAttachmentPosOverride( jointTransform.getTranslation(), mFilename); + //LL_WARNS() << "Aieee, now what!" << LL_ENDL; //pJoint->storeCurrentXform( jointTransform.getTranslation() ); } else diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 0ef48c4c70..0dc5ae5058 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4626,8 +4626,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //Set the joint position - const std::string& attachment_name = drawablep->getVObj()->getAttachmentItemName(); - //pJoint->storeCurrentXform( jointPos ); + const std::string& attachment_name = drawablep->getVObj()->getAttachmentItemName(); pJoint->addAttachmentPosOverride( jointPos, attachment_name ); //If joint is a pelvis then handle old/new pelvis to foot values -- cgit v1.2.3 From 807f4dff74ee08d86895ee3329e985bb898eae24 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 Aug 2014 17:37:25 -0400 Subject: MAINT-4158 WIP - comment change --- indra/llappearance/llavatarappearance.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 9904f454d6..6c3bde20ca 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -605,8 +605,6 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent info->mRot.mV[VZ], LLQuaternion::XYZ)); joint->setScale(info->mScale); - //joint->setDefaultFromCurrentXform(); - if (info->mIsJoint) { joint->setSkinOffset( info->mPivot ); -- cgit v1.2.3 From 19330025ba3108deb401fcc9e98e744ddf59affa Mon Sep 17 00:00:00 2001 From: Cinder Date: Sun, 31 Aug 2014 06:17:57 -0600 Subject: OPEN-268 - Add missing xml cases to file picker on linux and darwin --- indra/newview/llfilepicker.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 5debf71744..ef50594feb 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -600,6 +600,9 @@ std::vector* LLFilePicker::navOpenFilterProc(ELoadFilter filter) // allowedv->push_back("slg"); break; #endif + case FFLOAD_XML: + allowedv->push_back("xml"); + break; case FFLOAD_RAW: allowedv->push_back("raw"); break; @@ -702,7 +705,14 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena creator = "\?\?\?\?"; extension = "slg"; break; -#endif +#endif + + case FFSAVE_XML: + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "xml"; + break; + case FFSAVE_RAW: type = "\?\?\?\?"; creator = "\?\?\?\?"; @@ -1100,6 +1110,12 @@ static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker) return filtername; } +static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker) +{ + return add_simple_pattern_filter_to_gtkchooser(picker, "*.xml", + LLTrans::getString("xml_files") + " (*.xml)"); +} + static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker) { return add_simple_pattern_filter_to_gtkchooser(picker, "*.dae", @@ -1293,6 +1309,9 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) case FFLOAD_ANIM: filtername = add_anim_filter_to_gtkchooser(picker); break; + case FFLOAD_XML: + filtername = add_xml_filter_to_gtkchooser(picker); + break; case FFLOAD_COLLADA: filtername = add_collada_filter_to_gtkchooser(picker); break; -- cgit v1.2.3 From 0c34a92d43eb8ae4450df7e87f9d216648ebd50b Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 3 Sep 2014 19:56:46 -0400 Subject: Switch to using texture2DLodDiffuse for reasons of having a nice soft edge for less glossy projector reflections. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes far more sense than having the “spot” functionality, and opens projectors up to much more practical use cases and fits much better within the concept of glossy reflections than the previous spot behavior. --- .../newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 4 ++-- .../newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 39613c2872..34bd4a7e21 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -321,7 +321,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * envIntensity; + col += color.rgb * texture2DLodDiffuse(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index b8cb6b6491..38f383f0c4 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -138,7 +138,7 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) float d = dot(dist,dist); - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + ret *= min(clamp((0.125-d)/0.125, 0.0, 1.0)+det, 1.0); return ret; } @@ -329,7 +329,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * envIntensity; + col += color.rgb * texture2DLodDiffuse(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 7a0641084e..09cb195fa3 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -344,7 +344,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * shadow * envIntensity; + col += color.rgb * texture2DLodDiffuse(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * shadow * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index a61e66e0fa..3d0cbbcc4d 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -343,7 +343,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * shadow * envIntensity; + col += color.rgb * texture2DLodDiffuse(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * shadow * envIntensity; } } } -- cgit v1.2.3 From 5282e021abd94b3687c8aadfeab4fcad6e5ef348 Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 3 Sep 2014 22:13:01 -0400 Subject: Switch back to texture2dSpecular with a custom falloff dependent upon LOD. --- .../shaders/class1/deferred/multiSpotLightF.glsl | 16 ++++++++++------ .../shaders/class1/deferred/spotLightF.glsl | 18 +++++++++++------- .../shaders/class2/deferred/multiSpotLightF.glsl | 20 ++++++++++++-------- .../shaders/class2/deferred/spotLightF.glsl | 18 +++++++++++------- 4 files changed, 44 insertions(+), 28 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 34bd4a7e21..c08e9d361a 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -127,13 +127,17 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) vec4 ret = texture2DLod(projectionMap, tc, lod); ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -321,7 +325,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodDiffuse(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 38f383f0c4..f50635a139 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -130,15 +130,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.125-d)/0.125, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -329,7 +333,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodDiffuse(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 09cb195fa3..65bf08ee66 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); - - vec2 dist = tc-vec2(0.5); + ret.rgb = srgb_to_linear(ret.rgb); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -344,7 +348,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodDiffuse(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * shadow * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, ((1 - spec.a) * 2) * (proj_lod)).rgb * shadow * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 3d0cbbcc4d..3053315275 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -343,7 +347,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodDiffuse(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod * 0.5)).rgb * shadow * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod)).rgb * shadow * envIntensity; } } } -- cgit v1.2.3 From 5974a8eae5c76ac27fe1879145f764294af46ab8 Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 3 Sep 2014 22:33:41 -0400 Subject: Ensure projectors with shadows have the same mip level calculation as without shadows. --- indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 65bf08ee66..94bd07bec6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -348,7 +348,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, ((1 - spec.a) * 2) * (proj_lod)).rgb * shadow * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 3053315275..92e1ac95a6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -347,7 +347,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a * spec.a) * (proj_lod)).rgb * shadow * envIntensity; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; } } } -- cgit v1.2.3 From 2c0a0f4a5763d1f34ec1368dcc83ebb085c565e0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 5 Sep 2014 15:05:51 -0400 Subject: MAINT-4158 cleanup --- indra/llappearance/llavatarappearance.cpp | 21 --------------------- indra/newview/llfloatermodelpreview.cpp | 2 -- 2 files changed, 23 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 6c3bde20ca..c0ad8315af 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -480,18 +480,6 @@ void LLAvatarAppearance::computeBodySize() knee.mV[VZ] * hip_scale.mV[VZ] - ankle.mV[VZ] * knee_scale.mV[VZ] - foot.mV[VZ] * ankle_scale.mV[VZ]; - // if (isSelf()) - // { - // LL_INFOS("Avatar") << "mAvatarOffset.mV[VZ] " << mAvatarOffset.mV[VZ] << LL_ENDL; - // LL_INFOS("Avatar") << "mPelvisToFoot " << mPelvisToFoot << LL_ENDL; - // LL_INFOS("Avatar") << "- hip.mV[VZ] " << hip.mV[VZ] << LL_ENDL; - // LL_INFOS("Avatar") << "- pelvis_scale.mV[VZ] " << pelvis_scale.mV[VZ] << LL_ENDL; - // LL_INFOS("Avatar") << "- knee.mV[VZ] " << knee.mV[VZ] << LL_ENDL; - // LL_INFOS("Avatar") << "- ankle.mV[VZ] " << ankle.mV[VZ] << LL_ENDL; - // LL_INFOS("Avatar") << "- knee_scale.mV[VZ] " << knee_scale.mV[VZ] << LL_ENDL; - // LL_INFOS("Avatar") << "- foot.mV[VZ] " << foot.mV[VZ] << LL_ENDL; - // LL_INFOS("Avatar") << "- ankle_scale.mV[VZ] " << ankle_scale.mV[VZ] << LL_ENDL; - // } LLVector3 new_body_size; new_body_size.mV[VZ] = mPelvisToFoot + @@ -502,10 +490,6 @@ void LLAvatarAppearance::computeBodySize() neck.mV[VZ] * chest_scale.mV[VZ] + chest.mV[VZ] * torso_scale.mV[VZ] + torso.mV[VZ] * pelvis_scale.mV[VZ]; - // if (isSelf()) - // { - // LL_INFOS("Avatar") << "new_body_size.mV[VZ] " << new_body_size.mV[VZ] << LL_ENDL; - // } // TODO -- measure the real depth and width new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH; @@ -518,11 +502,6 @@ void LLAvatarAppearance::computeBodySize() { mBodySize = new_body_size; } - - // if (isSelf()) - // { - // LL_INFOS("Avatar") << "mBodySize.mV[VZ] " << mBodySize.mV[VZ] << LL_ENDL; - // } } //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 93c18c5c8b..195a7f5ffe 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1936,8 +1936,6 @@ bool LLModelLoader::doLoadModel() if ( pJoint ) { pJoint->addAttachmentPosOverride( jointTransform.getTranslation(), mFilename); - //LL_WARNS() << "Aieee, now what!" << LL_ENDL; - //pJoint->storeCurrentXform( jointTransform.getTranslation() ); } else { -- cgit v1.2.3 From 20a7cceb50bf4e5d238575c2180683ee4eb19b38 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 7 Oct 2014 16:29:45 -0400 Subject: track avatar size info in avatar debug line --- indra/newview/llvoavatar.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6bd6570589..b483a3e452 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3212,6 +3212,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { debug_line += llformat(" - cof rcv:%d", last_received_cof_version); } + debug_line += llformat(" bsz-z: %f avofs-z: %f", mBodySize[2], mAvatarOffset[2]); addDebugText(debug_line); } if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) -- cgit v1.2.3 From b6ad3bd54dd4d48a0b984bc92a31bab7c9f90e75 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 8 Oct 2014 11:45:12 -0400 Subject: Switched to keying joint offsets by mesh id --- indra/llcharacter/lljoint.cpp | 35 ++++++++++++++++----------------- indra/llcharacter/lljoint.h | 9 ++++----- indra/newview/llfloatermodelpreview.cpp | 4 +++- indra/newview/llvoavatar.cpp | 8 ++++---- indra/newview/llvoavatar.h | 2 +- indra/newview/llvovolume.cpp | 4 ++-- 6 files changed, 31 insertions(+), 31 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index bad9c198ad..97293bf134 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -45,9 +45,9 @@ LLJoint::AttachmentOverrideRecord::AttachmentOverrideRecord() } template -bool attachment_map_iter_compare_name(const T& a, const T& b) +bool attachment_map_iter_compare_key(const T& a, const T& b) { - return a.second.name < b.second.name; + return a.first < b.first; } //----------------------------------------------------------------------------- @@ -257,61 +257,60 @@ void LLJoint::setPosition( const LLVector3& pos ) //-------------------------------------------------------------------- // addAttachmentPosOverride() //-------------------------------------------------------------------- -void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const std::string& attachment_name ) +void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info ) { - if (attachment_name.empty()) + if (mesh_id.isNull()) { return; } if (m_attachmentOverrides.empty()) { - LL_DEBUGS("Avatar") << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL; m_posBeforeOverrides = getPosition(); } AttachmentOverrideRecord rec; - rec.name = attachment_name; rec.pos = pos; - m_attachmentOverrides[attachment_name] = rec; - LL_DEBUGS("Avatar") << getName() << " addAttachmentPosOverride for " << attachment_name << " pos " << pos << LL_ENDL; - updatePos(); + m_attachmentOverrides[mesh_id] = rec; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL; + updatePos(av_info); } //-------------------------------------------------------------------- // removeAttachmentPosOverride() //-------------------------------------------------------------------- -void LLJoint::removeAttachmentPosOverride( const std::string& attachment_name ) +void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info ) { - if (attachment_name.empty()) + if (mesh_id.isNull()) { return; } - attachment_map_t::iterator it = m_attachmentOverrides.find(attachment_name); + attachment_map_t::iterator it = m_attachmentOverrides.find(mesh_id); if (it != m_attachmentOverrides.end()) { - LL_DEBUGS("Avatar") << getName() << " removeAttachmentPosOverride for " << attachment_name << LL_ENDL; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL; m_attachmentOverrides.erase(it); } - updatePos(); + updatePos(av_info); } //-------------------------------------------------------------------- // updatePos() //-------------------------------------------------------------------- -void LLJoint::updatePos() +void LLJoint::updatePos(const std::string& av_info) { LLVector3 pos; attachment_map_t::iterator it = std::max_element(m_attachmentOverrides.begin(), m_attachmentOverrides.end(), - attachment_map_iter_compare_name); + attachment_map_iter_compare_key); if (it != m_attachmentOverrides.end()) { AttachmentOverrideRecord& rec = it->second; - LL_DEBUGS("Avatar") << getName() << " updatePos, winner of " << m_attachmentOverrides.size() << " is attachment " << rec.name << " pos " << rec.pos << LL_ENDL; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " updatePos, winner of " << m_attachmentOverrides.size() << " is mesh " << it->first << " pos " << rec.pos << LL_ENDL; pos = rec.pos; } else { - LL_DEBUGS("Avatar") << getName() << " updatePos, winner is posBeforeOverrides " << m_posBeforeOverrides << LL_ENDL; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " updatePos, winner is posBeforeOverrides " << m_posBeforeOverrides << LL_ENDL; pos = m_posBeforeOverrides; } setPosition(pos); diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 0ef054d9c1..951cafad94 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -103,13 +103,12 @@ public: { AttachmentOverrideRecord(); LLVector3 pos; - std::string name; }; - typedef std::map attachment_map_t; + typedef std::map attachment_map_t; attachment_map_t m_attachmentOverrides; LLVector3 m_posBeforeOverrides; - void updatePos(); + void updatePos(const std::string& av_info); public: LLJoint(); @@ -192,8 +191,8 @@ public: S32 getJointNum() const { return mJointNum; } - void addAttachmentPosOverride( const LLVector3& pos, const std::string& attachment_name ); - void removeAttachmentPosOverride( const std::string& attachment_name ); + void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info ); + void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info ); //Accessor for the joint id LLUUID getId( void ) { return mId; } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 195a7f5ffe..73bf7f3e23 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1935,7 +1935,9 @@ bool LLModelLoader::doLoadModel() LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint ); if ( pJoint ) { - pJoint->addAttachmentPosOverride( jointTransform.getTranslation(), mFilename); + LLUUID fake_mesh_id; + fake_mesh_id.generate(); + pJoint->addAttachmentPosOverride( jointTransform.getTranslation(), fake_mesh_id, gAgentAvatarp->avString()); } else { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b483a3e452..5ca9120f25 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5061,7 +5061,7 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) //----------------------------------------------------------------------------- // resetJointPositionsOnDetach //----------------------------------------------------------------------------- -void LLVOAvatar::resetJointPositionsOnDetach(const std::string& attachment_name) +void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id) { //Subsequent joints are relative to pelvis avatar_joint_list_t::iterator iter = mSkeleton.begin(); @@ -5076,7 +5076,7 @@ void LLVOAvatar::resetJointPositionsOnDetach(const std::string& attachment_name) if ( pJoint && pJoint != pJointPelvis) { pJoint->setId( LLUUID::null ); - pJoint->removeAttachmentPosOverride(attachment_name); + pJoint->removeAttachmentPosOverride(mesh_id, avString()); } else if ( pJoint && pJoint == pJointPelvis) @@ -5746,8 +5746,8 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig && pSkinData->mAlternateBindMatrix.size() > 0 ) { - const std::string& attachment_name = pVO->getAttachmentItemName(); - LLVOAvatar::resetJointPositionsOnDetach(attachment_name); + const LLUUID& mesh_id = pSkinData->mMeshID; + LLVOAvatar::resetJointPositionsOnDetach(mesh_id); //Need to handle the repositioning of the cam, updating rig data etc during outfit editing //This handles the case where we detach a replacement rig. if ( gAgentCamera.cameraCustomizeAvatar() ) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 66a357ff62..cd9fa30bc9 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -199,7 +199,7 @@ public: virtual LLJoint* getJoint(const std::string &name); - void resetJointPositionsOnDetach(const std::string& attachment_name); + void resetJointPositionsOnDetach(const LLUUID& mesh_id); /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 0dc5ae5058..4c21203c43 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4626,8 +4626,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //Set the joint position - const std::string& attachment_name = drawablep->getVObj()->getAttachmentItemName(); - pJoint->addAttachmentPosOverride( jointPos, attachment_name ); + const LLUUID& mesh_id = pSkinData->mMeshID; + pJoint->addAttachmentPosOverride( jointPos, mesh_id, pAvatarVO->avString() ); //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) -- cgit v1.2.3 From 94510864b123164eff0101f63c69acf673397e97 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 14 Oct 2014 10:41:11 -0400 Subject: Code style cleanups... mostly fixed indenting --- indra/newview/llvoavatar.cpp | 274 +++++++++++++++++++++---------------------- 1 file changed, 131 insertions(+), 143 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 22b979aa09..4d2f7ff922 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -464,7 +464,10 @@ public: mCharacter = character; BOOL success = true; - if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) { success = false; } + if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) + { + success = false; + } if ( success ) { @@ -819,14 +822,14 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c //------------------------------------------------------------------------ LLVOAvatar::~LLVOAvatar() { - if (!mFullyLoaded) - { + if (!mFullyLoaded) + { debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); - } - else - { + } + else + { debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding"); - } + } logPendingPhases(); @@ -980,10 +983,11 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* inst = (LLVOAvatar*) *iter; - if (!inst) - continue; - S32 rez_status = inst->getRezzedStatus(); - counts[rez_status]++; + if (inst) + { + S32 rez_status = inst->getRezzedStatus(); + counts[rez_status]++; + } } } @@ -1353,38 +1357,36 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { LLViewerJointAttachment* attachment = iter->second; - if (!attachment->getValid()) - { - continue ; - } - - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) + if (attachment->getValid()) { - const LLViewerObject* attached_object = (*attachment_iter); - if (attached_object && !attached_object->isHUDAttachment()) + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - LLDrawable* drawable = attached_object->mDrawable; - if (drawable && !drawable->isState(LLDrawable::RIGGED)) + const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isHUDAttachment()) { - LLSpatialBridge* bridge = drawable->getSpatialBridge(); - if (bridge) + LLDrawable* drawable = attached_object->mDrawable; + if (drawable && !drawable->isState(LLDrawable::RIGGED)) { - const LLVector4a* ext = bridge->getSpatialExtents(); - LLVector4a distance; - distance.setSub(ext[1], ext[0]); - LLVector4a max_span(max_attachment_span); + LLSpatialBridge* bridge = drawable->getSpatialBridge(); + if (bridge) + { + const LLVector4a* ext = bridge->getSpatialExtents(); + LLVector4a distance; + distance.setSub(ext[1], ext[0]); + LLVector4a max_span(max_attachment_span); - S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; + S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; - // Only add the prim to spatial extents calculations if it isn't a megaprim. - // max_attachment_span calculated at the start of the function - // (currently 5 times our max prim size) - if (lt == 0x7) - { - update_min_max(newMin,newMax,ext[0]); - update_min_max(newMin,newMax,ext[1]); + // Only add the prim to spatial extents calculations if it isn't a megaprim. + // max_attachment_span calculated at the start of the function + // (currently 5 times our max prim size) + if (lt == 0x7) + { + update_min_max(newMin,newMax,ext[0]); + update_min_max(newMin,newMax,ext[1]); + } } } } @@ -1961,7 +1963,7 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, if (has_name && getNVPair("FirstName")) { mDebugExistenceTimer.reset(); - debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); + debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); } if(retval & LLViewerObject::INVALID_UPDATE) @@ -1973,9 +1975,6 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, } } - //LL_INFOS() << getRotation() << LL_ENDL; - //LL_INFOS() << getPosition() << LL_ENDL; - return retval; } @@ -1991,7 +1990,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU result = gTextureList.findImage(uuid); } if (!result) -{ + { const std::string url = getImageURL(te,uuid); if (url.empty()) @@ -3335,7 +3334,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) removeAnimationData("Walk Speed"); } mMotionController.setTimeStep(time_step); -// LL_INFOS() << "Setting timestep to " << time_quantum * pixel_area_scale << LL_ENDL; + // LL_INFOS() << "Setting timestep to " << time_quantum * pixel_area_scale << LL_ENDL; } if (getParent() && !mIsSitting) @@ -3476,7 +3475,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) fwdDir.normalize(); } } - } LLQuaternion root_rotation = mRoot->getWorldMatrix().quaternion(); @@ -3592,10 +3590,14 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // update animations if (mSpecialRenderMode == 1) // Animation Preview + { updateMotions(LLCharacter::FORCE_UPDATE); + } else + { updateMotions(LLCharacter::NORMAL_UPDATE); - + } + // update head position updateHeadOffset(); @@ -3692,10 +3694,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) //mesh vertices need to be reskinned mNeedsSkin = TRUE; - - - - return TRUE; } //----------------------------------------------------------------------------- @@ -3975,13 +3973,13 @@ U32 LLVOAvatar::renderSkinned() if (face) { LLVertexBuffer* vb = face->getVertexBuffer(); - if (vb) - { - vb->flush(); + if (vb) + { + vb->flush(); + } } } } - } else { mNeedsSkin = FALSE; @@ -4161,7 +4159,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) { LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); if (hair_mesh) - { + { num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); } first_pass = FALSE; @@ -5213,8 +5211,8 @@ BOOL LLVOAvatar::loadSkeletonNode () { if (!LLAvatarAppearance::loadSkeletonNode()) { - return FALSE; - } + return FALSE; + } // ATTACHMENTS { @@ -5965,27 +5963,24 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const break; // Do nothing } - /* switch(type) - case LLWearableType::WT_SHIRT: - indicator_te = TEX_UPPER_SHIRT; */ for (LLAvatarAppearanceDictionary::Textures::const_iterator tex_iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); tex_iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); ++tex_iter) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_iter->second; if (texture_dict->mWearableType == type) - { + { // Thus, you must check to see if the corresponding baked texture is defined. // NOTE: this is a poor substitute if you actually want to know about individual pieces of clothing // this works for detecting a skirt (most important), but is ineffective at any piece of clothing that // gets baked into a texture that always exists (upper or lower). if (texture_dict->mIsUsedByBakedTexture) - { + { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); - } + } return FALSE; - } + } } return FALSE; } @@ -6055,7 +6050,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) } else if (global_color == mTexEyeColor) { -// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; + // LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet); } updateMeshTextures(); @@ -6115,9 +6110,9 @@ void LLVOAvatar::updateRezzedStatusTimers() { // load level has decreased. start phase timers for higher load levels. for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++) - { + { startPhase("load_" + LLVOAvatar::rezStatusToString(i)); - } + } } else if (rez_status > mLastRezzedStatus) { @@ -6126,16 +6121,15 @@ void LLVOAvatar::updateRezzedStatusTimers() { stopPhase("load_" + LLVOAvatar::rezStatusToString(i)); stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false); - } + } if (rez_status == 3) - { + { // "fully loaded", mark any pending appearance change complete. selfStopPhase("update_appearance_from_cof"); selfStopPhase("wear_inventory_category", false); selfStopPhase("process_initial_wearables_update", false); } } - mLastRezzedStatus = rez_status; } } @@ -6197,7 +6191,7 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check) void LLVOAvatar::logPendingPhases() { if (!isAgentAvatarValid()) - { + { return; } @@ -6213,14 +6207,14 @@ void LLVOAvatar::logPendingPhases() if (!completed) { logMetricsTimerRecord(phase_name, elapsed, completed); - } + } } } - } +} //static void LLVOAvatar::logPendingPhasesAllAvatars() - { +{ for (std::vector::iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter) { @@ -6231,14 +6225,14 @@ void LLVOAvatar::logPendingPhasesAllAvatars() } inst->logPendingPhases(); } - } +} void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapsed, bool completed) - { +{ if (!isAgentAvatarValid()) - { + { return; - } + } LLSD record; record["timer_name"] = phase_name; @@ -6247,10 +6241,10 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse record["completed"] = completed; U32 grid_x(0), grid_y(0); if (getRegion()) - { + { record["central_bake_version"] = LLSD::Integer(getRegion()->getCentralBakeVersion()); grid_from_region_handle(getRegion()->getHandle(), &grid_x, &grid_y); - } + } record["grid_x"] = LLSD::Integer(grid_x); record["grid_y"] = LLSD::Integer(grid_y); record["is_using_server_bakes"] = true; @@ -6311,8 +6305,8 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE); - if (!mPreviousFullyLoaded && !loading && mFullyLoaded) - { + if (!mPreviousFullyLoaded && !loading && mFullyLoaded) + { debugAvatarRezTime("AvatarRezNotification","fully loaded"); } @@ -6368,9 +6362,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) LLAvatarJointMesh* mesh = (*iter); if (mesh) { - { - mesh->setColor(color); - } + mesh->setColor(color); } } } @@ -6470,7 +6462,7 @@ void LLVOAvatar::updateMeshTextures() LLViewerTexLayerSet* layerset = getTexLayerSet(i); if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() ) - { + { LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID); mBakedTextureDatas[i].mIsUsed = TRUE; @@ -6479,12 +6471,12 @@ void LLVOAvatar::updateMeshTextures() avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); for (; iter != end; ++iter) - { + { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setTexture( baked_img ); - } + } } } else if (!isUsingLocalAppearance() && is_layer_baked[i]) @@ -6513,9 +6505,9 @@ void LLVOAvatar::updateMeshTextures() baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); - // this could add paused texture callbacks - mLoadedCallbacksPaused |= paused; - checkTextureLoading(); + // this could add paused texture callbacks + mLoadedCallbacksPaused |= paused; + checkTextureLoading(); } } else if (layerset && isUsingLocalAppearance()) @@ -6534,7 +6526,7 @@ void LLVOAvatar::updateMeshTextures() if (mesh) { mesh->setLayerSet( layerset ); - } + } } } else @@ -6556,7 +6548,7 @@ void LLVOAvatar::updateMeshTextures() { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( color ); mesh->setTexture( hair_img ); } @@ -6652,13 +6644,13 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin(); iter != mBakedTextureDatas[index].mMaskedMorphs.end(); ++iter) -{ + { const LLMaskedMorph* maskedMorph = (*iter); LLPolyMorphTarget* morph_target = dynamic_cast(maskedMorph->mMorphTarget); if (morph_target) - { + { morph_target->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert); -} + } } } @@ -6957,9 +6949,9 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, outfile.open(fullpath, LL_APR_WB ); apr_file_t* file = outfile.getFileHandle(); if (!file) - { - return; - } + { + return; + } else { LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << LL_ENDL; @@ -6994,7 +6986,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, apr_file_printf( file, "\t\t\n", i, uuid_str.c_str()); } apr_file_printf(file, "\n"); - } +} void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents) { @@ -7523,12 +7515,12 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); for (; iter != end; ++iter) - { + { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setTexture( image_baked ); - } + } } } @@ -7552,14 +7544,13 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( LLColor4::white ); } } } } } - dirtyMesh(); } @@ -7571,7 +7562,7 @@ std::string get_sequential_numbered_file_name(const std::string& prefix, file_num_type::iterator it = file_nums.find(prefix); S32 num = 0; if (it != file_nums.end()) -{ + { num = it->second; } file_nums[prefix] = num+1; @@ -7622,36 +7613,36 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara if (group_by_wearables) { for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) - { - const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); - apr_file_printf( file, "\n\t\t\n", wearable_name.c_str() ); + { + const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); + apr_file_printf( file, "\n\t\t\n", wearable_name.c_str() ); for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) - { - LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - if( (viewer_param->getWearableType() == type) && - (viewer_param->isTweakable() ) ) { + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + if( (viewer_param->getWearableType() == type) && + (viewer_param->isTweakable() ) ) + { dump_visual_param(file, viewer_param, viewer_param->getWeight()); + } } - } - for (U8 te = 0; te < TEX_NUM_INDICES; te++) - { - if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) + for (U8 te = 0; te < TEX_NUM_INDICES; te++) { - // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); - if( te_image ) + if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); - apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); + // MULTIPLE_WEARABLES: extend to multiple wearables? + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); + if( te_image ) + { + std::string uuid_str; + te_image->getID().toString( uuid_str ); + apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); + } } } } } - } else { // Just dump all params sequentially. @@ -7663,18 +7654,15 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara for (U8 te = 0; te < TEX_NUM_INDICES; te++) { + // MULTIPLE_WEARABLES: extend to multiple wearables? + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); + if( te_image ) { - // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); - if( te_image ) - { - std::string uuid_str; - te_image->getID().toString( uuid_str ); - apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); - } + std::string uuid_str; + te_image->getID().toString( uuid_str ); + apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); } } - } apr_file_printf( file, "\t\n" ); apr_file_printf( file, "\n\n" ); @@ -7799,7 +7787,7 @@ void LLVOAvatar::startAppearanceAnimation() // virtual void LLVOAvatar::removeMissingBakedTextures() - { +{ } //virtual @@ -8053,7 +8041,6 @@ void LLVOAvatar::calculateUpdateRenderCost() } } } - } // Diagnostic output to identify all avatar-related textures. @@ -8065,9 +8052,8 @@ void LLVOAvatar::calculateUpdateRenderCost() for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) { LLUUID image_id = it->first; - if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) - continue; - if (all_textures.find(image_id) == all_textures.end()) + if( ! (image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) + && (all_textures.find(image_id) == all_textures.end())) { // attachment texture not previously seen. LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL; @@ -8133,15 +8119,17 @@ LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high) // static BOOL LLVOAvatar::isIndexLocalTexture(ETextureIndex index) { - if (index < 0 || index >= TEX_NUM_INDICES) return false; - return LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsLocalTexture; + return (index < 0 || index >= TEX_NUM_INDICES) + ? false + : LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsLocalTexture; } // static BOOL LLVOAvatar::isIndexBakedTexture(ETextureIndex index) { - if (index < 0 || index >= TEX_NUM_INDICES) return false; - return LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsBakedTexture; + return (index < 0 || index >= TEX_NUM_INDICES) + ? false + : LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsBakedTexture; } const std::string LLVOAvatar::getBakedStatusForPrintout() const @@ -8191,7 +8179,7 @@ BOOL LLVOAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U { return FALSE; } - + if( !getImage( te, index ) ) { LL_WARNS() << "getImage( " << te << ", " << index << " ) returned 0" << LL_ENDL; -- cgit v1.2.3 From e271fe7091e76373c277625ffcb2cba0c9a02746 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 14 Oct 2014 11:07:20 -0400 Subject: re-fix STORM-1828 (previous fix lost in merge) --- indra/newview/llvoavatar.cpp | 109 +++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 57 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4d2f7ff922..3f94074ab3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7595,85 +7595,80 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLAPRFile outfile; std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - outfile.open(fullpath, LL_APR_WB ); - apr_file_t* file = outfile.getFileHandle(); - if (!file) - { - return; - } - else + if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB )) { + apr_file_t* file = outfile.getFileHandle(); LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL; - } - apr_file_printf( file, "\n" ); - apr_file_printf( file, "\n" ); - apr_file_printf( file, "\n\t\n" ); + apr_file_printf( file, "\n" ); + apr_file_printf( file, "\n" ); + apr_file_printf( file, "\n\t\n" ); - if (group_by_wearables) - { - for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) + if (group_by_wearables) { - const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); - apr_file_printf( file, "\n\t\t\n", wearable_name.c_str() ); - - for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) { - LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - if( (viewer_param->getWearableType() == type) && - (viewer_param->isTweakable() ) ) + const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); + apr_file_printf( file, "\n\t\t\n", wearable_name.c_str() ); + + for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) { - dump_visual_param(file, viewer_param, viewer_param->getWeight()); + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + if( (viewer_param->getWearableType() == type) && + (viewer_param->isTweakable() ) ) + { + dump_visual_param(file, viewer_param, viewer_param->getWeight()); + } } - } - for (U8 te = 0; te < TEX_NUM_INDICES; te++) - { - if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) + for (U8 te = 0; te < TEX_NUM_INDICES; te++) { - // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); - if( te_image ) + if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); - apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); + // MULTIPLE_WEARABLES: extend to multiple wearables? + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); + if( te_image ) + { + std::string uuid_str; + te_image->getID().toString( uuid_str ); + apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); + } } } } } - } - else - { - // Just dump all params sequentially. - for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + else { - LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - dump_visual_param(file, viewer_param, viewer_param->getWeight()); - } + // Just dump all params sequentially. + for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + { + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + dump_visual_param(file, viewer_param, viewer_param->getWeight()); + } - for (U8 te = 0; te < TEX_NUM_INDICES; te++) - { - // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); - if( te_image ) + for (U8 te = 0; te < TEX_NUM_INDICES; te++) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); - apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); + // MULTIPLE_WEARABLES: extend to multiple wearables? + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); + if( te_image ) + { + std::string uuid_str; + te_image->getID().toString( uuid_str ); + apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); + } } } - } - apr_file_printf( file, "\t\n" ); - apr_file_printf( file, "\n\n" ); + apr_file_printf( file, "\t\n" ); + apr_file_printf( file, "\n\n" ); - bool ultra_verbose = false; - if (isSelf() && ultra_verbose) - { - // show the cloned params inside the wearables as well. - gAgentAvatarp->dumpWearableInfo(outfile); + bool ultra_verbose = false; + if (isSelf() && ultra_verbose) + { + // show the cloned params inside the wearables as well. + gAgentAvatarp->dumpWearableInfo(outfile); + } + outfile.close(); } - // File will close when handle goes out of scope } -- cgit v1.2.3 From 7ffa456683ed7babd8abf16d48f0871a7001f3e6 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 14 Oct 2014 11:22:39 -0400 Subject: STORM-2080: correct fitted mesh rendering on some ATI cards --- indra/llrender/llshadermgr.cpp | 13 +++++++++---- .../app_settings/shaders/class1/avatar/avatarSkinV.glsl | 6 ++++++ .../app_settings/shaders/class1/avatar/objectSkinV.glsl | 9 +++++++++ .../app_settings/shaders/class1/deferred/blurLightF.glsl | 6 ++++++ .../shaders/class1/deferred/multiPointLightF.glsl | 8 ++++++++ .../app_settings/shaders/class1/deferred/postgiF.glsl | 6 ++++++ indra/newview/lldrawpoolavatar.cpp | 3 ++- 7 files changed, 46 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 95a2c8b589..663d3e8b0f 100755 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -670,12 +670,17 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (defines) { for (boost::unordered_map::iterator iter = defines->begin(); iter != defines->end(); ++iter) - { - std::string define = "#define " + iter->first + " " + iter->second + "\n"; - text[count++] = (GLcharARB *) strdup(define.c_str()); - } + { + std::string define = "#define " + iter->first + " " + iter->second + "\n"; + text[count++] = (GLcharARB *) strdup(define.c_str()); + } } + if( gGLManager.mIsATI ) + { + text[ count++ ] = strdup( "#define IS_AMD_CARD 1\n" ); + } + if (texture_index_channels > 0 && type == GL_FRAGMENT_SHADER_ARB) { //use specified number of texture channels for indexed texture rendering diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index bc63d07d72..767fad016c 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -40,4 +40,10 @@ mat4 getSkinnedTransform() ret[3] = vec4(0,0,0,1); return ret; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec4 dummy1 = matrixPalette[0]; + vec4 dummy2 = matrixPalette[44]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 57129c3bd1..6cd38d8ef5 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -63,5 +63,14 @@ mat4 getObjectSkinnedTransform() ret[3] = vec4(trans, 1.0); return ret; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + mat3 dummy1 = matrixPalette[0]; + vec3 dummy2 = translationPalette[0]; + mat3 dummy3 = matrixPalette[51]; + vec3 dummy4 = translationPalette[51]; +#endif + } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index a4f54dff70..5264d6e1b4 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -132,5 +132,11 @@ void main() col.y *= col.y; frag_color = col; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec3 dummy1 = kern[0]; + vec3 dummy2 = kern[3]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 236567219b..1a464fec5d 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -161,4 +161,12 @@ void main() frag_color.rgb = out_col; frag_color.a = 0.0; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec4 dummy1 = light[0]; + vec4 dummy2 = light_col[0]; + vec4 dummy3 = light[LIGHT_COUNT-1]; + vec4 dummy4 = light_col[LIGHT_COUNT-1]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 96f9628424..018ced4cad 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -99,4 +99,10 @@ void main() col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z; frag_color.rgb = col; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec2 dummy1 = kern[0]; + vec2 dummy2 = kern[31]; +#endif } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 90e6dfe351..e7420f32f0 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1626,7 +1626,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* { F32 w = weight[j][k]; - idx[k] = llclamp((S32) floorf(w), 0, 63); + idx[k] = llclamp((S32) floorf(w), 0, JOINT_COUNT-1); + wght[k] = w - floorf(w); scale += wght[k]; } -- cgit v1.2.3 From a30e0fd9098c4be4d6aaf610d59b4165a1fa5704 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 29 Oct 2014 09:17:34 -0400 Subject: MAINT-4606 WIP - handle removing attachments that contain multiple mesh objects --- indra/newview/llviewerobject.cpp | 23 +++++++++++++++ indra/newview/llviewerobject.h | 2 ++ indra/newview/llvoavatar.cpp | 62 ++++++++++++++++++++++++++-------------- indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.cpp | 2 -- 5 files changed, 66 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 97cefaf33c..344a7f5ce1 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -359,10 +359,17 @@ void LLViewerObject::markDead() //LL_INFOS() << "Marking self " << mLocalID << " as dead." << LL_ENDL; // Root object of this hierarchy unlinks itself. + LLVOAvatar *av = getAvatarAncestor(); if (getParent()) { ((LLViewerObject *)getParent())->removeChild(this); } + LLUUID mesh_id; + if (av && LLVOAvatar::getRiggedMeshID(this,mesh_id)) + { + // This case is needed for indirectly attached mesh objects. + av->resetJointPositionsOnDetach(mesh_id); + } // Mark itself as dead mDead = TRUE; @@ -5006,6 +5013,22 @@ LLVOAvatar* LLViewerObject::asAvatar() return NULL; } +// If this object is directly or indirectly parented by an avatar, return it. +LLVOAvatar* LLViewerObject::getAvatarAncestor() +{ + LLViewerObject *pobj = (LLViewerObject*) getParent(); + while (pobj) + { + LLVOAvatar *av = pobj->asAvatar(); + if (av) + { + return av; + } + pobj = (LLViewerObject*) pobj->getParent(); + } + return NULL; +} + BOOL LLViewerObject::isParticleSource() const { return !mPartSourcep.isNull() && !mPartSourcep->isDead(); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 22ac4ce0db..05c87c153b 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -135,6 +135,8 @@ public: virtual LLVOAvatar* asAvatar(); + LLVOAvatar* getAvatarAncestor(); + static void initVOClasses(); static void cleanupVOClasses(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5ca9120f25..e01bdd92b0 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5058,6 +5058,37 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) return jointp; } + +//----------------------------------------------------------------------------- +// getRiggedMeshID +// +// If viewer object is a rigged mesh, set the mesh id and return true. +// Otherwise, null out the id and return false. +//----------------------------------------------------------------------------- +// static +bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) +{ + mesh_id.setNull(); + + //If a VO has a skin that we'll reset the joint positions to their default + if ( pVO && pVO->mDrawable ) + { + LLVOVolume* pVObj = pVO->mDrawable->getVOVolume(); + if ( pVObj ) + { + const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj ); + if (pSkinData + && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig + && pSkinData->mAlternateBindMatrix.size() > 0 ) + { + mesh_id = pSkinData->mMeshID; + return true; + } + } + } + return false; +} + //----------------------------------------------------------------------------- // resetJointPositionsOnDetach //----------------------------------------------------------------------------- @@ -5735,31 +5766,18 @@ void LLVOAvatar::rebuildRiggedAttachments( void ) //----------------------------------------------------------------------------- void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) { - //If a VO has a skin that we'll reset the joint positions to their default - if ( pVO && pVO->mDrawable ) + LLUUID mesh_id; + if (getRiggedMeshID(pVO, mesh_id)) { - LLVOVolume* pVObj = pVO->mDrawable->getVOVolume(); - if ( pVObj ) + resetJointPositionsOnDetach(mesh_id); + if ( gAgentCamera.cameraCustomizeAvatar() ) { - const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj ); - if (pSkinData - && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig - && pSkinData->mAlternateBindMatrix.size() > 0 ) - { - const LLUUID& mesh_id = pSkinData->mMeshID; - LLVOAvatar::resetJointPositionsOnDetach(mesh_id); - //Need to handle the repositioning of the cam, updating rig data etc during outfit editing - //This handles the case where we detach a replacement rig. - if ( gAgentCamera.cameraCustomizeAvatar() ) - { - gAgent.unpauseAnimation(); - //Still want to refocus on head bone - gAgentCamera.changeCameraToCustomizeAvatar(); - } - } - } - } + gAgent.unpauseAnimation(); + //Still want to refocus on head bone + gAgentCamera.changeCameraToCustomizeAvatar(); } + } +} //----------------------------------------------------------------------------- // detachObject() diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index cd9fa30bc9..a582922c03 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -719,6 +719,7 @@ public: void clampAttachmentPositions(); virtual const LLViewerJointAttachment* attachObject(LLViewerObject *viewer_object); virtual BOOL detachObject(LLViewerObject *viewer_object); + static bool getRiggedMeshID( LLViewerObject* pVO, LLUUID& mesh_id ); void cleanupAttachedMesh( LLViewerObject* pVO ); static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj); /*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type ) const; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ccc30c448d..77fda25537 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1154,8 +1154,6 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) const LLUUID attachment_id = viewer_object->getAttachmentItemID(); if ( LLVOAvatar::detachObject(viewer_object) ) { - LLVOAvatar::cleanupAttachedMesh( viewer_object ); - // the simulator should automatically handle permission revocation stopMotionFromSource(attachment_id); -- cgit v1.2.3 From dc0abe48c624775f06cfebf1ea4d20222a7b7086 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 29 Oct 2014 13:07:44 -0400 Subject: MAINT-4605 WIP - you can't hide your lion eyes --- indra/llcharacter/lljoint.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 97293bf134..7c75c4920f 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -289,8 +289,9 @@ void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::str { LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL; m_attachmentOverrides.erase(it); + updatePos(av_info); } - updatePos(av_info); + } //-------------------------------------------------------------------- -- cgit v1.2.3 From 5c8d902c1bab6f0577750e8e2470384a31880947 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 17 Oct 2014 15:00:18 -0400 Subject: SL-93 WIP - refactoring LLPosOverrideMap for reusability --- indra/llcharacter/lljoint.cpp | 88 ++++++++++++++++++++++++++++++++----------- indra/llcharacter/lljoint.h | 22 +++++++---- 2 files changed, 80 insertions(+), 30 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 7c75c4920f..5e54215739 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -36,18 +36,57 @@ S32 LLJoint::sNumUpdates = 0; S32 LLJoint::sNumTouches = 0; +template +bool attachment_map_iter_compare_key(const T& a, const T& b) +{ + return a.first < b.first; +} -//----------------------------------------------------------------------------- -// LLJoint::AttachmentOverrideRecord::AttachmentOverrideRecord() -//----------------------------------------------------------------------------- -LLJoint::AttachmentOverrideRecord::AttachmentOverrideRecord() +bool LLPosOverrideMap::findActiveOverride(LLUUID& mesh_id, LLVector3& pos) const { + pos = LLVector3(0,0,0); + mesh_id = LLUUID(); + bool found = false; + + map_type::const_iterator it = std::max_element(m_map.begin(), + m_map.end(), + attachment_map_iter_compare_key); + if (it != m_map.end()) + { + found = true; + pos = it->second; + mesh_id = it->first; + } + return found; } -template -bool attachment_map_iter_compare_key(const T& a, const T& b) +void LLPosOverrideMap::showJointPosOverrides( std::ostringstream& os ) const { - return a.first < b.first; + map_type::const_iterator max_it = std::max_element(m_map.begin(), + m_map.end(), + attachment_map_iter_compare_key); + for (map_type::const_iterator it = m_map.begin(); + it != m_map.end(); ++it) + { + const LLVector3& pos = it->second; + os << " " << "[" << it->first <<": " << pos << "]" << ((it==max_it) ? "*" : ""); + } +} + +U32 LLPosOverrideMap::count() const +{ + return m_map.size(); +} + +void LLPosOverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos) +{ + m_map[mesh_id] = pos; +} + +bool LLPosOverrideMap::remove(const LLUUID& mesh_id) +{ + U32 remove_count = m_map.erase(mesh_id); + return (remove_count > 0); } //----------------------------------------------------------------------------- @@ -254,6 +293,14 @@ void LLJoint::setPosition( const LLVector3& pos ) touch(MATRIX_DIRTY | POSITION_DIRTY); } +void showJointPosOverrides( const LLJoint& joint, const std::string& note, const std::string& av_info ) +{ + std::ostringstream os; + os << joint.m_posBeforeOverrides; + joint.m_attachmentOverrides.showJointPosOverrides(os); + LL_DEBUGS("Avatar") << av_info << " joint " << joint.getName() << " " << note << " " << os.str() << LL_ENDL; +} + //-------------------------------------------------------------------- // addAttachmentPosOverride() //-------------------------------------------------------------------- @@ -263,14 +310,12 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh { return; } - if (m_attachmentOverrides.empty()) + if (!m_attachmentOverrides.count()) { LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL; m_posBeforeOverrides = getPosition(); } - AttachmentOverrideRecord rec; - rec.pos = pos; - m_attachmentOverrides[mesh_id] = rec; + m_attachmentOverrides.add(mesh_id,pos); LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL; updatePos(av_info); } @@ -284,11 +329,11 @@ void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::str { return; } - attachment_map_t::iterator it = m_attachmentOverrides.find(mesh_id); - if (it != m_attachmentOverrides.end()) + if (m_attachmentOverrides.remove(mesh_id)) { - LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL; - m_attachmentOverrides.erase(it); + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() + << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL; + showJointPosOverrides(*this, "remove", av_info); updatePos(av_info); } @@ -299,15 +344,12 @@ void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::str //-------------------------------------------------------------------- void LLJoint::updatePos(const std::string& av_info) { - LLVector3 pos; - attachment_map_t::iterator it = std::max_element(m_attachmentOverrides.begin(), - m_attachmentOverrides.end(), - attachment_map_iter_compare_key); - if (it != m_attachmentOverrides.end()) + LLVector3 pos, found_pos; + LLUUID mesh_id; + if (m_attachmentOverrides.findActiveOverride(mesh_id,found_pos)) { - AttachmentOverrideRecord& rec = it->second; - LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " updatePos, winner of " << m_attachmentOverrides.size() << " is mesh " << it->first << " pos " << rec.pos << LL_ENDL; - pos = rec.pos; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " updatePos, winner of " << m_attachmentOverrides.count() << " is mesh " << mesh_id << " pos " << found_pos << LL_ENDL; + pos = found_pos; } else { diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 951cafad94..f8639af3de 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -46,6 +46,20 @@ const U32 LL_FACE_JOINT_NUM = 30; const S32 LL_CHARACTER_MAX_PRIORITY = 7; const F32 LL_MAX_PELVIS_OFFSET = 5.f; +class LLPosOverrideMap +{ +public: + LLPosOverrideMap() {} + bool findActiveOverride(LLUUID& mesh_id, LLVector3& pos) const; + void showJointPosOverrides(std::ostringstream& os) const; + U32 count() const; + void add(const LLUUID& mesh_id, const LLVector3& pos); + bool remove(const LLUUID& mesh_id); +private: + typedef std::map map_type; + map_type m_map; +}; + //----------------------------------------------------------------------------- // class LLJoint //----------------------------------------------------------------------------- @@ -99,13 +113,7 @@ public: static S32 sNumTouches; static S32 sNumUpdates; - struct AttachmentOverrideRecord - { - AttachmentOverrideRecord(); - LLVector3 pos; - }; - typedef std::map attachment_map_t; - attachment_map_t m_attachmentOverrides; + LLPosOverrideMap m_attachmentOverrides; LLVector3 m_posBeforeOverrides; void updatePos(const std::string& av_info); -- cgit v1.2.3 From 47854b621884a2504ae34ce72eabf57a7a946bfd Mon Sep 17 00:00:00 2001 From: Cinder Date: Thu, 23 Oct 2014 12:45:05 -0600 Subject: STORM-2081 - Guard against null gWindowImplementation when fullscreen (crashes OS X Yosemite) --- indra/llwindow/llwindowmacosx.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 18d5152015..3d2349f379 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -230,7 +230,10 @@ void callFocus() void callFocusLost() { - gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation); + if (gWindowImplementation) + { + gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation); + } } void callRightMouseDown(float *pos, MASK mask) -- cgit v1.2.3 From 58e2d58daf603824872308245a451c2e32394706 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 30 Oct 2014 04:20:12 -0400 Subject: SL-93 - WIP on managing pelvis fixups using new joint offset framework --- indra/llappearance/llavatarappearance.cpp | 36 ++++++++++++++++++++++ indra/llappearance/llavatarappearance.h | 8 ++++- indra/newview/app_settings/settings.xml | 11 +++++++ indra/newview/llaisapi.cpp | 3 +- indra/newview/llfloatermodelpreview.cpp | 6 +++- indra/newview/llvoavatar.cpp | 50 ++++++------------------------- indra/newview/llvoavatar.h | 8 ----- indra/newview/llvovolume.cpp | 8 ++--- 8 files changed, 73 insertions(+), 57 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index c0ad8315af..d1eb389013 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -675,6 +675,42 @@ void LLAvatarAppearance::clearSkeleton() mSkeleton.clear(); } +//------------------------------------------------------------------------ +// addPelvisFixup +//------------------------------------------------------------------------ +void LLAvatarAppearance::addPelvisFixup( F32 fixup, const LLUUID& mesh_id ) +{ + LLVector3 pos(0.0,0.0,fixup); + mPelvisFixups.add(mesh_id,pos); +} + +//------------------------------------------------------------------------ +// addPelvisFixup +//------------------------------------------------------------------------ +void LLAvatarAppearance::removePelvisFixup( const LLUUID& mesh_id ) +{ + mPelvisFixups.remove(mesh_id); +} + +//------------------------------------------------------------------------ +// hasPelvisFixup +//------------------------------------------------------------------------ +bool LLAvatarAppearance::hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const +{ + LLVector3 pos; + if (mPelvisFixups.findActiveOverride(mesh_id,pos)) + { + fixup = pos[2]; + return true; + } + return false; +} + +bool LLAvatarAppearance::hasPelvisFixup( F32& fixup ) const +{ + LLUUID mesh_id; + return hasPelvisFixup( fixup, mesh_id ); +} //----------------------------------------------------------------------------- // LLAvatarAppearance::buildCharacter() // Deferred initialization and rebuild of the avatar. diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 1e898026c0..a0ef49b7cb 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -152,11 +152,17 @@ protected: BOOL mIsBuilt; // state of deferred character building typedef std::vector avatar_joint_list_t; avatar_joint_list_t mSkeleton; - + LLPosOverrideMap mPelvisFixups; + //-------------------------------------------------------------------- // Pelvis height adjustment members. //-------------------------------------------------------------------- public: + void addPelvisFixup( F32 fixup, const LLUUID& mesh_id ); + void removePelvisFixup( const LLUUID& mesh_id ); + bool hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const; + bool hasPelvisFixup( F32& fixup ) const; + LLVector3 mBodySize; LLVector3 mAvatarOffset; protected: diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 22d64d4d14..3d97d0525e 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4731,6 +4731,17 @@ Value 7 + InventoryDisableAISv3 + + Comment + Force AISv3 support to off. + Persist + 1 + Type + Boolean + Value + 0 + InvertMouse Comment diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 96de15bf75..9842bf2a66 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -124,7 +124,8 @@ bool AISCommand::isAPIAvailable() { if (gAgent.getRegion()) { - return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3"); + bool force_disable = gSavedSettings.getBOOL("InventoryDisableAISv3"); + return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3") && !force_disable; } return false; } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 73bf7f3e23..0c81ab7e79 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3244,7 +3244,11 @@ U32 LLModelPreview::calcResourceCost() if ( mFMP && mFMP->childGetValue("upload_joints").asBoolean() ) { - getPreviewAvatar()->setPelvisOffset( mPelvisZOffset ); + // FIXME if preview avatar ever gets reused, this fake mesh ID stuff will fail. + // see also call to addAttachmentPosOverride. + LLUUID fake_mesh_id; + fake_mesh_id.generate(); + getPreviewAvatar()->addPelvisFixup( mPelvisZOffset, fake_mesh_id ); } F32 streaming_cost = 0.f; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e01bdd92b0..fb25a2ddec 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -708,7 +708,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVisualComplexity(0), mVisualComplexityStale(TRUE), mLoadedCallbacksPaused(FALSE), - mHasPelvisOffset( FALSE ), mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar", false)), mLastRezzedStatus(-1), mIsEditingAppearance(FALSE), @@ -770,10 +769,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mRuthTimer.reset(); mRuthDebugTimer.reset(); mDebugExistenceTimer.reset(); - mPelvisOffset = LLVector3(0.0f,0.0f,0.0f); - mLastPelvisToFoot = 0.0f; - mPelvisFixup = 0.0f; - mLastPelvisFixup = 0.0f; if(LLSceneMonitor::getInstance()->isEnabled()) { @@ -1258,17 +1253,18 @@ const LLVector3 LLVOAvatar::getRenderPosition() const } else if (isRoot()) { - if ( !mHasPelvisOffset ) - { - return mDrawable->getPositionAgent(); - } - else + F32 fixup; + if ( hasPelvisFixup( fixup) ) { //Apply a pelvis fixup (as defined by the avs skin) LLVector3 pos = mDrawable->getPositionAgent(); - pos[VZ] += mPelvisFixup; + pos[VZ] += fixup; return pos; } + else + { + return mDrawable->getPositionAgent(); + } } else { @@ -3724,21 +3720,6 @@ void LLVOAvatar::updateHeadOffset() } } //------------------------------------------------------------------------ -// setPelvisOffset -//------------------------------------------------------------------------ -void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount, F32 pelvisFixup ) -{ - mHasPelvisOffset = hasOffset; - if ( mHasPelvisOffset ) - { - //Store off last pelvis to foot value - mLastPelvisToFoot = mPelvisToFoot; - mPelvisOffset = offsetAmount; - mLastPelvisFixup = mPelvisFixup; - mPelvisFixup = pelvisFixup; - } -} -//------------------------------------------------------------------------ // postPelvisSetRecalc //------------------------------------------------------------------------ void LLVOAvatar::postPelvisSetRecalc( void ) @@ -3748,15 +3729,6 @@ void LLVOAvatar::postPelvisSetRecalc( void ) dirtyMesh(2); } //------------------------------------------------------------------------ -// setPelvisOffset -//------------------------------------------------------------------------ -void LLVOAvatar::setPelvisOffset( F32 pelvisFixupAmount ) -{ - mHasPelvisOffset = true; - mLastPelvisFixup = mPelvisFixup; - mPelvisFixup = pelvisFixupAmount; -} -//------------------------------------------------------------------------ // updateVisibility() //------------------------------------------------------------------------ void LLVOAvatar::updateVisibility() @@ -5104,22 +5076,18 @@ void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id) { LLJoint* pJoint = (*iter); //Reset joints except for pelvis - if ( pJoint && pJoint != pJointPelvis) + if ( pJoint ) { pJoint->setId( LLUUID::null ); pJoint->removeAttachmentPosOverride(mesh_id, avString()); } - else if ( pJoint && pJoint == pJointPelvis) { - pJoint->setId( LLUUID::null ); + removePelvisFixup( mesh_id ); pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); } } - //make sure we don't apply the joint offset - mHasPelvisOffset = false; - mPelvisFixup = mLastPelvisFixup; postPelvisSetRecalc(); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a582922c03..d7cf4a2c0c 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -356,19 +356,11 @@ protected: /*virtual*/ LLAvatarJointMesh* createAvatarJointMesh(); // Returns LLViewerJointMesh public: void updateHeadOffset(); - void setPelvisOffset( bool hasOffset, const LLVector3& translation, F32 offset ) ; - bool hasPelvisOffset( void ) { return mHasPelvisOffset; } void postPelvisSetRecalc( void ); - void setPelvisOffset( F32 pelvixFixupAmount ); /*virtual*/ BOOL loadSkeletonNode(); /*virtual*/ void buildCharacter(); - bool mHasPelvisOffset; - LLVector3 mPelvisOffset; - F32 mLastPelvisToFoot; - F32 mPelvisFixup; - F32 mLastPelvisFixup; LLVector3 mCurRootToHeadOffset; LLVector3 mTargetRootToHeadOffset; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4c21203c43..7c9bdc19a6 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4632,11 +4632,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) { - if ( !pAvatarVO->hasPelvisOffset() ) - { - pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset ); - pelvisGotSet = true; - } + // FIXME move + pAvatarVO->addPelvisFixup( pelvisZOffset, mesh_id ); + pelvisGotSet = true; } } } -- cgit v1.2.3 From 535e24c7e8913db447d90a949f6b2f6b92927f48 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 30 Oct 2014 14:04:18 -0400 Subject: SL-93 WIP - missing include --- indra/newview/llaisapi.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 9842bf2a66..19793b6583 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -34,6 +34,7 @@ #include "llsdutil.h" #include "llviewerregion.h" #include "llinventoryobserver.h" +#include "llviewercontrol.h" ///---------------------------------------------------------------------------- /// Classes for AISv3 support. -- cgit v1.2.3 From 90aca8f95af4c73e592d9657d0eba4d9a709244c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 31 Oct 2014 13:24:20 -0400 Subject: settings.xml update --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llaisapi.cpp | 3 +-- 2 files changed, 1 insertion(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3d97d0525e..22d64d4d14 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4731,17 +4731,6 @@ Value 7 - InventoryDisableAISv3 - - Comment - Force AISv3 support to off. - Persist - 1 - Type - Boolean - Value - 0 - InvertMouse Comment diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 19793b6583..9d887a61f1 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -125,8 +125,7 @@ bool AISCommand::isAPIAvailable() { if (gAgent.getRegion()) { - bool force_disable = gSavedSettings.getBOOL("InventoryDisableAISv3"); - return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3") && !force_disable; + return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3"); } return false; } -- cgit v1.2.3 From 7fec81b102e92e1a4e5a36fde077ef9b82cc7123 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 3 Nov 2014 05:46:31 -0500 Subject: SL-93 WIP - pelvis fixup offsets --- indra/llcharacter/lljoint.cpp | 8 ++++++++ indra/llcharacter/lljoint.h | 1 + indra/newview/llvoavatar.cpp | 21 +++++++++++++++++++++ indra/newview/llvovolume.cpp | 9 ++++++--- 4 files changed, 36 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 5e54215739..af5393ef03 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -339,6 +339,14 @@ void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::str } +//-------------------------------------------------------------------- + // hasAttachmentPosOverride() + //-------------------------------------------------------------------- +bool LLJoint::hasAttachmentPosOverride( LLVector3& pos, LLUUID& mesh_id ) const +{ + return m_attachmentOverrides.findActiveOverride(mesh_id,pos); +} + //-------------------------------------------------------------------- // updatePos() //-------------------------------------------------------------------- diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index f8639af3de..56da8e83b2 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -201,6 +201,7 @@ public: void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info ); void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info ); + bool hasAttachmentPosOverride( LLVector3& pos, LLUUID& mesh_id ) const; //Accessor for the joint id LLUUID getId( void ) { return mId; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fb25a2ddec..dd5941191a 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7674,6 +7674,27 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); } + for (iter = mSkeleton.begin(); iter != end; ++iter) + { + LLJoint* pJoint = (*iter); + + LLVector3 pos; + LLUUID mesh_id; + + if (pJoint->hasAttachmentPosOverride(pos,mesh_id)) + { + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str()); + } + } + F32 pelvis_fixup; + LLUUID mesh_id; + if (hasPelvisFixup(pelvis_fixup, mesh_id)) + { + apr_file_printf( file, "\t\t\n", + pelvis_fixup, mesh_id.asString().c_str()); + } + apr_file_printf( file, "\t\n" ); apr_file_printf( file, "\n\n" ); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7c9bdc19a6..aebd9f470d 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4613,6 +4613,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { const int jointCnt = pSkinData->mJointNames.size(); const F32 pelvisZOffset = pSkinData->mPelvisOffset; + const LLUUID& mesh_id = pSkinData->mMeshID; bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; if ( fullRig ) { @@ -4626,18 +4627,20 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //Set the joint position - const LLUUID& mesh_id = pSkinData->mMeshID; pJoint->addAttachmentPosOverride( jointPos, mesh_id, pAvatarVO->avString() ); //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) { - // FIXME move - pAvatarVO->addPelvisFixup( pelvisZOffset, mesh_id ); pelvisGotSet = true; } } } + if (pelvisZOffset != 0.0F) + { + pAvatarVO->addPelvisFixup( pelvisZOffset, mesh_id ); + pelvisGotSet = true; + } } } } -- cgit v1.2.3 From 30c1d67d957ec7f895dd690ec34b5459fc9082de Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 14 Nov 2014 09:25:43 -0500 Subject: MAINT-4537 WIP - order of operations during outfit change --- indra/newview/llagentwearables.cpp | 22 +++++++++++++++++----- indra/newview/llagentwearables.h | 3 +++ indra/newview/llappearancemgr.cpp | 18 ++++++++++++++++-- indra/newview/llvoavatar.cpp | 28 ++++++++++++++++++++++++++++ indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.cpp | 2 +- indra/newview/llvoavatarself.h | 2 -- 7 files changed, 66 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 3928bbadc8..a7acdb0520 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1248,9 +1248,11 @@ void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &ty } } -// Combines userRemoveMulipleAttachments() and userAttachMultipleAttachments() logic to -// get attachments into desired state with minimal number of adds/removes. -void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array) +// Given a desired set of attachments, find what objects need to be +// removed, and what additional inventory items need to be added. +void LLAgentWearables::findAttachmentsAddRemoveInfo(LLInventoryModel::item_array_t& obj_item_array, + llvo_vec_t& objects_to_remove, + LLInventoryModel::item_array_t& items_to_add) { // Possible cases: // already wearing but not in request set -> take off. @@ -1269,7 +1271,6 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj } // Build up list of objects to be removed and items currently attached. - llvo_vec_t objects_to_remove; for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); iter != gAgentAvatarp->mAttachmentPoints.end();) { @@ -1309,7 +1310,6 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj } } - LLInventoryModel::item_array_t items_to_add; for (LLInventoryModel::item_array_t::iterator it = obj_item_array.begin(); it != obj_item_array.end(); ++it) @@ -1328,6 +1328,17 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj // S32 remove_count = objects_to_remove.size(); // S32 add_count = items_to_add.size(); // LL_INFOS() << "remove " << remove_count << " add " << add_count << LL_ENDL; +} + +// Combines userRemoveMulipleAttachments() and userAttachMultipleAttachments() logic to +// get attachments into desired state with minimal number of adds/removes. +void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array) +{ + llvo_vec_t objects_to_remove; + LLInventoryModel::item_array_t items_to_add; + findAttachmentsAddRemoveInfo(obj_item_array, + objects_to_remove, + items_to_add); // Remove everything in objects_to_remove userRemoveMultipleAttachments(objects_to_remove); @@ -1353,6 +1364,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo ++it) { LLViewerObject *objectp = *it; + gAgentAvatarp->resetJointPositionsOnDetach(objectp); gMessageSystem->nextBlockFast(_PREHASH_ObjectData); gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID()); } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index cdb1bdbe05..10e3dbf8c6 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -178,6 +178,9 @@ public: typedef std::vector llvo_vec_t; + static void findAttachmentsAddRemoveInfo(LLInventoryModel::item_array_t& obj_item_array, + llvo_vec_t& objects_to_remove, + LLInventoryModel::item_array_t& items_to_add); static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array); static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array); static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fba2b9d3a4..69efb20f79 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -807,6 +807,20 @@ void LLWearableHoldingPattern::onAllComplete() } } + LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL; + LLAgentWearables::llvo_vec_t objects_to_remove; + LLInventoryModel::item_array_t items_to_add; + if (isAgentAvatarValid()) + { + LLAgentWearables::findAttachmentsAddRemoveInfo(mObjItems, + objects_to_remove, + items_to_add); + + LL_DEBUGS("Avatar") << self_av_string() << "Removing " << objects_to_remove.size() + << " attachments" << LL_ENDL; + LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove); + } + // Update wearables. LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; LLAppearanceMgr::instance().updateAgentWearables(this); @@ -814,8 +828,8 @@ void LLWearableHoldingPattern::onAllComplete() // Update attachments to match those requested. if (isAgentAvatarValid()) { - LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL; - LLAgentWearables::userUpdateAttachments(mObjItems); + LL_DEBUGS("Avatar") << self_av_string() << "Adding " << items_to_add.size() << " attachments" << LL_ENDL; + LLAgentWearables::userAttachMultipleAttachments(items_to_add); } if (isFetchCompleted() && isMissingCompleted()) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index dd5941191a..646ca25a0e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5061,6 +5061,34 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) return false; } +//----------------------------------------------------------------------------- +// resetJointPositionsOnDetach +//----------------------------------------------------------------------------- +void LLVOAvatar::resetJointPositionsOnDetach(LLViewerObject *vo) +{ + LLVOAvatar *av = vo->getAvatarAncestor(); + if (!av || (av != this)) + { + LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; + } + + // Process all children + LLViewerObject::const_child_list_t& children = vo->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; + resetJointPositionsOnDetach(childp); + } + + // Process self. + LLUUID mesh_id; + if (getRiggedMeshID(vo,mesh_id)) + { + resetJointPositionsOnDetach(mesh_id); + } +} + //----------------------------------------------------------------------------- // resetJointPositionsOnDetach //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index d7cf4a2c0c..ce1f0dd152 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -200,6 +200,7 @@ public: virtual LLJoint* getJoint(const std::string &name); void resetJointPositionsOnDetach(const LLUUID& mesh_id); + void resetJointPositionsOnDetach(LLViewerObject *vo); /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 77fda25537..4335df66a1 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -262,7 +262,7 @@ void LLVOAvatarSelf::markDead() { BOOL success = LLVOAvatar::loadAvatar(); - // set all parameters sotred directly in the avatar to have + // set all parameters stored directly in the avatar to have // the isSelfParam to be TRUE - this is used to prevent // them from being animated or trigger accidental rebakes // when we copy params from the wearable to the base avatar. diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 369c15d0f9..a9c01933b7 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -86,8 +86,6 @@ public: /*virtual*/ void requestStopMotion(LLMotion* motion); /*virtual*/ LLJoint* getJoint(const std::string &name); - void resetJointPositions( void ); - /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight); /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight); /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight); -- cgit v1.2.3 From 9c4397b6ee6d1a2a2c43d5d886b178753a4833d8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 14 Nov 2014 15:41:03 -0500 Subject: MAINT-4537 WIP - joint position management during outfit changes --- indra/llcharacter/lljoint.cpp | 30 +++++++++++++++++++++++++----- indra/newview/llagentwearables.cpp | 7 ++++++- indra/newview/llvoavatarself.cpp | 18 ++++++++++++------ indra/newview/llvoavatarself.h | 1 + 4 files changed, 44 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index af5393ef03..cab3a7d619 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -283,12 +283,23 @@ const LLVector3& LLJoint::getPosition() return mXform.getPosition(); } +bool do_debug_joint(const std::string& name) +{ + return true; +} //-------------------------------------------------------------------- // setPosition() //-------------------------------------------------------------------- void LLJoint::setPosition( const LLVector3& pos ) { + if (pos != getPosition()) + { + if (do_debug_joint(getName())) + { + LL_DEBUGS("Avatar") << " joint " << getName() << " set pos " << pos << LL_ENDL; + } + } mXform.setPosition(pos); touch(MATRIX_DIRTY | POSITION_DIRTY); } @@ -312,11 +323,17 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh } if (!m_attachmentOverrides.count()) { - LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL; + if (do_debug_joint(getName())) + { + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL; + } m_posBeforeOverrides = getPosition(); } m_attachmentOverrides.add(mesh_id,pos); - LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL; + if (do_debug_joint(getName())) + { + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL; + } updatePos(av_info); } @@ -331,9 +348,12 @@ void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::str } if (m_attachmentOverrides.remove(mesh_id)) { - LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() - << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL; - showJointPosOverrides(*this, "remove", av_info); + if (do_debug_joint(getName())) + { + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() + << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL; + showJointPosOverrides(*this, "remove", av_info); + } updatePos(av_info); } diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index a7acdb0520..964c5110d1 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1088,7 +1088,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it if (isAgentAvatarValid()) { gAgentAvatarp->setCompositeUpdatesEnabled(TRUE); - gAgentAvatarp->updateVisualParams(); // If we have not yet declouded, we may want to use // baked texture UUIDs sent from the first objectUpdate message @@ -1106,6 +1105,12 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it notifyLoadingFinished(); + // Have to copy wearable params to avatar + gAgentAvatarp->writeWearablesToAvatar(); + + // ... before this will do anything. + gAgentAvatarp->updateVisualParams(); + gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); LL_DEBUGS("Avatar") << "setWearableOutfit() end" << LL_ENDL; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4335df66a1..0be8df349d 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -718,13 +718,8 @@ void LLVOAvatarSelf::updateVisualParams() LLVOAvatar::updateVisualParams(); } -/*virtual*/ -void LLVOAvatarSelf::idleUpdateAppearanceAnimation() +void LLVOAvatarSelf::writeWearablesToAvatar() { - // Animate all top-level wearable visual parameters - gAgentWearables.animateAllWearableParams(calcMorphAmount()); - - // apply wearable visual params to avatar for (U32 type = 0; type < LLWearableType::WT_COUNT; type++) { LLWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type); @@ -734,6 +729,17 @@ void LLVOAvatarSelf::idleUpdateAppearanceAnimation() } } +} + +/*virtual*/ +void LLVOAvatarSelf::idleUpdateAppearanceAnimation() +{ + // Animate all top-level wearable visual parameters + gAgentWearables.animateAllWearableParams(calcMorphAmount()); + + // Apply wearable visual params to avatar + writeWearablesToAvatar(); + //allow avatar to process updates LLVOAvatar::idleUpdateAppearanceAnimation(); diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index a9c01933b7..13ffc057b0 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -90,6 +90,7 @@ public: /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight); /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight); /*virtual*/ void updateVisualParams(); + void writeWearablesToAvatar(); /*virtual*/ void idleUpdateAppearanceAnimation(); private: -- cgit v1.2.3 From b1884d40f5ba74d1d39be1abad7dc416905c6caf Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Sat, 15 Nov 2014 14:29:39 -0500 Subject: MAINT-4537 WIP - more joint position management during outfit changes --- indra/llcharacter/lljoint.cpp | 17 +++++++ indra/llcharacter/lljoint.h | 2 + indra/newview/llagentwearables.cpp | 21 ++------- indra/newview/llagentwearables.h | 2 +- indra/newview/llappearancemgr.cpp | 14 +++++- indra/newview/llvoavatar.cpp | 93 ++++++++++++++++++++++++++++++++++++++ indra/newview/llvoavatar.h | 2 + indra/newview/llvovolume.cpp | 59 ++---------------------- 8 files changed, 136 insertions(+), 74 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index cab3a7d619..6615a430ab 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -89,6 +89,11 @@ bool LLPosOverrideMap::remove(const LLUUID& mesh_id) return (remove_count > 0); } +void LLPosOverrideMap::clear() +{ + m_map.clear(); +} + //----------------------------------------------------------------------------- // LLJoint() // Class Constructor @@ -367,6 +372,18 @@ bool LLJoint::hasAttachmentPosOverride( LLVector3& pos, LLUUID& mesh_id ) const return m_attachmentOverrides.findActiveOverride(mesh_id,pos); } +//-------------------------------------------------------------------- +// clearAttachmentPosOverrides() +//-------------------------------------------------------------------- +void LLJoint::clearAttachmentPosOverrides() +{ + if (m_attachmentOverrides.count()) + { + m_attachmentOverrides.clear(); + setPosition(m_posBeforeOverrides); + } +} + //-------------------------------------------------------------------- // updatePos() //-------------------------------------------------------------------- diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 56da8e83b2..2abe1d6db1 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -55,6 +55,7 @@ public: U32 count() const; void add(const LLUUID& mesh_id, const LLVector3& pos); bool remove(const LLUUID& mesh_id); + void clear(); private: typedef std::map map_type; map_type m_map; @@ -202,6 +203,7 @@ public: void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info ); void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info ); bool hasAttachmentPosOverride( LLVector3& pos, LLUUID& mesh_id ) const; + void clearAttachmentPosOverrides(); //Accessor for the joint id LLUUID getId( void ) { return mId; } diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 964c5110d1..585f14df3d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1257,6 +1257,7 @@ void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &ty // removed, and what additional inventory items need to be added. void LLAgentWearables::findAttachmentsAddRemoveInfo(LLInventoryModel::item_array_t& obj_item_array, llvo_vec_t& objects_to_remove, + llvo_vec_t& objects_to_retain, LLInventoryModel::item_array_t& items_to_add) { // Possible cases: @@ -1310,6 +1311,7 @@ void LLAgentWearables::findAttachmentsAddRemoveInfo(LLInventoryModel::item_array { // LL_INFOS() << "found object to keep, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << LL_ENDL; current_item_ids.insert(object_item_id); + objects_to_retain.push_back(objectp); } } } @@ -1335,23 +1337,6 @@ void LLAgentWearables::findAttachmentsAddRemoveInfo(LLInventoryModel::item_array // LL_INFOS() << "remove " << remove_count << " add " << add_count << LL_ENDL; } -// Combines userRemoveMulipleAttachments() and userAttachMultipleAttachments() logic to -// get attachments into desired state with minimal number of adds/removes. -void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array) -{ - llvo_vec_t objects_to_remove; - LLInventoryModel::item_array_t items_to_add; - findAttachmentsAddRemoveInfo(obj_item_array, - objects_to_remove, - items_to_add); - - // Remove everything in objects_to_remove - userRemoveMultipleAttachments(objects_to_remove); - - // Add everything in items_to_add - userAttachMultipleAttachments(items_to_add); -} - void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remove) { if (!isAgentAvatarValid()) return; @@ -1369,7 +1354,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo ++it) { LLViewerObject *objectp = *it; - gAgentAvatarp->resetJointPositionsOnDetach(objectp); + //gAgentAvatarp->resetJointPositionsOnDetach(objectp); gMessageSystem->nextBlockFast(_PREHASH_ObjectData); gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID()); } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 10e3dbf8c6..1004482020 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -180,8 +180,8 @@ public: static void findAttachmentsAddRemoveInfo(LLInventoryModel::item_array_t& obj_item_array, llvo_vec_t& objects_to_remove, + llvo_vec_t& objects_to_retain, LLInventoryModel::item_array_t& items_to_add); - static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array); static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array); static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 69efb20f79..943190e7b1 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -809,22 +809,34 @@ void LLWearableHoldingPattern::onAllComplete() LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL; LLAgentWearables::llvo_vec_t objects_to_remove; + LLAgentWearables::llvo_vec_t objects_to_retain; LLInventoryModel::item_array_t items_to_add; if (isAgentAvatarValid()) { LLAgentWearables::findAttachmentsAddRemoveInfo(mObjItems, objects_to_remove, + objects_to_retain, items_to_add); LL_DEBUGS("Avatar") << self_av_string() << "Removing " << objects_to_remove.size() << " attachments" << LL_ENDL; + gAgentAvatarp->clearAttachmentPosOverrides(); LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove); } // Update wearables. LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; LLAppearanceMgr::instance().updateAgentWearables(this); - + + // Restore attachment pos overrides for the attachments that aren't going away. + for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_retain.begin(); + it != objects_to_retain.end(); + ++it) + { + LLViewerObject *objectp = *it; + gAgentAvatarp->addAttachmentPosOverridesForObject(objectp); + } + // Update attachments to match those requested. if (isAgentAvatarValid()) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 646ca25a0e..835c4e6176 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5061,6 +5061,99 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) return false; } +void LLVOAvatar::clearAttachmentPosOverrides() +{ + //Subsequent joints are relative to pelvis + avatar_joint_list_t::iterator iter = mSkeleton.begin(); + avatar_joint_list_t::iterator end = mSkeleton.end(); + + for (; iter != end; ++iter) + { + LLJoint* pJoint = (*iter); + pJoint->clearAttachmentPosOverrides(); + } +} + +//----------------------------------------------------------------------------- +// addAttachmentPosOverridesForObject +//----------------------------------------------------------------------------- +void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) +{ + LLVOAvatar *av = vo->getAvatarAncestor(); + if (!av || (av != this)) + { + LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; + } + + // Process all children + LLViewerObject::const_child_list_t& children = vo->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; + addAttachmentPosOverridesForObject(childp); + } + + LLVOVolume *vobj = dynamic_cast(vo); + bool pelvisGotSet = false; + + if (!vobj) + { + return; + } + if (vobj->isMesh() && + ((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) || !gMeshRepo.meshRezEnabled())) + { + return; + } + LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); + const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj ); + + if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData ) + { + const int bindCnt = pSkinData->mAlternateBindMatrix.size(); + if ( bindCnt > 0 ) + { + const int jointCnt = pSkinData->mJointNames.size(); + const F32 pelvisZOffset = pSkinData->mPelvisOffset; + const LLUUID& mesh_id = pSkinData->mMeshID; + bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; + if ( fullRig ) + { + for ( int i=0; imJointNames[i].c_str(); + LLJoint* pJoint = getJoint( lookingForJoint ); + if ( pJoint && pJoint->getId() != currentId ) + { + pJoint->setId( currentId ); + const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); + //Set the joint position + pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); + + //If joint is a pelvis then handle old/new pelvis to foot values + if ( lookingForJoint == "mPelvis" ) + { + pelvisGotSet = true; + } + } + } + if (pelvisZOffset != 0.0F) + { + addPelvisFixup( pelvisZOffset, mesh_id ); + pelvisGotSet = true; + } + } + } + } + + //Rebuild body data if we altered joints/pelvis + if ( pelvisGotSet ) + { + postPelvisSetRecalc(); + } +} + //----------------------------------------------------------------------------- // resetJointPositionsOnDetach //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index ce1f0dd152..9a2aaf8aa3 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -199,8 +199,10 @@ public: virtual LLJoint* getJoint(const std::string &name); + void addAttachmentPosOverridesForObject(LLViewerObject *vo); void resetJointPositionsOnDetach(const LLUUID& mesh_id); void resetJointPositionsOnDetach(LLViewerObject *vo); + void clearAttachmentPosOverrides(); /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index aebd9f470d..5707d373bf 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4517,7 +4517,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //Determine if we've received skininfo that contains an //alternate bind matrix - if it does then apply the translational component //to the joints of the avatar. +#if 0 bool pelvisGotSet = false; +#endif { LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_FACE_LIST); @@ -4602,55 +4604,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //get drawpool of avatar with rigged face LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj); + // FIXME should this be inside the face loop? + // doesn't seem to depend on any per-face state. if ( pAvatarVO ) { - LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); - const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj ); - if ( pSkinData ) - { - const int bindCnt = pSkinData->mAlternateBindMatrix.size(); - if ( bindCnt > 0 ) - { - const int jointCnt = pSkinData->mJointNames.size(); - const F32 pelvisZOffset = pSkinData->mPelvisOffset; - const LLUUID& mesh_id = pSkinData->mMeshID; - bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; - if ( fullRig ) - { - for ( int i=0; imJointNames[i].c_str(); - LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint ); - if ( pJoint && pJoint->getId() != currentId ) - { - pJoint->setId( currentId ); - const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - - //Set the joint position - pJoint->addAttachmentPosOverride( jointPos, mesh_id, pAvatarVO->avString() ); - - //If joint is a pelvis then handle old/new pelvis to foot values - if ( lookingForJoint == "mPelvis" ) - { - pelvisGotSet = true; - } - } - } - if (pelvisZOffset != 0.0F) - { - pAvatarVO->addPelvisFixup( pelvisZOffset, mesh_id ); - pelvisGotSet = true; - } - } - } - } + pAvatarVO->addAttachmentPosOverridesForObject(vobj); } - - //Rebuild body data if we altered joints/pelvis - if ( pelvisGotSet && pAvatarVO ) - { - pAvatarVO->postPelvisSetRecalc(); - } if (pool) { @@ -5008,14 +4967,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } } - - - - - - - - } group->mBufferUsage = useage; -- cgit v1.2.3 From 7b6131fbf9c083d7d81f5f791ffe104df4f40aa3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Sat, 15 Nov 2014 14:36:30 -0500 Subject: MAINT-4537 WIP - comments and cleanup --- indra/newview/llagentwearables.cpp | 4 +-- indra/newview/llappearancemgr.cpp | 51 ++++++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 585f14df3d..f06ffb4fb3 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1105,10 +1105,10 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it notifyLoadingFinished(); - // Have to copy wearable params to avatar + // Copy wearable params to avatar. gAgentAvatarp->writeWearablesToAvatar(); - // ... before this will do anything. + // Then update the avatar based on the copied params. gAgentAvatarp->updateVisualParams(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 943190e7b1..e6cf048cec 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -807,12 +807,13 @@ void LLWearableHoldingPattern::onAllComplete() } } - LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL; - LLAgentWearables::llvo_vec_t objects_to_remove; - LLAgentWearables::llvo_vec_t objects_to_retain; - LLInventoryModel::item_array_t items_to_add; if (isAgentAvatarValid()) { + LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL; + LLAgentWearables::llvo_vec_t objects_to_remove; + LLAgentWearables::llvo_vec_t objects_to_retain; + LLInventoryModel::item_array_t items_to_add; + LLAgentWearables::findAttachmentsAddRemoveInfo(mObjItems, objects_to_remove, objects_to_retain, @@ -820,26 +821,32 @@ void LLWearableHoldingPattern::onAllComplete() LL_DEBUGS("Avatar") << self_av_string() << "Removing " << objects_to_remove.size() << " attachments" << LL_ENDL; - gAgentAvatarp->clearAttachmentPosOverrides(); - LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove); - } - // Update wearables. - LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; - LLAppearanceMgr::instance().updateAgentWearables(this); - - // Restore attachment pos overrides for the attachments that aren't going away. - for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_retain.begin(); - it != objects_to_retain.end(); - ++it) - { - LLViewerObject *objectp = *it; - gAgentAvatarp->addAttachmentPosOverridesForObject(objectp); - } + // Here we remove the attachment pos overrides for *all* + // attachments, even those that are not being removed. This is + // needed to get joint positions all slammed down to their + // pre-attachment states. + gAgentAvatarp->clearAttachmentPosOverrides(); - // Update attachments to match those requested. - if (isAgentAvatarValid()) - { + // Take off the attachments that will no longer be in the outfit. + LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove); + + // Update wearables. + LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " + << mResolved << " wearable items " << LL_ENDL; + LLAppearanceMgr::instance().updateAgentWearables(this); + + // Restore attachment pos overrides for the attachments that + // are remaining in the outfit. + for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_retain.begin(); + it != objects_to_retain.end(); + ++it) + { + LLViewerObject *objectp = *it; + gAgentAvatarp->addAttachmentPosOverridesForObject(objectp); + } + + // Add new attachments to match those requested. LL_DEBUGS("Avatar") << self_av_string() << "Adding " << items_to_add.size() << " attachments" << LL_ENDL; LLAgentWearables::userAttachMultipleAttachments(items_to_add); } -- cgit v1.2.3 From 1135ba80ec569e20187c36a5364debf9eae8aab7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 19 Nov 2014 09:19:03 -0500 Subject: MAINT-4537, MAINT-4687 WIP --- indra/llcharacter/lljoint.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 6615a430ab..6f22a7c6b7 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -381,6 +381,7 @@ void LLJoint::clearAttachmentPosOverrides() { m_attachmentOverrides.clear(); setPosition(m_posBeforeOverrides); + setId( LLUUID::null ); } } -- cgit v1.2.3 From d960676c5af26b299166bdd74744a7f513b45541 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 1 Dec 2014 14:37:13 -0500 Subject: increment viewer version to 3.7.22 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index c6cff55cf7..b49c354524 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.21 +3.7.22 -- cgit v1.2.3 From 147d1922450f289fe675dc6f0ccce9094db13b38 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 1 Dec 2014 17:13:35 -0500 Subject: merge fix --- indra/newview/llvoavatar.cpp | 68 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index eb69458f0e..b54f341c31 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7773,47 +7773,47 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara } } - } - avatar_joint_list_t::iterator iter = mSkeleton.begin(); - avatar_joint_list_t::iterator end = mSkeleton.end(); - for (; iter != end; ++iter) - { - LLJoint* pJoint = (*iter); - const LLVector3& pos = pJoint->getPosition(); - const LLVector3& scale = pJoint->getScale(); - apr_file_printf( file, "\t\t\n", - pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); - } + avatar_joint_list_t::iterator iter = mSkeleton.begin(); + avatar_joint_list_t::iterator end = mSkeleton.end(); + for (; iter != end; ++iter) + { + LLJoint* pJoint = (*iter); + const LLVector3& pos = pJoint->getPosition(); + const LLVector3& scale = pJoint->getScale(); + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); + } - for (iter = mSkeleton.begin(); iter != end; ++iter) - { - LLJoint* pJoint = (*iter); + for (iter = mSkeleton.begin(); iter != end; ++iter) + { + LLJoint* pJoint = (*iter); - LLVector3 pos; - LLUUID mesh_id; + LLVector3 pos; + LLUUID mesh_id; - if (pJoint->hasAttachmentPosOverride(pos,mesh_id)) + if (pJoint->hasAttachmentPosOverride(pos,mesh_id)) + { + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str()); + } + } + F32 pelvis_fixup; + LLUUID mesh_id; + if (hasPelvisFixup(pelvis_fixup, mesh_id)) { - apr_file_printf( file, "\t\t\n", - pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str()); + apr_file_printf( file, "\t\t\n", + pelvis_fixup, mesh_id.asString().c_str()); } - } - F32 pelvis_fixup; - LLUUID mesh_id; - if (hasPelvisFixup(pelvis_fixup, mesh_id)) - { - apr_file_printf( file, "\t\t\n", - pelvis_fixup, mesh_id.asString().c_str()); - } - apr_file_printf( file, "\t\n" ); - apr_file_printf( file, "\n\n" ); + apr_file_printf( file, "\t\n" ); + apr_file_printf( file, "\n\n" ); - bool ultra_verbose = false; - if (isSelf() && ultra_verbose) - { - // show the cloned params inside the wearables as well. - gAgentAvatarp->dumpWearableInfo(outfile); + bool ultra_verbose = false; + if (isSelf() && ultra_verbose) + { + // show the cloned params inside the wearables as well. + gAgentAvatarp->dumpWearableInfo(outfile); + } } // File will close when handle goes out of scope } -- cgit v1.2.3