forked from cocos/cocos-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* NewGenAnim * NewGenAnim * NewGenAnim * allow create animgraph asset * add animation-graph edit template * NewGenAnim * add layers variables * Update * NewGenAnim * Update * Update * Update * Update * NewGenAnim * Fix * .transitions() * Fix * NewGenAnim * .transitions() * Change nodes to nodes() * Update * change animation-graph dumpData * removeLayer() removeVariable() * NewGenAnim * .transitions() * Change nodes to nodes() * Update * removeLayer() removeVariable() * moveLayer() * only open button in inspector Co-authored-by: arsen2010 <arsen2010@126.com>
- Loading branch information
1 parent
390644b
commit e11b507
Showing
4 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"__type__": "cc.animation.PoseGraph", | ||
"_name": "", | ||
"_objFlags": 0, | ||
"_native": "", | ||
"_layers": [ | ||
{ | ||
"weight": 1, | ||
"mask": null, | ||
"blending": 1, | ||
"_graph": { | ||
"_bindings": {}, | ||
"name": "Main Layer", | ||
"_nodes": [ | ||
{ | ||
"_bindings": {}, | ||
"name": "" | ||
}, | ||
{ | ||
"_bindings": {}, | ||
"name": "" | ||
}, | ||
{ | ||
"_bindings": {}, | ||
"name": "" | ||
} | ||
], | ||
"_transitions": [], | ||
"_entryNode": { | ||
"_bindings": {}, | ||
"name": "" | ||
}, | ||
"_existNode": { | ||
"_bindings": {}, | ||
"name": "" | ||
}, | ||
"_anyNode": { | ||
"_bindings": {}, | ||
"name": "" | ||
} | ||
} | ||
} | ||
], | ||
"_variables": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"ver": "1.0.0", | ||
"importer": "*", | ||
"imported": true, | ||
"uuid": "e0a8e34d-9242-4f0f-833b-f57e1ffbf285", | ||
"files": [ | ||
"", | ||
".json" | ||
], | ||
"subMetas": {}, | ||
"userData": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
exports.template = ` | ||
<section class="asset-animation-graph"> | ||
<ui-button class="open">Open Animation Graph Editor Panel</ui-button> | ||
<ui-label class="tip" value="Not support multiple selections"></ui-label> | ||
</section> | ||
`; | ||
|
||
exports.style = ` | ||
.asset-animation-graph { | ||
padding-top: 10px; | ||
text-align: center; | ||
} | ||
.asset-animation-graph .tip { | ||
color: var(--color-focus-contrast-weakest); | ||
} | ||
`; | ||
|
||
exports.$ = { | ||
constainer: '.asset-animation-graph', | ||
button: '.open', | ||
tip: '.tip', | ||
}; | ||
|
||
exports.ready = function() { | ||
this.$.button.addEventListener('click', async () => { | ||
await Editor.Message.request('scene', 'execute-scene-script', { | ||
name: 'animation-graph', | ||
method: 'edit', | ||
args: [this.asset.uuid], | ||
}); | ||
|
||
Editor.Panel.open('animation-graph'); | ||
}); | ||
}; | ||
|
||
exports.update = function(assetList, metaList) { | ||
this.assetList = assetList; | ||
this.metaList = metaList; | ||
this.meta = this.metaList[0]; | ||
this.asset = this.assetList[0]; | ||
|
||
if (assetList.length !== 1) { | ||
this.$.button.disabled = true; | ||
this.$.tip.style.display = 'block'; | ||
} else { | ||
this.$.button.disabled = false; | ||
this.$.tip.style.display = 'none'; | ||
} | ||
}; | ||
|