mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-09 21:04:41 +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',
|
||||
'time',
|
||||
'controlpoints'
|
||||
],
|
||||
{
|
||||
"default": 'time'
|
||||
|
||||
@ -303,7 +303,12 @@ function createSplineEditor(context, reset=false) {
|
||||
|
||||
createContextMenu();
|
||||
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 (pointsLayer) {
|
||||
@ -362,6 +367,7 @@ function createSplineEditor(context, reset=false) {
|
||||
dotShape = "triangle"
|
||||
}
|
||||
|
||||
|
||||
interpolationWidget.callback = () => {
|
||||
interpolation = interpolationWidget.value
|
||||
updatePath();
|
||||
@ -371,6 +377,10 @@ function createSplineEditor(context, reset=false) {
|
||||
if (samplingMethod == "path") {
|
||||
dotShape = "triangle"
|
||||
}
|
||||
else if (samplingMethod == "controlpoints") {
|
||||
dotShape = "circle"
|
||||
drawSamplePoints = true;
|
||||
}
|
||||
updatePath();
|
||||
}
|
||||
tensionWidget.callback = () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user