[Case 6491] Fixes consistency issue with lights (details below).

Fixes issue with light selection actions having inconsistent ui
in comparison to other selections from an earlier commit change.

As of this commit:
* When translating point lights, the edge grabbers are no longer be visible.
* When rotating or translating spot lights, the edge grabbers are no longer visible.

Note:
* For both point & spot lights, when translating and/or rotating, their circle
  and/or radial guides should remain visible.  This commit shouldn't have any
  influence on that behavior.

Tested:
* Rotating and translating spot lights.
* Translating point lights.  Didn't test rotation as only spot
  lights support rotation.

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
This commit is contained in:
LaShonda Hopper 2017-08-16 18:15:36 -04:00 committed by LaShonda Hopper
parent 9fb76340c7
commit bed50dda2f

View file

@ -1091,7 +1091,7 @@ SelectionDisplay = (function() {
// that correlates to the tool you wish to query.
// @return: bool - Indicates if the activeTool is that queried.
function isActiveTool(toolHandle) {
var wantDebug = true;
var wantDebug = false;
if ( ! activeTool || ! toolHandle ){
if(wantDebug){
if ( activeTool ){
@ -1610,7 +1610,7 @@ SelectionDisplay = (function() {
// FUNCTION: UPDATE HANDLES
that.updateHandles = function() {
var wantDebug = true;
var wantDebug = false;
if(wantDebug){
print( "======> Update Handles =======" );
print( " Selections Count: " + SelectionManager.selections.length );
@ -1873,6 +1873,8 @@ SelectionDisplay = (function() {
if(properties.isSpotlight) {
that.setPointLightHandlesVisible( false );
var distance = (properties.dimensions.z / 2) * Math.sin(properties.cutoff * (Math.PI / 180));
var showEdgeSpotGrabbers = ! (inModeTranslate || inModeRotate);
Overlays.editOverlay(grabberSpotLightCenter, {
position: position,
visible: false,
@ -1880,29 +1882,28 @@ SelectionDisplay = (function() {
Overlays.editOverlay(grabberSpotLightRadius, {
position: NEAR,
rotation: rotation,
visible: true,
visible: showEdgeSpotGrabbers,
});
var distance = (properties.dimensions.z / 2) * Math.sin(properties.cutoff * (Math.PI / 180));
Overlays.editOverlay(grabberSpotLightL, {
position: EdgeNL,
rotation: rotation,
visible: true,
visible: showEdgeSpotGrabbers,
});
Overlays.editOverlay(grabberSpotLightR, {
position: EdgeNR,
rotation: rotation,
visible: true,
visible: showEdgeSpotGrabbers,
});
Overlays.editOverlay(grabberSpotLightT, {
position: EdgeTN,
rotation: rotation,
visible: true,
visible: showEdgeSpotGrabbers,
});
Overlays.editOverlay(grabberSpotLightB, {
position: EdgeBN,
rotation: rotation,
visible: true,
visible: showEdgeSpotGrabbers,
});
Overlays.editOverlay(grabberSpotLightCircle, {
position: NEAR,
@ -1939,36 +1940,37 @@ SelectionDisplay = (function() {
} else { //..it's a PointLight
that.setSpotLightHandlesVisible( false );
var showEdgePointGrabbers = ! inModeTranslate;
Overlays.editOverlay(grabberPointLightT, {
position: TOP,
rotation: rotation,
visible: true,
visible: showEdgePointGrabbers,
});
Overlays.editOverlay(grabberPointLightB, {
position: BOTTOM,
rotation: rotation,
visible: true,
visible: showEdgePointGrabbers,
});
Overlays.editOverlay(grabberPointLightL, {
position: LEFT,
rotation: rotation,
visible: true,
visible: showEdgePointGrabbers,
});
Overlays.editOverlay(grabberPointLightR, {
position: RIGHT,
rotation: rotation,
visible: true,
visible: showEdgePointGrabbers,
});
Overlays.editOverlay(grabberPointLightF, {
position: FAR,
rotation: rotation,
visible: true,
visible: showEdgePointGrabbers,
});
Overlays.editOverlay(grabberPointLightN, {
position: NEAR,
rotation: rotation,
visible: true,
visible: showEdgePointGrabbers,
});
Overlays.editOverlay(grabberPointLightCircleX, {
position: position,