block requirements
This commit is contained in:
+10
-5
@@ -785,10 +785,13 @@
|
||||
function refreshBlockGuideFaces() {
|
||||
const roots = Group.all.filter((group) => group.name.startsWith(BLOCK_GUIDE_PREFIX)
|
||||
&& !isBlockRequirementGuide(group.parent));
|
||||
const elements = [];
|
||||
for (const root of roots) {
|
||||
hideInternalBlockGuideFaces(Cube.all.filter((cube) => cube.getAllAncestors().includes(root)));
|
||||
const cubes = Cube.all.filter((cube) => cube.getAllAncestors().includes(root));
|
||||
hideInternalBlockGuideFaces(cubes);
|
||||
elements.push(...cubes);
|
||||
}
|
||||
if (roots.length) Canvas.updateAllFaces();
|
||||
if (elements.length) Canvas.updateView({ elements, element_aspects: { faces: true, uv: true } });
|
||||
}
|
||||
|
||||
function rebuildBlockRequirementGuides(animationId, entry) {
|
||||
@@ -826,7 +829,9 @@
|
||||
}
|
||||
Project[BLOCK_REQUIREMENTS_PROPERTY] = JSON.stringify(updated);
|
||||
hideInternalBlockGuideFaces(createdElements);
|
||||
Canvas.updateAll();
|
||||
// Rebuilding every cube would reset forced actor materials in single-texture formats.
|
||||
Canvas.updateView({ elements: createdElements, groups: createdGroups,
|
||||
element_aspects: { transform: true, geometry: true, faces: true, uv: true, visibility: true } });
|
||||
for (const cube of createdElements) applyBlockRequirementGuideMaterial(cube);
|
||||
Undo.finishEdit(entry ? 'Set block requirement' : 'Remove block requirement',
|
||||
{ outliner: true, elements: createdElements, groups: createdGroups, block_requirement_edit: true });
|
||||
@@ -914,7 +919,7 @@
|
||||
blockRequirementPanel = new Panel('animationdirector_block_requirements', {
|
||||
name: 'Block Requirements', icon: 'view_in_ar', condition: () => !!Project,
|
||||
growable: true, resizable: true, min_height: 240, expand_button: true,
|
||||
default_position: { slot: 'right_bar', height: 520, float_size: [360, 620] },
|
||||
default_position: { slot: 'left_bar', height: 520, float_size: [360, 620] },
|
||||
component: {
|
||||
data() { return { projectId: null, animationId: '', draftId: '', ids: [], form: {}, values: {}, error: '', status: '', dirty: false }; },
|
||||
computed: {
|
||||
@@ -1020,7 +1025,7 @@
|
||||
const selected = parseAfwStageAnimationName(getSelectedAnimation());
|
||||
const ids = blockRequirementAnimationIds();
|
||||
view.load(selected?.id || (view.projectId === Project.uuid && view.animationId) || ids[0] || '');
|
||||
if (blockRequirementPanel.slot === 'hidden') blockRequirementPanel.moveTo('right_bar');
|
||||
if (blockRequirementPanel.slot === 'hidden') blockRequirementPanel.moveTo('left_bar');
|
||||
blockRequirementPanel.folded = false;
|
||||
blockRequirementPanel.getContainerPanel().selectTab(blockRequirementPanel);
|
||||
blockRequirementPanel.update();
|
||||
|
||||
Reference in New Issue
Block a user