修复动画问题
This commit is contained in:
@@ -1348,6 +1348,26 @@ bool ProjectWorkspace::setEntityImageFrame(const QString& id, int frame, const Q
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ProjectWorkspace::setEntityImageFramePath(const QString& id, int frame, const QString& relativePath) {
|
||||
if (m_projectDir.isEmpty() || id.isEmpty() || frame < 0) {
|
||||
return false;
|
||||
}
|
||||
const QString rel = relativePath.trimmed();
|
||||
if (rel.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
auto ents = m_project.entities();
|
||||
bool found = false;
|
||||
for (auto& e : ents) {
|
||||
if (e.id != id) continue;
|
||||
found = true;
|
||||
upsertFrame(e.imageFrames, frame, rel);
|
||||
break;
|
||||
}
|
||||
if (!found) return false;
|
||||
return applyEntities(ents, true, QStringLiteral("插入关键帧(图像)"));
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
bool removeLocationKeyAtFrame(QVector<Project::Entity::KeyframeVec2>& keys, int frame) {
|
||||
|
||||
@@ -91,6 +91,8 @@ public:
|
||||
bool setEntityDepthScaleKey(const QString& id, int frame, double value01);
|
||||
bool setEntityUserScaleKey(const QString& id, int frame, double userScale);
|
||||
bool setEntityImageFrame(const QString& id, int frame, const QImage& image, QString* outRelPath = nullptr);
|
||||
// 仅更新 imageFrames 中某帧的图像路径(不读图、不写盘),用于高性能地“切断”Hold 区间
|
||||
bool setEntityImageFramePath(const QString& id, int frame, const QString& relativePath);
|
||||
bool removeEntityLocationKey(const QString& id, int frame);
|
||||
bool removeEntityDepthScaleKey(const QString& id, int frame);
|
||||
bool removeEntityUserScaleKey(const QString& id, int frame);
|
||||
|
||||
Reference in New Issue
Block a user