mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-14 15:24:34 +08:00
Update spline_editor.js
This commit is contained in:
parent
bdade789ee
commit
d5e37ff797
@ -129,9 +129,6 @@ app.registerExtension({
|
|||||||
this.splineEditor.parentEl.id = `spline-editor-${this.uuid}`
|
this.splineEditor.parentEl.id = `spline-editor-${this.uuid}`
|
||||||
element.appendChild(this.splineEditor.parentEl);
|
element.appendChild(this.splineEditor.parentEl);
|
||||||
|
|
||||||
console.log(this.properties)
|
|
||||||
|
|
||||||
|
|
||||||
//disable context menu on right click
|
//disable context menu on right click
|
||||||
document.addEventListener('contextmenu', function(e) {
|
document.addEventListener('contextmenu', function(e) {
|
||||||
if (e.button === 2) { // Right mouse button
|
if (e.button === 2) { // Right mouse button
|
||||||
@ -167,7 +164,6 @@ function createSplineEditor(context, reset=false) {
|
|||||||
var i = 3
|
var i = 3
|
||||||
let points = [];
|
let points = [];
|
||||||
if (!reset && pointsStoreWidget.value != "") {
|
if (!reset && pointsStoreWidget.value != "") {
|
||||||
console.log(pointsStoreWidget.value);
|
|
||||||
points = JSON.parse(pointsStoreWidget.value);
|
points = JSON.parse(pointsStoreWidget.value);
|
||||||
} else {
|
} else {
|
||||||
points = pv.range(1, 4).map((i, index) => {
|
points = pv.range(1, 4).map((i, index) => {
|
||||||
@ -206,11 +202,9 @@ function createSplineEditor(context, reset=false) {
|
|||||||
if (this.pathElements !== null) {
|
if (this.pathElements !== null) {
|
||||||
let coords = samplePoints(pathElements[0], pointsWidget.value);
|
let coords = samplePoints(pathElements[0], pointsWidget.value);
|
||||||
let coordsString = JSON.stringify(coords);
|
let coordsString = JSON.stringify(coords);
|
||||||
console.log(points)
|
|
||||||
pointsStoreWidget.value = JSON.stringify(points);
|
pointsStoreWidget.value = JSON.stringify(points);
|
||||||
if (coordWidget) {
|
if (coordWidget) {
|
||||||
coordWidget.value = coordsString;
|
coordWidget.value = coordsString;
|
||||||
console.log("stored points: ", pointsStoreWidget.value)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user