mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-20 02:04:35 +08:00
Direct controlpoint sample method to spline editor
This commit is contained in:
parent
7191a1fbbb
commit
ad60519856
@ -113,6 +113,7 @@ class SplineEditor:
|
|||||||
[
|
[
|
||||||
'path',
|
'path',
|
||||||
'time',
|
'time',
|
||||||
|
'controlpoints'
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
"default": 'time'
|
"default": 'time'
|
||||||
|
|||||||
@ -303,7 +303,12 @@ function createSplineEditor(context, reset=false) {
|
|||||||
|
|
||||||
createContextMenu();
|
createContextMenu();
|
||||||
function updatePath() {
|
function updatePath() {
|
||||||
let coords = samplePoints(pathElements[0], points_to_sample, samplingMethod, w);
|
if (samplingMethod != "controlpoints") {
|
||||||
|
var coords = samplePoints(pathElements[0], points_to_sample, samplingMethod, w);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var coords = points
|
||||||
|
}
|
||||||
|
|
||||||
if (drawSamplePoints) {
|
if (drawSamplePoints) {
|
||||||
if (pointsLayer) {
|
if (pointsLayer) {
|
||||||
@ -362,6 +367,7 @@ function createSplineEditor(context, reset=false) {
|
|||||||
dotShape = "triangle"
|
dotShape = "triangle"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interpolationWidget.callback = () => {
|
interpolationWidget.callback = () => {
|
||||||
interpolation = interpolationWidget.value
|
interpolation = interpolationWidget.value
|
||||||
updatePath();
|
updatePath();
|
||||||
@ -371,6 +377,10 @@ function createSplineEditor(context, reset=false) {
|
|||||||
if (samplingMethod == "path") {
|
if (samplingMethod == "path") {
|
||||||
dotShape = "triangle"
|
dotShape = "triangle"
|
||||||
}
|
}
|
||||||
|
else if (samplingMethod == "controlpoints") {
|
||||||
|
dotShape = "circle"
|
||||||
|
drawSamplePoints = true;
|
||||||
|
}
|
||||||
updatePath();
|
updatePath();
|
||||||
}
|
}
|
||||||
tensionWidget.callback = () => {
|
tensionWidget.callback = () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user