Merge pull request #10251 from birarda/edit-baked-column

add a column to edit.js to identity baked models
This commit is contained in:
Brad Hefta-Gaub 2017-04-25 13:04:48 -07:00 committed by GitHub
commit 0783433d75
5 changed files with 30 additions and 11 deletions

View file

@ -289,7 +289,7 @@ input[type=number]::-webkit-inner-spin-button:after {
bottom: 4px; bottom: 4px;
} }
input[type=number].hover-up::-webkit-inner-spin-button:before, input[type=number].hover-up::-webkit-inner-spin-button:before,
input[type=number].hover-down::-webkit-inner-spin-button:after { input[type=number].hover-down::-webkit-inner-spin-button:after {
color: #ffffff; color: #ffffff;
} }
@ -1037,6 +1037,12 @@ th#entity-hasTransparent .sort-order {
top: -1px; top: -1px;
} }
#entity-table td.isBaked.glyph {
font-size: 22px;
position: relative;
top: -1px;
}
#entity-table tfoot { #entity-table tfoot {
box-sizing: border-box; box-sizing: border-box;
border: 2px solid #575757; border: 2px solid #575757;
@ -1062,7 +1068,7 @@ th#entity-hasTransparent .sort-order {
#col-locked, #col-visible { #col-locked, #col-visible {
width: 9%; width: 9%;
} }
#col-verticesCount, #col-texturesCount, #col-texturesSize, #col-hasTransparent, #col-drawCalls, #col-hasScript { #col-verticesCount, #col-texturesCount, #col-texturesSize, #col-hasTransparent, #col-isBaked, #col-drawCalls, #col-hasScript {
width: 0; width: 0;
} }
@ -1090,6 +1096,9 @@ th#entity-hasTransparent .sort-order {
.showExtraInfo #col-hasTransparent { .showExtraInfo #col-hasTransparent {
width: 4%; width: 4%;
} }
.showExtraInfo #col-isBaked {
width: 8%;
}
.showExtraInfo #col-drawCalls { .showExtraInfo #col-drawCalls {
width: 8%; width: 8%;
} }
@ -1097,12 +1106,12 @@ th#entity-hasTransparent .sort-order {
width: 6%; width: 6%;
} }
th#entity-verticesCount, th#entity-texturesCount, th#entity-texturesSize, th#entity-hasTransparent, th#entity-drawCalls, th#entity-verticesCount, th#entity-texturesCount, th#entity-texturesSize, th#entity-hasTransparent, th#entity-isBaked, th#entity-drawCalls,
th#entity-hasScript { th#entity-hasScript {
display: none; display: none;
} }
.verticesCount, .texturesCount, .texturesSize, .hasTransparent, .drawCalls, .hasScript { .verticesCount, .texturesCount, .texturesSize, .hasTransparent, .isBaked, .drawCalls, .hasScript {
display: none; display: none;
} }
@ -1110,13 +1119,13 @@ th#entity-hasScript {
border: none; border: none;
} }
.showExtraInfo #entity-verticesCount, .showExtraInfo #entity-texturesCount, .showExtraInfo #entity-texturesSize, .showExtraInfo #entity-verticesCount, .showExtraInfo #entity-texturesCount, .showExtraInfo #entity-texturesSize,
.showExtraInfo #entity-hasTransparent, .showExtraInfo #entity-drawCalls, .showExtraInfo #entity-hasScript { .showExtraInfo #entity-hasTransparent, .showExtraInfo #entity-isBaked, .showExtraInfo #entity-drawCalls, .showExtraInfo #entity-hasScript {
display: inline-block; display: inline-block;
} }
.showExtraInfo .verticesCount, .showExtraInfo .texturesCount, .showExtraInfo .texturesSize, .showExtraInfo .hasTransparent, .showExtraInfo .verticesCount, .showExtraInfo .texturesCount, .showExtraInfo .texturesSize, .showExtraInfo .hasTransparent,
.showExtraInfo .drawCalls, .showExtraInfo .hasScript { .showExtraInfo .isBaked, .showExtraInfo .drawCalls, .showExtraInfo .hasScript {
display: table-cell; display: table-cell;
} }

View file

@ -49,6 +49,7 @@
<col span="1" id="col-texturesCount" /> <col span="1" id="col-texturesCount" />
<col span="1" id="col-texturesSize" /> <col span="1" id="col-texturesSize" />
<col span="1" id="col-hasTransparent" /> <col span="1" id="col-hasTransparent" />
<col span="1" id="col-isBaked" />
<col span="1" id="col-drawCalls" /> <col span="1" id="col-drawCalls" />
<col span="1" id="col-hasScript" /> <col span="1" id="col-hasScript" />
</colgroup> </colgroup>
@ -63,6 +64,7 @@
<th id="entity-texturesCount">Texts<span class="sort-order"></span></th> <th id="entity-texturesCount">Texts<span class="sort-order"></span></th>
<th id="entity-texturesSize">Text MB<span class="sort-order"></span></th> <th id="entity-texturesSize">Text MB<span class="sort-order"></span></th>
<th id="entity-hasTransparent"><span class="glyph">&#xe00b;</span><span class="sort-order"></span></th> <th id="entity-hasTransparent"><span class="glyph">&#xe00b;</span><span class="sort-order"></span></th>
<th id="entity-isBaked">Baked<span class="sort-order"></span></th>
<th id="entity-drawCalls">Draws<span class="sort-order"></span></th> <th id="entity-drawCalls">Draws<span class="sort-order"></span></th>
<th colspan="1" id="entity-hasScript"><span class="glyph">k</span><span class="sort-order"></span></th> <th colspan="1" id="entity-hasScript"><span class="glyph">k</span><span class="sort-order"></span></th>
</tr> </tr>
@ -78,6 +80,7 @@
<td class="texturesCount"></td> <td class="texturesCount"></td>
<td class="texturesSize"></td> <td class="texturesSize"></td>
<td class="hasTransparent glyph"></td> <td class="hasTransparent glyph"></td>
<td class="isBaked glyph"></td>
<td class="drawCalls"></td> <td class="drawCalls"></td>
<td class="hasScript glyph"></td> <td class="hasScript glyph"></td>
<td class="id" style="display: none"></td> <td class="id" style="display: none"></td>
@ -85,7 +88,7 @@
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td id="footer-text" colspan="11"> </td> <td id="footer-text" colspan="12"> </td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

View file

@ -17,6 +17,7 @@ const DESCENDING_STRING = '&#x25BE;';
const LOCKED_GLYPH = "&#xe006;"; const LOCKED_GLYPH = "&#xe006;";
const VISIBLE_GLYPH = "&#xe007;"; const VISIBLE_GLYPH = "&#xe007;";
const TRANSPARENCY_GLYPH = "&#xe00b;"; const TRANSPARENCY_GLYPH = "&#xe00b;";
const BAKED_GLYPH = "&#xe01a;"
const SCRIPT_GLYPH = "k"; const SCRIPT_GLYPH = "k";
const DELETE = 46; // Key code for the delete key. const DELETE = 46; // Key code for the delete key.
const KEY_P = 80; // Key code for letter p used for Parenting hotkey. const KEY_P = 80; // Key code for letter p used for Parenting hotkey.
@ -77,6 +78,9 @@ function loaded() {
document.getElementById("entity-hasTransparent").onclick = function () { document.getElementById("entity-hasTransparent").onclick = function () {
setSortColumn('hasTransparent'); setSortColumn('hasTransparent');
}; };
document.getElementById("entity-isBaked").onclick = function () {
setSortColumn('isBaked');
};
document.getElementById("entity-drawCalls").onclick = function () { document.getElementById("entity-drawCalls").onclick = function () {
setSortColumn('drawCalls'); setSortColumn('drawCalls');
}; };
@ -147,7 +151,7 @@ function loaded() {
} }
function addEntity(id, name, type, url, locked, visible, verticesCount, texturesCount, texturesSize, hasTransparent, function addEntity(id, name, type, url, locked, visible, verticesCount, texturesCount, texturesSize, hasTransparent,
drawCalls, hasScript) { isBaked, drawCalls, hasScript) {
var urlParts = url.split('/'); var urlParts = url.split('/');
var filename = urlParts[urlParts.length - 1]; var filename = urlParts[urlParts.length - 1];
@ -157,7 +161,7 @@ function loaded() {
id: id, name: name, type: type, url: filename, locked: locked, visible: visible, id: id, name: name, type: type, url: filename, locked: locked, visible: visible,
verticesCount: displayIfNonZero(verticesCount), texturesCount: displayIfNonZero(texturesCount), verticesCount: displayIfNonZero(verticesCount), texturesCount: displayIfNonZero(texturesCount),
texturesSize: decimalMegabytes(texturesSize), hasTransparent: hasTransparent, texturesSize: decimalMegabytes(texturesSize), hasTransparent: hasTransparent,
drawCalls: displayIfNonZero(drawCalls), hasScript: hasScript isBaked: isBaked, drawCalls: displayIfNonZero(drawCalls), hasScript: hasScript
}], }],
function (items) { function (items) {
var currentElement = items[0].elm; var currentElement = items[0].elm;
@ -201,6 +205,7 @@ function loaded() {
texturesCount: document.querySelector('#entity-texturesCount .sort-order'), texturesCount: document.querySelector('#entity-texturesCount .sort-order'),
texturesSize: document.querySelector('#entity-texturesSize .sort-order'), texturesSize: document.querySelector('#entity-texturesSize .sort-order'),
hasTransparent: document.querySelector('#entity-hasTransparent .sort-order'), hasTransparent: document.querySelector('#entity-hasTransparent .sort-order'),
isBaked: document.querySelector('#entity-isBaked .sort-order'),
drawCalls: document.querySelector('#entity-drawCalls .sort-order'), drawCalls: document.querySelector('#entity-drawCalls .sort-order'),
hasScript: document.querySelector('#entity-hasScript .sort-order'), hasScript: document.querySelector('#entity-hasScript .sort-order'),
} }
@ -350,6 +355,7 @@ function loaded() {
newEntities[i].visible ? VISIBLE_GLYPH : null, newEntities[i].visible ? VISIBLE_GLYPH : null,
newEntities[i].verticesCount, newEntities[i].texturesCount, newEntities[i].texturesSize, newEntities[i].verticesCount, newEntities[i].texturesCount, newEntities[i].texturesSize,
newEntities[i].hasTransparent ? TRANSPARENCY_GLYPH : null, newEntities[i].hasTransparent ? TRANSPARENCY_GLYPH : null,
newEntities[i].isBaked ? BAKED_GLYPH : null,
newEntities[i].drawCalls, newEntities[i].drawCalls,
newEntities[i].hasScript ? SCRIPT_GLYPH : null); newEntities[i].hasScript ? SCRIPT_GLYPH : null);
} }

View file

@ -88,6 +88,7 @@ EntityListTool = function(opts) {
texturesCount: valueIfDefined(properties.renderInfo.texturesCount), texturesCount: valueIfDefined(properties.renderInfo.texturesCount),
texturesSize: valueIfDefined(properties.renderInfo.texturesSize), texturesSize: valueIfDefined(properties.renderInfo.texturesSize),
hasTransparent: valueIfDefined(properties.renderInfo.hasTransparent), hasTransparent: valueIfDefined(properties.renderInfo.hasTransparent),
isBaked: properties.type == "Model" ? properties.modelURL.toLowerCase().endsWith(".baked.fbx") : false,
drawCalls: valueIfDefined(properties.renderInfo.drawCalls), drawCalls: valueIfDefined(properties.renderInfo.drawCalls),
hasScript: properties.script !== "" hasScript: properties.script !== ""
}); });