Add dark defaults, modular effect templates and canvas leveling

这个提交包含在:
mac 于 2026-11-06 11:29:52 +08:00 提交
1 父节点 ffabdca5b1
当前提交 5ca307414c
25 个文件已更改
+1702 -88

没有与搜索条件相匹配的文件

@@ -104,6 +104,44 @@
[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrack" object:self->_apiManager userInfo:@{@"node":@"shared",@"mask":stampID,@"direction":@(direction)}];
});
}
- (DYLevelTransform)toolCanvasLevelForAspect:(double)fallback rotation:(double *)rotation {
@synchronized(self){
double angle=[_toolCanvasDocument[@"levelRotation"] doubleValue];
if(rotation)*rotation=angle;
return DYLevelTransform(angle,_toolSourceAspect>0?_toolSourceAspect:fallback);
}
}
- (void)saveCanvasLevel:(double)rotation replacing:(double)previous completion:(void (^)(NSString *failure))completion {
dispatch_async(dispatch_get_main_queue(),^{
NSString *failure=nil;
id<FxCustomParameterActionAPI_v4> action=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];
if(!action){completion(@"宿主暂时无法保存水平校正。");return;}
[action startAction:self];
@try {
// The correction is clip-wide. Use the action clock for the document write.
CMTime time=DYHostDisplayedFrameTime(self->_apiManager,action.currentTime);
DYToolDocument *stored=nil;
id<FxParameterRetrievalAPI_v6> get=[self->_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
if(!CMTIME_IS_NUMERIC(time)||![get getCustomParameterValue:&stored fromParameter:DYToolsParameterID atTime:time]||
![stored isKindOfClass:DYToolDocument.class]||[stored.document[@"levelRotation"] doubleValue]!=previous){
failure=@"水平校正状态已变化,请重新画线。";
}else if(rotation!=previous){
NSMutableDictionary *doc=DYMutablePlist(stored.document);
doc[@"levelRotation"]=rotation?@(rotation):nil;
id<FxUndoAPI> undo=[self->_apiManager apiForProtocol:@protocol(FxUndoAPI)];
BOOL grouped=[undo startUndoGroup:rotation?@"水平校正":@"重置水平校正"];
@try {
if(DYWriteTools(self->_apiManager,doc,time)){
DYToolDocument *saved=[[[DYToolDocument alloc]init]autorelease];saved.document=doc;
[self adoptToolCanvasDocument:saved.document];
}else failure=@"宿主未保存水平校正,请重试。";
}@finally{if(grouped)[undo endUndoGroup];}
}
}@finally{[action endAction:self];}
if(!failure)[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self->_apiManager];
completion(failure);
});
}
- (BOOL)toolCanvasVisible {@synchronized(self){return _selectedToolNode&&_selectedToolMask&&!_toolCanvasHidden;}}
- (DYViewerParameterBridge*)viewerParameterBridge{return _viewerParameterBridge;}
- (NSDictionary*)toolCanvasMaskAtTime:(CMTime)time {