From b60ae3e45b6cad5d458a9bb09fba7d1001d2bf3a Mon Sep 17 00:00:00 2001 From: mac Date: Thu, 5 Nov 2026 10:54:59 +0800 Subject: [PATCH] wip: adapt workspace groups and LUT grid, add skin-tone guide and host write diagnostics --- research/WorkspaceFeedback-20261105.md | 23 +++++++++++ verification/DYScopeMathDiagnostics.cpp | 2 +- 大鱼调色/Plugin/DYColorWorkspace.mm | 8 +++- 大鱼调色/Plugin/DYInspector.mm | 40 +++++++++++++------ 大鱼调色/Plugin/DYLUTBrowser.mm | 11 +++-- 大鱼调色/Plugin/DYNewPanels.inc.h | 3 +- 大鱼调色/Plugin/DYRenderer.mm | 1 + 大鱼调色/Plugin/DYScopeCapture.inc.h | 1 + 大鱼调色/Plugin/DYScopeMath.hpp | 3 ++ 大鱼调色/Plugin/DYToolCanvasEditing.inc.h | 4 +- 大鱼调色/Plugin/DYViewerParameterBridge.inc.h | 5 ++- 大鱼调色/Plugin/DYWorkspaceDiagnostics.inc.h | 5 ++- 大鱼调色/Plugin/DYWorkspaceTools.inc.h | 15 ++++--- 大鱼调色/Plugin/Info.plist | 2 +- 大鱼调色/Wrapper Application/Info.plist | 2 +- 15 files changed, 90 insertions(+), 35 deletions(-) create mode 100644 research/WorkspaceFeedback-20261105.md diff --git a/research/WorkspaceFeedback-20261105.md b/research/WorkspaceFeedback-20261105.md new file mode 100644 index 0000000..b8bf475 --- /dev/null +++ b/research/WorkspaceFeedback-20261105.md @@ -0,0 +1,23 @@ +# 用户现场反馈修订(候选 77,验收未完成) + +## 设计约定 + +以用户 2026-11-05 最新三张工作区截图及 HSL 截图为准。参数编辑器使用横向窄条;相关图形、选项和混合量必须同组排布。普通参数列按实际宽度分配,不能沿用固定 250pt。HSL 色组横排在轴参数上方,不另占一列。蜘蛛盘混合量并入盘面右侧控件。 + +LUT 属于有数量的浏览内容,恢复按视口宽度换行的多行网格与纵向滚动。此前把“不出现上下滚动条”泛化到 LUT 浏览库,造成用户明确拒绝的横向长条,本轮撤销这一布局;缩略图、文件夹、缓存、异步加载、应用逻辑保持。 + +畸变从统一工作区工具条和图层列表排除,仅通过画布控件调整;已有镜头数据与渲染保留。画布 LUT 入口若尚无可见 LUT 图层,则新增真实 LUT 图层并选中,不能在镜头高亮时给隐藏 base:look 打开浏览器。 + +## 矢量图肤色线 + +矢量图在当前 Cb/Cr 等比例坐标中增加从中性点向暖色方向的细虚线与“肤色”标签,作为参考而非肤色检测。采用传统正 I 方向 123°(由 +Cb 逆时针,+Cr 朝上),不增加图像处理参数。 + +依据:[Apple 的矢量图显示选项](https://support.apple.com/en-by/guide/final-cut-pro/ver761c9f95/mac)描述红黄目标之间的肤色线;[Blender 官方修正记录 #133316](https://projects.blender.org/blender/blender/pulls/133316)给出 90°+33° 和等比例坐标前提。 + +## 尚待现场诊断 + +用户确认画布曲线仍会回弹、钢笔闭合仍成矩形,不能把此前仅修复提交前一瞬默认轮廓的改动当作完成。增加仅本地系统日志,记录画布事件时刻、宿主动作时刻、节点数及保存/冲突结果,下一轮必须以真实宿主参数保存为结论。 + +76 首次暂停打开示波器成功,播放到片尾再关闭/打开则复现等待。当前唯一末帧缓存不足还是时间域不一致尚未证实;77 增加打开请求/缓存时刻日志,不以旧帧充当当前画面。 + +正式交付状态仍为待宿主验收,不能发布完成声明。 diff --git a/verification/DYScopeMathDiagnostics.cpp b/verification/DYScopeMathDiagnostics.cpp index 8f5cdaa..f27ccd5 100644 --- a/verification/DYScopeMathDiagnostics.cpp +++ b/verification/DYScopeMathDiagnostics.cpp @@ -2,7 +2,7 @@ #include #include int main(){ - using namespace dyscope;RGBA pixels[]={{1,0,0,1},{0,1,0,1},{0,0,1,1},{1.3f,-.2f,.5f,.5f},{2,2,2,0},{NAN,0,0,1}}; + using namespace dyscope;assert(SkinToneCb<0&&SkinToneCr>0);assert(std::abs(std::hypot(SkinToneCb,SkinToneCr)-1)<1e-12);assert(std::abs(std::atan2(SkinToneCr,SkinToneCb)-SkinToneAngle)<1e-12);RGBA pixels[]={{1,0,0,1},{0,1,0,1},{0,0,1,1},{1.3f,-.2f,.5f,.5f},{2,2,2,0},{NAN,0,0,1}}; auto r=measure(pixels,3,2);assert(r.valid==4&&r.transparent==1&&r.nonfinite==1);assert(r.above==1&&r.below==1);assert(r.minimum==-.2f&&r.maximum==1.3f); assert(r.histogram[bin(.2126f)]==1);assert(r.histogram[bin(.7152f)]==1);assert(r.histogram[bin(.0722f)]==1);assert(r.wave[(Bins-1-bin(.2126f))*Width]==1); assert(bin(-100)==0&&bin(100)==Bins-1);assert(bin(std::numeric_limits::max())==Bins-1&&bin(-std::numeric_limits::max())==0);auto im=densityImage(r.wave,false);assert(im.size()==size_t(Width)*Bins*4);assert(im[((Bins-1-bin(.2126f))*Width)*4]>0); diff --git a/大鱼调色/Plugin/DYColorWorkspace.mm b/大鱼调色/Plugin/DYColorWorkspace.mm index 5c601d6..1378883 100644 --- a/大鱼调色/Plugin/DYColorWorkspace.mm +++ b/大鱼调色/Plugin/DYColorWorkspace.mm @@ -65,7 +65,7 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b if(_metadata==data&&self.accessibilityLabel.length)return;[_metadata release];_metadata=[data copy];[_raster release];_raster=nil; NSString *key=_mode==0?@"waveform":_mode==1?@"parade":@"vectorscope";NSUInteger width=_mode==0?dyscope::Width:_mode==1?3*dyscope::Width:dyscope::Bins;NSData *bytes=_mode==2?nil:data[key]; if(bytes.length==width*dyscope::Bins*4){NSBitmapImageRep *rep=[[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:nil pixelsWide:width pixelsHigh:dyscope::Bins bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:width*4 bitsPerPixel:32]autorelease];memcpy(rep.bitmapData,bytes.bytes,bytes.length);_raster=[[NSImage alloc]initWithSize:NSMakeSize(width,dyscope::Bins)];[_raster addRepresentation:rep];} - self.accessibilityLabel=[NSString stringWithFormat:@"%@ · %@ · 有效取样 %@",self.scopeTitle,data[@"domain"]?:@"等待画面",data[@"valid"]?:@0];[self setNeedsDisplay:YES]; + self.accessibilityLabel=[NSString stringWithFormat:@"%@ · %@ · 有效取样 %@",(_mode==3?[self.scopeTitle stringByAppendingString:@"(含肤色指示线)"]:self.scopeTitle),data[@"domain"]?:@"等待画面",data[@"valid"]?:@0];[self setNeedsDisplay:YES]; } - (void)drawRect:(NSRect)dirty{ [[NSColor colorWithWhite:.085 alpha:1]setFill];NSRectFill(self.bounds);[[NSColor colorWithWhite:.25 alpha:1]setStroke];NSFrameRectWithWidth(NSInsetRect(self.bounds,.5,.5),.5); @@ -77,7 +77,11 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b [[NSColor colorWithWhite:.32 alpha:.7]setStroke]; if(_mode<2){for(int percent:{0,50,100}){CGFloat y=NSMaxY(plot)-(percent+10)/120.0*plot.size.height;NSBezierPath *line=[NSBezierPath bezierPath];[line moveToPoint:NSMakePoint(NSMinX(plot),y)];[line lineToPoint:NSMakePoint(NSMaxX(plot),y)];[line stroke];[[NSString stringWithFormat:@"%d",percent]drawAtPoint:NSMakePoint(2,y-5)withAttributes:text];}if(_mode==1)for(int c=0;c<3;c++){CGFloat x=plot.origin.x+c*plot.size.width/3;[@[@"R",@"G",@"B"][c]drawAtPoint:NSMakePoint(x+3,NSMaxY(plot)+1)withAttributes:text];}} else if(_mode==2){NSData *hist=_metadata[@"histogram"];if(hist.length==4*dyscope::Bins*sizeof(uint32_t)){auto *bins=(const uint32_t*)hist.bytes;uint32_t maximum=1;for(unsigned i=0;i<4*dyscope::Bins;i++)maximum=std::max(maximum,bins[i]);NSArray *colors=@[[NSColor colorWithWhite:.8 alpha:.8],NSColor.systemRedColor,NSColor.systemGreenColor,NSColor.systemBlueColor];for(unsigned c=0;c<4;c++){[colors[c]setStroke];NSBezierPath *line=[NSBezierPath bezierPath];for(unsigned x=0;x *DYCreateWorkspaceMaskEditor(id if([row.identifier isEqual:@"hslTabs"]){CGFloat width=row.bounds.size.width/9;NSInteger i=0;for(NSView *button in row.subviews)[button setFrame:NSMakeRect(i++*width,1,width-1,27)];} } if(_workspaceEditor){ - CGFloat height=MAX(160,_scroll.contentSize.height-12),x=8,ry=0,columnWidth=250;BOOL occupied=NO; - for(NSView *row in body){if(row.hidden)continue;NSString *identifier=row.identifier?:@""; - BOOL graphic=[identifier hasSuffix:@"Graph"]||[identifier isEqual:@"gradingWheels"]||[identifier isEqual:@"primaryBalance"]; - if(graphic){if(occupied){x+=columnWidth+12;ry=0;occupied=NO;}CGFloat gw=[identifier isEqual:@"spiderGraph"]?MIN(height,270)+190:[identifier isEqual:@"curveGraph"]?MAX(520,_scroll.contentSize.width-16):[identifier isEqual:@"gradingWheels"]?MAX(640,MIN(height,260)*4):MIN(height,260); - row.frame=NSMakeRect(x,0,gw,height);if([row isKindOfClass:DYWheelPanel.class])[(DYWheelPanel*)row setHorizontalLayout:YES];if([identifier isEqual:@"primaryBalance"])for(NSView *view in row.subviews)view.frame=row.bounds;x+=gw+14;continue;} - CGFloat rh=[identifier hasPrefix:@"heading:"]?26:34;if(ry+rh>height){x+=columnWidth+12;ry=0;} - CGFloat rw=[identifier isEqual:@"hslTabs"]?MAX(250,MIN(430,_scroll.contentSize.width-16)):columnWidth; - row.frame=NSMakeRect(x,ry,rw,rh-1);ry+=rh;occupied=YES; - if([identifier hasPrefix:@"heading:"])for(NSView *view in row.subviews)view.frame=NSMakeRect(2,5,rw-4,18); - if([identifier hasSuffix:@"Controls"]){CGFloat bw=(rw-4*(row.subviews.count-1))/MAX((NSUInteger)1,row.subviews.count);NSInteger index=0;for(NSView *view in row.subviews)view.frame=NSMakeRect((bw+4)*index++,3,bw,25);} - if([identifier isEqual:@"hslTabs"]){NSInteger index=0;for(NSView *view in row.subviews)view.frame=NSMakeRect(index++*rw/9,1,rw/9-1,27);if(rw>columnWidth){x+=rw+12;ry=0;occupied=NO;}} + // Keep module controls together, then distribute ordinary parameter + // columns across the actual viewport instead of a fixed 250pt strip. + CGFloat height=MAX(160,_scroll.contentSize.height-12),available=MAX(280,_scroll.contentSize.width-24),x=12; + NSMutableArray *rows=[NSMutableArray array],*graphics=[NSMutableArray array];NSView *tabs=nil; + for(NSView *row in body)if(!row.hidden){NSString *identifier=row.identifier?:@"";if([identifier isEqual:@"hslTabs"])tabs=row; + else if([identifier hasSuffix:@"Graph"]||[identifier isEqual:@"gradingWheels"]||[identifier isEqual:@"primaryBalance"])[graphics addObject:row];else [rows addObject:row];} + if([key isEqual:@"spider"]){ + CGFloat groupWidth=MAX(490,available);_spiderPanel.frame=NSMakeRect(x,0,groupWidth,height); + for(NSView *row in rows)if([row.identifier isEqual:@"spiderMix"]){[_spiderPanel addSubview:row];_spiderPanel.accessoryRow=row;} + [_spiderPanel layoutSubtreeIfNeeded];x+=groupWidth; + }else{ + CGFloat top=0; + if(tabs){tabs.frame=NSMakeRect(x,4,available,30);NSInteger index=0;CGFloat sw=available/9;for(NSView *button in tabs.subviews)button.frame=NSMakeRect(index++*sw,1,sw-5,27);top=46;} + for(NSView *graphic in graphics){NSString *identifier=graphic.identifier;CGFloat gw=[identifier isEqual:@"curveGraph"]?MAX(520,available):[identifier isEqual:@"gradingWheels"]?MAX(640,available-(rows.count?300:0)):MIN(height,260); + graphic.frame=NSMakeRect(x,top,gw,height-top);if([graphic isKindOfClass:DYWheelPanel.class])[(DYWheelPanel*)graphic setHorizontalLayout:YES];if([identifier isEqual:@"primaryBalance"])for(NSView *view in graphic.subviews)view.frame=graphic.bounds;x+=gw+16;} + CGFloat parameterWidth=MAX(280,available-(x-12)),rowHeight=34,usable=MAX(100,height-top); + NSInteger perColumn=MAX(1,NSInteger(floor(usable/rowHeight))),columns=MAX(1,NSInteger(ceil(double(rows.count)/perColumn))); + CGFloat columnWidth=MAX(280,(parameterWidth-(columns-1)*16)/columns); + // The chosen HSL colour and its three axes form one continuous + // full-width editor below the colour strip, including custom HSL. + if(tabs){columnWidth=MAX(280,(available-(columns-1)*16)/columns);} + NSInteger index=0;for(NSView *row in rows){NSInteger col=index/perColumn,line=index%perColumn;CGFloat rw=columnWidth; + row.frame=NSMakeRect(x+col*(columnWidth+16),top+line*rowHeight,rw,rowHeight-1);index++; + if([row.identifier hasPrefix:@"heading:"])for(NSView *view in row.subviews)view.frame=NSMakeRect(2,5,rw-4,18); + if([row.identifier hasSuffix:@"Controls"]){CGFloat bw=(rw-4*(row.subviews.count-1))/MAX((NSUInteger)1,row.subviews.count);NSInteger i=0;for(NSView *view in row.subviews)view.frame=NSMakeRect((bw+4)*i++,3,bw,25);} + } + if(rows.count)x+=columns*columnWidth+(columns-1)*16;else if(tabs)x+=available; } - card.frame=NSMakeRect(0,6,MAX(_scroll.contentSize.width,x+(occupied?columnWidth:0)+8),height);y=_scroll.contentSize.height; + card.frame=NSMakeRect(0,6,MAX(_scroll.contentSize.width,x+12),height);y=_scroll.contentSize.height; } y=[self layoutRepeatedToolsAfter:[@"base:" stringByAppendingString:key] y:y width:w]; } diff --git a/大鱼调色/Plugin/DYLUTBrowser.mm b/大鱼调色/Plugin/DYLUTBrowser.mm index fc950f0..f85276f 100644 --- a/大鱼调色/Plugin/DYLUTBrowser.mm +++ b/大鱼调色/Plugin/DYLUTBrowser.mm @@ -167,7 +167,7 @@ static void DYBrowserGeometrySample(NSView *root,NSString *phase){ NSProgress *_libraryTask,*_selectionTask; NSTimer *_progressTimer; NSUInteger _libraryGeneration,_selectionGeneration; - NSInteger _columns,_horizontalRows; + NSInteger _columns; CGFloat _tileWidth,_tileHeight,_sidebarWidth; } @end @@ -272,7 +272,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b NSAccessibilityPostNotification(parent,NSAccessibilityLayoutChangedNotification); } - (void)embedInView:(NSView *)parent close:(void (^)(void))closeAction{ - _embedded=YES;_folderScroll.hasVerticalScroller=NO;_gridScroll.hasVerticalScroller=NO;_gridScroll.hasHorizontalScroller=YES;_gridScroll.scrollerStyle=NSScrollerStyleOverlay;[self showInRemoteParent:parent close:closeAction];_done.title=@"返回调整"; + _embedded=YES;_folderScroll.hasVerticalScroller=YES;_gridScroll.hasVerticalScroller=YES;_gridScroll.hasHorizontalScroller=NO;_gridScroll.scrollerStyle=NSScrollerStyleOverlay;[self showInRemoteParent:parent close:closeAction];_done.title=@"返回调整"; } - (void)fitRemoteParent{ NSView *parent=_root.superview;if(_closed||!_remoteMode||!parent)return; @@ -381,9 +381,9 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b [self updateVisibleFolders]; CGFloat available=MAX(80,_gridScroll.contentSize.width),tileWidth=_sizeSlider.doubleValue,gap=10; BOOL list=_layoutMenu.indexOfSelectedItem==1;NSInteger columns=list?1:MAX(1,(NSInteger)floor((available+gap)/(tileWidth+gap)));tileWidth=list?MAX(110,available-14):MIN(tileWidth,(available-gap*(columns-1)-14)/columns);tileWidth=MAX(70,tileWidth); - if(_embedded&&!list)tileWidth=MIN(tileWidth,MAX(70,(_gridScroll.contentSize.height-36)*16/9));_columns=columns;_tileWidth=tileWidth;_tileHeight=list?70:ceil(tileWidth*9/16)+24; + _columns=columns;_tileWidth=tileWidth;_tileHeight=list?70:ceil(tileWidth*9/16)+24; NSInteger rows=(_visibleEntries.count+columns-1)/columns;CGFloat contentHeight=MAX(_gridScroll.contentSize.height,rows*(_tileHeight+gap)+12); - if(_embedded){_horizontalRows=MAX(1,NSInteger((_gridScroll.contentSize.height-12)/(_tileHeight+gap)));NSInteger horizontalColumns=(_visibleEntries.count+_horizontalRows-1)/_horizontalRows;_gridDocument.frame=NSMakeRect(0,0,MAX(available,horizontalColumns*(_tileWidth+gap)+14),_gridScroll.contentSize.height);}else{_horizontalRows=0;_gridDocument.frame=NSMakeRect(0,0,available,contentHeight);}_emptyLabel.frame=NSMakeRect(20,MAX(36,_gridScroll.contentSize.height/2-45),MAX(50,available-40),90); + _gridDocument.frame=NSMakeRect(0,0,available,contentHeight);_emptyLabel.frame=NSMakeRect(20,MAX(36,_gridScroll.contentSize.height/2-45),MAX(50,available-40),90); _layingOut=NO;[self updateVisibleTiles]; } - (CGFloat)splitView:(NSSplitView *)split constrainMinCoordinate:(CGFloat)proposed ofSubviewAt:(NSInteger)index{return 128;} @@ -400,12 +400,11 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b NSRect visible=NSInsetRect(_gridScroll.contentView.bounds,-30,-180);CGFloat step=_tileHeight+10; NSUInteger first=(NSUInteger)MAX(0,floor((NSMinY(visible)-8)/step))*_columns; NSUInteger end=MIN(_visibleEntries.count,(NSUInteger)MAX(0,ceil((NSMaxY(visible)-8)/step)+1)*_columns); - if(_horizontalRows){CGFloat horizontalStep=_tileWidth+10;first=(NSUInteger)MAX(0,floor((NSMinX(visible)-7)/horizontalStep))*_horizontalRows;end=MIN(_visibleEntries.count,(NSUInteger)MAX(0,ceil((NSMaxX(visible)-7)/horizontalStep)+1)*_horizontalRows);} NSMutableSet *wanted=[NSMutableSet set];BOOL changed=NO; for(NSUInteger i=first;i delegate; - (void)setMesh:(NSData *)mesh linked:(BOOL)linked; @end @@ -32,7 +33,7 @@ - (void)dealloc{_disc.changed=nil;_disc.gesture=nil;_disc.selectionChanged=nil;[_disc release];[_hues release];[_saturation release];[_link release];[_status release];[super dealloc];} - (void)setMesh:(NSData *)data linked:(BOOL)linked{auto m=DYSpiderMesh(data);_disc.meshData=[NSData dataWithBytes:&m length:sizeof(m)];_linked=linked;[_hues selectItemWithTag:m.hues];[_saturation selectItemWithTag:m.rings+1];_link.state=linked?NSControlStateValueOn:NSControlStateValueOff;} - (void)layout{[super layout];CGFloat w=self.bounds.size.width; - if(_horizontalLayout){CGFloat d=MIN(self.bounds.size.height,w-186),x=d+12,cw=w-x-6;_disc.frame=NSMakeRect(0,0,d,d);[[self viewWithTag:101]setFrame:NSMakeRect(x,7,48,18)];_hues.frame=NSMakeRect(x+58,2,cw-58,26);[[self viewWithTag:102]setFrame:NSMakeRect(x,37,48,18)];_saturation.frame=NSMakeRect(x+58,32,cw-58,26);_link.frame=NSMakeRect(x,64,cw,22);CGFloat bw=(cw-6)/2;for(int i=0;i<5;i++)[[self viewWithTag:201+i]setFrame:NSMakeRect(x+(i%2)*(bw+6),94+(i/2)*30,bw,26)];_status.frame=NSMakeRect(x,188,cw,MAX(24,self.bounds.size.height-190));return;} + if(_horizontalLayout){CGFloat d=MIN(self.bounds.size.height,MAX(170,w*.48)),x=d+20,cw=MAX(200,w-x-10);_disc.frame=NSMakeRect(0,0,d,d);[[self viewWithTag:101]setFrame:NSMakeRect(x,7,48,18)];_hues.frame=NSMakeRect(x+58,2,cw-58,26);[[self viewWithTag:102]setFrame:NSMakeRect(x,37,48,18)];_saturation.frame=NSMakeRect(x+58,32,cw-58,26);_link.frame=NSMakeRect(x,64,cw,22);_accessoryRow.frame=NSMakeRect(x,89,cw,33);CGFloat bw=(cw-6)/2;for(int i=0;i<5;i++)[[self viewWithTag:201+i]setFrame:NSMakeRect(x+(i%2)*(bw+6),126+(i/2)*30,bw,26)];_status.frame=NSMakeRect(x,218,cw,MAX(18,self.bounds.size.height-218));_status.hidden=self.bounds.size.height<238;return;} _disc.frame=NSMakeRect(0,0,w,300); [[self viewWithTag:101]setFrame:NSMakeRect(0,307,32,20)];_hues.frame=NSMakeRect(33,301,60,27); [[self viewWithTag:102]setFrame:NSMakeRect(99,307,43,20)];_saturation.frame=NSMakeRect(142,301,60,27);_link.frame=NSMakeRect(MAX(205,w-61),304,61,23); diff --git a/大鱼调色/Plugin/DYRenderer.mm b/大鱼调色/Plugin/DYRenderer.mm index e71e575..ccb748e 100644 --- a/大鱼调色/Plugin/DYRenderer.mm +++ b/大鱼调色/Plugin/DYRenderer.mm @@ -1,3 +1,4 @@ +#import #import "DYHistogram.h" #import "DYManagedColor.h" #import "../../ColorManagement/Sources/DYColorManagementGPU.h" diff --git a/大鱼调色/Plugin/DYScopeCapture.inc.h b/大鱼调色/Plugin/DYScopeCapture.inc.h index c5dea5a..d46b349 100644 --- a/大鱼调色/Plugin/DYScopeCapture.inc.h +++ b/大鱼调色/Plugin/DYScopeCapture.inc.h @@ -5,6 +5,7 @@ BOOL start=NO;@synchronized(_previewLock){if(_scopeEnabled==enabled)return;_scopeEnabled=enabled;_scopeGeneration++;[_scopePending release];_scopePending=nil; if(enabled){_scopeRequestedTime=time;[_scopePreview release];_scopePreview=nil;[_scopeMetadata release];_scopeMetadata=nil; CMTime cached=_scopeLatest?CMTimeMakeWithEpoch([_scopeLatest.metadata[@"timeValue"]longLongValue],[_scopeLatest.metadata[@"timeScale"]intValue],[_scopeLatest.metadata[@"timeEpoch"]longLongValue]):kCMTimeInvalid; + os_log(OS_LOG_DEFAULT,"dayu_scope_open requested=%{public}.9f cached=%{public}.9f",CMTimeGetSeconds(time),CMTimeGetSeconds(cached)); // Replay only this instance's actual final output at the requested host time. // A panel opening must not require a parameter mutation or a fresh render. if(_scopeLatest&&(!CMTIME_IS_NUMERIC(time)||(CMTIME_IS_NUMERIC(cached)&&CMTimeCompare(cached,time)==0))){DYScopeSample *sample=[DYScopeSample new];sample.pixels=_scopeLatest.pixels;sample.space=_scopeLatest.space;sample.metadata=_scopeLatest.metadata;sample.generation=_scopeGeneration;_scopePending=sample;if(!_scopeWorkerRunning){_scopeWorkerRunning=YES;start=YES;}} diff --git a/大鱼调色/Plugin/DYScopeMath.hpp b/大鱼调色/Plugin/DYScopeMath.hpp index 418d253..6b3ccf0 100644 --- a/大鱼调色/Plugin/DYScopeMath.hpp +++ b/大鱼调色/Plugin/DYScopeMath.hpp @@ -11,6 +11,9 @@ namespace dyscope { inline constexpr unsigned Width=320,Height=180,Bins=256; inline constexpr float Low=-.1f,High=1.1f; +// Conventional positive-I flesh-tone reference: 33 degrees left of +Cr. +inline constexpr double SkinToneAngle=123.0*3.14159265358979323846/180.0; +inline constexpr double SkinToneCb=-0.5446390350150271,SkinToneCr=0.8386705679454240; struct RGBA { float r,g,b,a; }; struct Result { std::vector wave=std::vector(Width*Bins),parade=std::vector(3*Width*Bins),vectors=std::vector(Bins*Bins); diff --git a/大鱼调色/Plugin/DYToolCanvasEditing.inc.h b/大鱼调色/Plugin/DYToolCanvasEditing.inc.h index 3cfbf09..b26110f 100644 --- a/大鱼调色/Plugin/DYToolCanvasEditing.inc.h +++ b/大鱼调色/Plugin/DYToolCanvasEditing.inc.h @@ -18,13 +18,15 @@ @synchronized(self){if(self->_trackingActive.load()||revision!=self->_toolCanvasRevision||![node isEqual:self->_selectedToolNode]||![maskID isEqual:self->_selectedToolMask])return;} ida=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;BOOL changed=NO; [a startAction:self];@try{ + os_log(OS_LOG_DEFAULT,"dayu_pen_commit event=%{public}.9f action=%{public}.9f nodes=%{public}lu",CMTimeGetSeconds(time),CMTimeGetSeconds(a.currentTime),(unsigned long)([draft[@"nodes"]length]/sizeof(DYBezierNode))); if(!CMTIME_IS_NUMERIC(a.currentTime)||CMTimeCompare(a.currentTime,time)!=0){[self postToolCanvasStatus:@"播放头已移动,本次蒙版草稿未写入其它帧。"];return;} NSMutableDictionary *doc=DYMutablePlist(DYReadTools(self->_apiManager,time).document),*current=[self toolMask:maskID node:node document:doc]; - if(!current||![current isEqual:original]){[self postToolCanvasStatus:@"蒙版已在其它位置修改,本次画面草稿未覆盖它。"];return;} + if(!current||![current isEqual:original]){os_log(OS_LOG_DEFAULT,"dayu_pen_commit conflict current=%{public}d",current!=nil);[self postToolCanvasStatus:@"蒙版已在其它位置修改,本次画面草稿未覆盖它。"];return;} NSMutableDictionary *result=DYMutablePlist(draft); if([current[@"keys"]count]){DYMaskParameters p=DYMaskAtTime(result,time);NSMutableArray *keys=[[current[@"keys"]mutableCopy]autorelease];NSIndexSet *same=[keys indexesOfObjectsPassingTest:^BOOL(NSDictionary *key,NSUInteger i,BOOL *stop){return CMTimeCompare(CMTimeMakeWithEpoch([key[@"value"]longLongValue],[key[@"scale"]intValue],[key[@"epoch"]longLongValue]),time)==0;}];[keys removeObjectsAtIndexes:same];[keys addObject:DYMaskKey(time,p,YES,1)];result[@"keys"]=@[];if(!DYMergeTracking(result,keys))return;} if(DYValidToolMask(result)&&![current isEqual:result]){[current setDictionary:result];idundo=[self->_apiManager apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"编辑工具蒙版"];changed=DYWriteTools(self->_apiManager,doc,time);[undo endUndoGroup];if(changed){DYToolDocument *saved=[[[DYToolDocument alloc]init]autorelease];saved.document=doc;[self adoptToolCanvasDocument:saved.document];}} }@finally{[a endAction:self];} + os_log(OS_LOG_DEFAULT,"dayu_pen_commit result=%{public}d valid=%{public}d",changed,DYValidToolMask(draft)); if(changed)[self postToolCanvasStatus:@"蒙版已保存 · 可一次撤销"]; [NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self->_apiManager]; }@finally{@synchronized(self){if(revision==self->_toolCanvasRevision){[self->_toolCanvasDraft release];self->_toolCanvasDraft=nil;[self->_toolCanvasOriginal release];self->_toolCanvasOriginal=nil;self->_toolCanvasEditTime=kCMTimeInvalid;}self->_toolCanvasCommitPending=NO;}[self postToolCanvasStatus:nil];}});[draft release];[original release];[node release];[maskID release]; diff --git a/大鱼调色/Plugin/DYViewerParameterBridge.inc.h b/大鱼调色/Plugin/DYViewerParameterBridge.inc.h index f83d085..414be3e 100644 --- a/大鱼调色/Plugin/DYViewerParameterBridge.inc.h +++ b/大鱼调色/Plugin/DYViewerParameterBridge.inc.h @@ -208,6 +208,7 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) { type=[type copy]; } }@finally{[action endAction:self];} + os_log(OS_LOG_DEFAULT,"dayu_viewer_begin accepted=%{public}d event=%{public}.9f action=%{public}.9f count=%{public}lu",target!=nil,CMTimeGetSeconds(time),CMTimeGetSeconds(action.currentTime),(unsigned long)selected.count); if(target){ self->_writerHost=host;self->_writerTarget=target;self->_writerDescriptors=[selected retain];self->_writerLastValues=[initial retain];self->_writerNode=[node copy];self->_writerType=type; self->_writerTime=time;self->_writerGesture=gesture; @@ -309,8 +310,8 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) { } } }@finally{[action endAction:self];} - if(conflict||failed)[self closeWriter]; - if(changed)[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_apiManager]; + if(conflict||failed){os_log(OS_LOG_DEFAULT,"dayu_viewer_write rejected conflict=%{public}d failed=%{public}d event=%{public}.9f action=%{public}.9f",conflict,failed,CMTimeGetSeconds(_writerTime),CMTimeGetSeconds(action.currentTime));[self closeWriter];} + if(changed){os_log(OS_LOG_DEFAULT,"dayu_viewer_write saved count=%{public}lu time=%{public}.9f",(unsigned long)desired.count,CMTimeGetSeconds(_writerTime));[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_apiManager];} } - (void)changeValue:(double)value { if(!std::isfinite(value))return;uint64_t gesture; diff --git a/大鱼调色/Plugin/DYWorkspaceDiagnostics.inc.h b/大鱼调色/Plugin/DYWorkspaceDiagnostics.inc.h index f5196c7..5fc0065 100644 --- a/大鱼调色/Plugin/DYWorkspaceDiagnostics.inc.h +++ b/大鱼调色/Plugin/DYWorkspaceDiagnostics.inc.h @@ -85,7 +85,7 @@ auto toolbarButton=[&](NSString *type)->NSButton *{for(NSButton *button in toolbar.subviews)if([button.identifier isEqual:type])return button;return nil;}; auto chooseNode=[&](NSString *node)->BOOL{NSArray *rows=[stack valueForKey:@"layerRows"];for(NSUInteger i=0;iprevious&&button.frame.origin.y==0;previous=button.frame.origin.x;} - run.record(@"workspace-toolbar-lists-every-tool-in-one-horizontal-scroll-strip",toolbar.subviews.count==DYToolTypes().count&&horizontal); + run.record(@"workspace-toolbar-lists-grading-tools-and-leaves-distortion-on-canvas",toolbar.subviews.count==DYToolTypes().count-1&&horizontal&&!toolbarButton(@"lens")); NSUInteger originalLayers=[DYReadTools(stackHost,kCMTimeZero).document[@"layers"]count];int undo=stackHost->_undoStarts; [stack addWorkspaceTool:toolbarButton(@"curve")];workspaceDrain();NSString *curveID=[[[stack valueForKey:@"selectedNode"]copy]autorelease];NSDictionary *tools=DYReadTools(stackHost,kCMTimeZero).document; run.record(@"workspace-toolbar-adds-real-uuid-and-synchronizes-regular-inspector",[tools[@"layers"]count]==originalLayers+1&&[DYToolWithID(tools,curveID)[@"type"]isEqual:@"curve"]&&[[mainInspector valueForKey:@"stackViews"]objectForKey:curveID]&&stackHost->_undoStarts==undo+1&&stackHost->_undoEnds==stackHost->_undoStarts); @@ -132,8 +132,9 @@ run.record(@"workspace-new-stack-actions-stay-on-main-in-host-permissions-and-balanced-undo",stackHost->_writesInAction&&!stackHost->_permissionFailure&&stackHost->_actionDepth==0&&stackHost->_undoStarts==stackHost->_undoEnds&&!fixture.visible); for(NSString *type in DYToolTypes()){ DYInspector *editor=[[[DYInspector alloc]initWithAPIManager:stackHost renderer:stackRenderer workspaceType:type]autorelease];editor.frame=NSMakeRect(0,0,424,235);[editor refresh];[editor layoutSubtreeIfNeeded];NSScrollView *strip=[editor valueForKey:@"scroll"];NSView *document=[editor valueForKey:@"document"];BOOL fits=!strip.hasVerticalScroller&&strip.hasHorizontalScroller&&fabs(document.bounds.size.height-strip.contentSize.height)<1;NSMutableArray *bad=[NSMutableArray array]; - for(NSDictionary *record in [editor valueForKey:@"cards"]){NSView *card=record[@"view"];for(NSView *row in record[@"body"])if(!row.hidden&&!card.hidden){BOOL inside=NSContainsRect(card.bounds,row.frame);fits&=inside;if(!inside)[bad addObject:@{@"id":row.identifier?:@"",@"frame":NSStringFromRect(row.frame),@"card":NSStringFromRect(card.bounds)}];}} + for(NSDictionary *record in [editor valueForKey:@"cards"]){NSView *card=record[@"view"];for(NSView *row in record[@"body"])if(!row.hidden&&!card.hidden){BOOL inside=NSContainsRect(card.bounds,[row.superview convertRect:row.frame toView:card]);fits&=inside;if(!inside)[bad addObject:@{@"id":row.identifier?:@"",@"frame":NSStringFromRect(row.frame),@"card":NSStringFromRect(card.bounds)}];}} run.record([@"workspace-horizontal-minimum-height-" stringByAppendingString:type],fits,@{@"document":NSStringFromRect(document.bounds),@"viewport":NSStringFromSize(strip.contentSize),@"outside":bad}); + if([type isEqual:@"hsl"]){for(NSNumber *width in @[@424,@760,@1040]){editor.frame=NSMakeRect(0,0,width.doubleValue,260);[editor layoutSubtreeIfNeeded];NSDictionary *cardRecord=[[editor valueForKey:@"cards"]firstObject];NSView *tabs=nil;BOOL together=YES;for(NSView *row in cardRecord[@"body"])if([row.identifier isEqual:@"hslTabs"])tabs=row;for(NSView *row in cardRecord[@"body"])if(!row.hidden&&[row.identifier hasPrefix:@"hsl0_"])together&=NSMinY(row.frame)>NSMaxY(tabs.frame)&&fabs(NSMinX(row.frame)-NSMinX(tabs.frame))<1&&fabs(row.frame.size.width-tabs.frame.size.width)<1;run.record([NSString stringWithFormat:@"workspace-hsl-swatch-and-axes-stay-together-%@",width],together);NSBitmapImageRep *image=[editor bitmapImageRepForCachingDisplayInRect:editor.bounds];[editor cacheDisplayInRect:editor.bounds toBitmapImageRep:image];[[image representationUsingType:NSBitmapImageFileTypePNG properties:@{}]writeToFile:[runtime stringByAppendingPathComponent:[NSString stringWithFormat:@"workspace-hsl-%@.png",width]]atomically:YES];}} if([type isEqual:@"spider"]){NSView *panel=[editor valueForKey:@"spiderPanel"];[panel layoutSubtreeIfNeeded];NSView *disc=[panel valueForKey:@"disc"],*hues=[panel valueForKey:@"hues"];run.record(@"workspace-spider-places-disc-left-and-parameters-right",NSMaxX(disc.frame)<=NSMinX(hues.frame)&&NSContainsRect(panel.bounds,hues.frame));} } [stack close];stackHost->_asyncRemote=YES;[stack showRelativeToView:nil];[stack close];[stack showRelativeToView:nil];workspaceDrain();run.record(@"workspace-background-remote-reply-attaches-only-current-session",stack.visible&&[(NSView*)[stack valueForKey:@"root"]superview]==stackHost->_parent&&!stackHost->_permissionFailure);[stack close];stackHost->_asyncRemote=NO; diff --git a/大鱼调色/Plugin/DYWorkspaceTools.inc.h b/大鱼调色/Plugin/DYWorkspaceTools.inc.h index 10330a6..c81d4ae 100644 --- a/大鱼调色/Plugin/DYWorkspaceTools.inc.h +++ b/大鱼调色/Plugin/DYWorkspaceTools.inc.h @@ -5,7 +5,7 @@ _splitFraction=[NSUserDefaults.standardUserDefaults doubleForKey:@"com.dayu.color.workspace.layerFraction.v3"];if(_splitFraction<.12||_splitFraction>.4)_splitFraction=.18;_scopeFraction=[NSUserDefaults.standardUserDefaults doubleForKey:@"com.dayu.color.workspace.scopeFraction.v1"];if(_scopeFraction<.15||_scopeFraction>.45)_scopeFraction=.27;_toolTime=kCMTimeInvalid;_sizingSplit=YES; _toolbarScroll=[[NSScrollView alloc]init];_toolbarScroll.hasHorizontalScroller=YES;_toolbarScroll.autohidesScrollers=YES;_toolbarScroll.drawsBackground=NO; _toolbar=[[DYWorkspaceList alloc]initWithFrame:NSMakeRect(0,0,1200,34)];_toolbarScroll.documentView=_toolbar;[_root addSubview:_toolbarScroll]; - CGFloat x=0;for(NSString *type in DYToolTypes()) {NSString *title=DYToolSection(type)[@"title"]?:type;NSButton *button=DYWorkspaceButton(title,self,@selector(addWorkspaceTool:));button.identifier=type;button.toolTip=[@"添加独立模块:" stringByAppendingString:title];button.image=[NSImage imageWithSystemSymbolName:DYWorkspaceSymbol(type) accessibilityDescription:title];button.imagePosition=NSImageOnly;button.contentTintColor=DYThemeColor(@"text");CGFloat width=28;button.frame=NSMakeRect(x,0,width,27);[_toolbar addSubview:button];x+=width+2;}_toolbar.frame=NSMakeRect(0,0,x,30); + CGFloat x=0;for(NSString *type in DYToolTypes()) {if([type isEqual:@"lens"])continue;NSString *title=DYToolSection(type)[@"title"]?:type;NSButton *button=DYWorkspaceButton(title,self,@selector(addWorkspaceTool:));button.identifier=type;button.toolTip=[@"添加独立模块:" stringByAppendingString:title];button.image=[NSImage imageWithSystemSymbolName:DYWorkspaceSymbol(type) accessibilityDescription:title];button.imagePosition=NSImageOnly;button.contentTintColor=DYThemeColor(@"text");CGFloat width=28;button.frame=NSMakeRect(x,0,width,27);[_toolbar addSubview:button];x+=width+2;}_toolbar.frame=NSMakeRect(0,0,x,30); _split=[[NSSplitView alloc]init];_split.vertical=YES;_split.dividerStyle=NSSplitViewDividerStyleThin;_split.delegate=self;_split.accessibilityLabel=@"调整图层与参数宽度";[_root addSubview:_split]; _toolPane=[[DYWorkspaceList alloc]init];_editorHost=[[DYWorkspaceList alloc]init];_editorHost.clipsToBounds=YES;[_split addSubview:_toolPane];[_split addSubview:_editorHost]; _layerScroll=[[NSScrollView alloc]init];_layerScroll.hasVerticalScroller=NO;_layerScroll.autohidesScrollers=YES;_layerScroll.scrollerStyle=NSScrollerStyleOverlay;_layerScroll.automaticallyAdjustsContentInsets=NO;_layerScroll.contentInsets=NSEdgeInsetsZero;_layerScroll.drawsBackground=NO;[_toolPane addSubview:_layerScroll]; @@ -37,7 +37,7 @@ - (void)splitView:(NSSplitView*)split resizeSubviewsWithOldSize:(NSSize)old{[self layoutToolWorkspace];} - (void)splitViewDidResizeSubviews:(NSNotification*)notification {if(_sizingSplit)return;if(NSApp.currentEvent.type!=NSEventTypeLeftMouseDragged&&NSApp.currentEvent.type!=NSEventTypeLeftMouseUp)return;_splitFraction=MAX(.12,MIN(.4,_toolPane.frame.size.width/MAX(1,_split.bounds.size.width)));_scopeFraction=MAX(.15,MIN(.45,_scopePane.frame.size.width/MAX(1,_split.bounds.size.width)));[NSUserDefaults.standardUserDefaults setDouble:_splitFraction forKey:@"com.dayu.color.workspace.layerFraction.v3"];[NSUserDefaults.standardUserDefaults setDouble:_scopeFraction forKey:@"com.dayu.color.workspace.scopeFraction.v1"];[self layoutWorkspace];} - (BOOL)workspaceBaseVisible:(NSString*)type document:(NSDictionary*)document time:(CMTime)time { - if(DYBaseToolRemoved(document,type))return NO; + if([type isEqual:@"lens"]||DYBaseToolRemoved(document,type))return NO; if([@[@"primary",@"spider",@"base",@"hsl"]containsObject:type])return YES; idhost=[self rootHost];idget=[host apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];DYInspectorToken *token=nil;[get getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:time];if([token.folds[[@"visible:" stringByAppendingString:type]]boolValue]||DYMasksForTool(document,[@"base:" stringByAppendingString:type]).count)return YES; for(NSDictionary*d in DYBaseToolDescriptors(type)){double value=[d[@"default"]doubleValue];[get getFloatValue:&value fromParameter:[d[@"pid"]unsignedIntValue]atTime:time];if(std::isfinite(value)&&fabs(value-[d[@"default"]doubleValue])>1e-6)return YES;} @@ -57,11 +57,11 @@ NSArray *display=DYToolDisplayOrder(document);NSMutableArray *ordered=[NSMutableArray array];NSMutableDictionary *numbers=[NSMutableDictionary dictionary],*titles=[NSMutableDictionary dictionary];for(NSString*ID in display){NSDictionary*node=DYToolWithID(document,ID);if(!node)continue;NSString*type=node[@"type"];NSInteger number=(numbers[type]?[numbers[type]integerValue]:(DYBaseToolRemoved(document,type)?0:1))+1;numbers[type]=@(number);titles[ID]=[NSString stringWithFormat:@"%@ %ld",DYToolSection(type)[@"title"],(long)number];} for(NSString*type in bases){NSString*base=[@"base:" stringByAppendingString:type];[ordered addObject:base];for(NSString*ID in display)if(DYToolWithID(document,ID)&&[DYToolRootAnchor(document,ID)isEqual:base])[ordered addObject:ID];} for(NSString*ID in display)if(DYToolWithID(document,ID)&&[DYToolRootAnchor(document,ID)isEqual:@"tail"])[ordered addObject:ID]; - for(NSString*ID in [ordered reverseObjectEnumerator]){NSDictionary*node=DYToolWithID(document,ID);NSString*type=node?node[@"type"]:[ID substringFromIndex:5];if(!node&&![self workspaceBaseVisible:type document:document time:_toolTime])continue; + for(NSString*ID in [ordered reverseObjectEnumerator]){NSDictionary*node=DYToolWithID(document,ID);NSString*type=node?node[@"type"]:[ID substringFromIndex:5];if([type isEqual:@"lens"])continue;if(!node&&![self workspaceBaseVisible:type document:document time:_toolTime])continue; NSString*title=titles[ID]?:DYToolSection(type)[@"title"]?:type;[rows addObject:@{@"node":ID,@"type":type,@"title":title,@"enabled":@(DYWorkspaceEnabled(node?DYToolUniforms(node):rootUniforms,type)),@"kind":@"tool",@"maskCount":@(DYMasksForTool(document,ID).count)}]; for(NSDictionary*mask in DYMasksForTool(document,ID)){[assignedMasks addObject:mask[@"id"]];DYMaskParameters p=DYMaskAtTime(mask,_toolTime);NSString*name=@[@"椭圆",@"矩形",@"钢笔",@"渐变",@"HSL",@"亮度"][p.kind];[rows addObject:@{@"node":ID,@"mask":mask[@"id"],@"enabled":mask[@"enabled"],@"title":[@" ◩ " stringByAppendingString:name],@"kind":@"mask"}];} } - for(NSDictionary*mask in DYSharedMasks(document))if(![assignedMasks containsObject:mask[@"id"]]){DYMaskParameters p=DYMaskAtTime(mask,_toolTime);[rows addObject:@{@"node":@"shared",@"mask":mask[@"id"],@"enabled":mask[@"enabled"],@"title":[@"◩ 未分配 · " stringByAppendingString:@[@"椭圆",@"矩形",@"钢笔",@"渐变",@"HSL",@"亮度"][p.kind]],@"kind":@"mask"}];} + for(NSDictionary*mask in DYSharedMasks(document))if(!DYToolIDsForSharedMask(document,mask[@"id"]).count){DYMaskParameters p=DYMaskAtTime(mask,_toolTime);[rows addObject:@{@"node":@"shared",@"mask":mask[@"id"],@"enabled":mask[@"enabled"],@"title":[@"◩ 未分配 · " stringByAppendingString:@[@"椭圆",@"矩形",@"钢笔",@"渐变",@"HSL",@"亮度"][p.kind]],@"kind":@"mask"}];} }@finally{[action endAction:self];} [_toolDocument release];_toolDocument=document;[_layerRows release];_layerRows=[rows copy];[_layerTable reloadData]; NSString *requested=note.userInfo[@"scrollToTool"];if(requested.length){_hasUserSelection=YES;[_selectedNode release];_selectedNode=[requested copy];[_selectedMask release];_selectedMask=nil;} @@ -101,7 +101,10 @@ - (void)showPage:(NSString*)page maskKind:(NSNumber*)kind { NSArray*pages=@[@"tools",@"masks",@"lut",@"scopes"];NSUInteger index=[pages indexOfObject:page];if(index==NSNotFound)index=0; if(kind){[self createWorkspaceMask:kind.integerValue];return;} - if(index==2){NSDictionary*node=DYToolWithID(_toolDocument,_selectedNode);if(![node[@"type"]isEqual:@"look"]&&![_selectedNode isEqual:@"base:look"]){NSString *target=@"base:look";for(NSDictionary*row in _layerRows)if([row[@"type"]isEqual:@"look"]){target=row[@"node"];break;}[_selectedNode release];_selectedNode=[target copy];[_selectedMask release];_selectedMask=nil;}[self bindLUTTarget];} + if(index==2){NSDictionary*node=DYToolWithID(_toolDocument,_selectedNode);if(![node[@"type"]isEqual:@"look"]&&![_selectedNode isEqual:@"base:look"]){NSString *target=nil;for(NSDictionary*row in _layerRows)if([row[@"type"]isEqual:@"look"]){target=row[@"node"];break;} + if(!target){NSButton *add=[NSButton buttonWithTitle:@"" target:nil action:nil];add.identifier=@"look";[self addWorkspaceTool:add];return;} + [_selectedNode release];_selectedNode=[target copy];[_selectedMask release];_selectedMask=nil;} + _editorMode=2;[self refreshToolWorkspace:nil];[self bindLUTTarget];} if(index<3)_editorMode=index;[self pageChanged:nil]; } - (void)bindLUTTarget { @@ -110,7 +113,7 @@ if([old isEqual:next]&&_lutTarget)return;_selectionID++;[_selectionTask cancel];[_selectionTask release];_selectionTask=nil;BOOL wasClosing=_closing;_closing=YES;[_browser close];[_browser release];_browser=nil;_closing=wasClosing;[(id)_lutTarget release];_lutTarget=[(id)target retain]; } - (void)addWorkspaceTool:(NSButton*)sender { - NSString*type=sender.identifier;if(![DYToolTypes()containsObject:type])return;idhost=[self rootHost];ida=[host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;NSString*added=nil; + NSString*type=sender.identifier;if([type isEqual:@"lens"]||![DYToolTypes()containsObject:type])return;idhost=[self rootHost];ida=[host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;NSString*added=nil; [a startAction:self];@try{NSMutableDictionary*doc=DYMutablePlist(DYReadTools(host,a.currentTime).document);NSString*anchor=(DYToolWithID(doc,_selectedNode)||[_selectedNode hasPrefix:@"base:"])?_selectedNode:[@"base:" stringByAppendingString:type];NSMutableDictionary*node=(id)DYInsertTool(doc,type,anchor);if(!node){[self reportError:@"模块达到上限,未添加"];return;}if(DYPrimaryColorState(DYReadAssets(host,a.currentTime).colorManagement)){DYUniforms u;DYReadUniforms(host,a.currentTime,&u);DYSeedPrimaryWorkingSpace(node,u.cm.workingTransfer,u.cm.workingGamut);}idundo=[host apiForProtocol:@protocol(FxUndoAPI)];BOOL grouped=[undo startUndoGroup:@"添加调色模块"];if(DYWriteTools(host,doc,a.currentTime))added=[node[@"id"]copy];if(grouped)[undo endUndoGroup];}@finally{[a endAction:self];} if(added){_editorMode=0;[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:host userInfo:@{@"scrollToTool":added}];[added release];} } diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index 623b490..7e31e8b 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.12.0 CFBundleVersion - 76 + 77 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index d812494..47d817e 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.12.0 CFBundleVersion - 76 + 77 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright