Keep shared skin controls owned by the skin module when deleting basic adjustment (build 51)
这个提交包含在:
1 父节点
85ec27d49f
当前提交
72a0269fe7
5 个文件已更改
+9
-5
没有与搜索条件相匹配的文件
@@ -686,6 +686,7 @@ static NSImage *DYWheelImage(void) {
|
||||
- (BOOL)showRow:(NSView *)row section:(NSString *)section {
|
||||
if([row.identifier isEqual:@"toolMasks"])return [(DYToolMaskPanel*)row contentHeight]>0;
|
||||
NSString *key=row.identifier?:@"";NSInteger tab=[_tabs[section]integerValue];
|
||||
if(!_embedded&&[section isEqual:@"base"]&&[key isEqual:@"skinEnabled"])for(NSDictionary *card in _cards)if([card[@"section"][@"key"]isEqual:@"skin"])return ![card[@"removed"]boolValue];
|
||||
if([key isEqual:@"legacyInput"])return [_tabs[@"legacyInput"]boolValue];
|
||||
if([section isEqual:@"curve"] && ![key isEqual:@"curveGraph"])return NO;
|
||||
if([section isEqual:@"hsl"]) {
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
// actual header actions on isolated hosts, then feed stale state to rendering.
|
||||
{
|
||||
auto pumpDeletion=[](){double end=NSProcessInfo.processInfo.systemUptime+.035;while(NSProcessInfo.processInfo.systemUptime<end)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.002]];};
|
||||
BOOL everyButton=YES,everyReset=YES,everyAsset=YES,everyUndo=YES,everyReopen=YES,everyFresh=YES,everyExtra=YES,everyLayout=YES;
|
||||
BOOL everyButton=YES,everyReset=YES,everyAsset=YES,everyUndo=YES,everyReopen=YES,everyFresh=YES,everyExtra=YES,everyLayout=YES,sharedSkin=YES;
|
||||
for(NSString *type in DYToolTypes()){@autoreleasepool{
|
||||
DYDiagnosticManager *host=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(host,nil);
|
||||
NSArray *owned=DYBaseToolDescriptors(type);NSMutableSet *ownedIDs=[NSMutableSet set];
|
||||
for(NSDictionary *d in owned){[ownedIDs addObject:d[@"pid"]];double value=[d[@"max"]doubleValue]==[d[@"default"]doubleValue]?[d[@"min"]doubleValue]:[d[@"max"]doubleValue];if(d[@"values"])for(NSNumber *v in d[@"values"])if(v.doubleValue!=[d[@"default"]doubleValue]){value=v.doubleValue;break;}host->_values[d[@"pid"]]=@(value);if(![d[@"notAnimatable"]boolValue])host->_keyframes[d[@"pid"]]=@3;}
|
||||
NSDictionary *neighbor=nil;for(NSDictionary *d in DYDescriptors())if(![ownedIDs containsObject:d[@"pid"]]&&([d[@"key"]isEqual:@"hsl0_0"]||[d[@"key"]isEqual:@"curveY0"])){neighbor=d;break;}
|
||||
host->_values[neighbor[@"pid"]]=@19;host->_keyframes[neighbor[@"pid"]]=@2;
|
||||
NSNumber *skinPID=nil;for(NSDictionary *d in DYDescriptors())if([d[@"key"]isEqual:@"skinEnabled"])skinPID=d[@"pid"];if([type isEqual:@"base"]){host->_values[skinPID]=@0;host->_keyframes[skinPID]=@4;}
|
||||
DYAssetState *assets=[[[DYAssetState alloc]init]autorelease];assets.paths=@{@"input":@"/tmp/dayu-deletion-input.cube",@"look0":@"/tmp/dayu-deletion-look.cube",@"look4":@"/tmp/dayu-deletion-look4.cube"};auto mesh=dy::neutralMesh(6,6);assets.spiderMesh=[NSData dataWithBytes:&mesh length:sizeof(mesh)];assets.spiderLinked=NO;DYWriteAssets(host,assets,kCMTimeZero);
|
||||
NSMutableDictionary *doc=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);doc[@"baseMasks"][type]=[NSMutableArray arrayWithObject:DYNewMask(DYMaskEllipse)];NSString *other=[type isEqual:@"hsl"]?@"curve":@"hsl";doc[@"baseMasks"][other]=[NSMutableArray arrayWithObject:DYNewMask(DYMaskRectangle)];NSDictionary *sibling=DYInsertTool(doc,other,[@"base:" stringByAppendingString:other]);NSString *siblingID=sibling[@"id"];DYWriteTools(host,doc,kCMTimeZero);
|
||||
DYInspector *view=[[[DYInspector alloc]initWithAPIManager:host]autorelease];[view refresh];[view setFrameSize:NSMakeSize(360,780)];
|
||||
@@ -20,6 +21,7 @@
|
||||
for(NSDictionary *d in owned)everyReset&=[host->_values[d[@"pid"]]doubleValue]==([flags containsObject:d[@"pid"]]?0:[d[@"default"]doubleValue])&&host->_keyframes[d[@"pid"]]==nil;
|
||||
everyReset&=[host->_values[neighbor[@"pid"]]doubleValue]==19&&[host->_keyframes[neighbor[@"pid"]]intValue]==2&&DYBaseToolRemoved(deleted,type)&&[(NSView *)card[@"view"]isHidden]&&![DYMasksForTool(deleted,[@"base:" stringByAppendingString:type])count]&&[deleted[@"baseMasks"][other]isEqual:doc[@"baseMasks"][other]]&&DYToolWithID(deleted,siblingID)!=nil;
|
||||
everyUndo&=host->_undoStarts==undo+1&&host->_undoStarts==host->_undoEnds&&!host->_undoActive;
|
||||
if([type isEqual:@"base"])sharedSkin&=[host->_values[skinPID]intValue]==0&&[host->_keyframes[skinPID]intValue]==4;
|
||||
DYAssetState *cleared=DYReadAssets(host,kCMTimeZero);NSMutableDictionary *expected=[[assets.paths mutableCopy]autorelease];if([type isEqual:@"primary"])[expected removeObjectForKey:@"input"];if([type isEqual:@"look"]){[expected removeObjectForKey:@"look0"];[expected removeObjectForKey:@"look4"];}
|
||||
everyAsset&=[cleared.paths isEqual:expected]&&([type isEqual:@"spider"]?cleared.spiderMesh==nil&&cleared.spiderLinked:[cleared.spiderMesh isEqual:assets.spiderMesh]&&!cleared.spiderLinked);
|
||||
NSDictionary *preset=[view presetSnapshot];NSData *toolData=[[[NSData alloc]initWithBase64EncodedString:preset[@"tools"] options:0]autorelease];NSDictionary *presetDoc=[NSPropertyListSerialization propertyListWithData:toolData options:0 format:NULL error:nil];
|
||||
@@ -40,12 +42,14 @@
|
||||
run.record(@"add-module-creates-initialized-independent-layer-without-inheriting-deleted-values",everyFresh);
|
||||
run.record(@"deleting-extra-layer-removes-its-state-and-keeps-child-and-neighbor",everyExtra);
|
||||
run.record(@"narrow-header-keeps-mask-add-delete-and-reset-within-card",everyLayout);
|
||||
run.record(@"deleting-basic-adjustment-preserves-independent-skin-switch-and-animation",sharedSkin);
|
||||
DYDiagnosticManager *failureHost=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(failureHost,nil);failureHost->_keyframeQueryFailure=YES;failureHost->_values[@2000]=@2;NSError *resetFailure=nil;run.record(@"keyframe-query-failure-leaves-author-parameters-unchanged",!DYResetToolParameters(failureHost,DYBaseToolDescriptors(@"base"),kCMTimeZero,&resetFailure)&&resetFailure&&[failureHost->_values[@2000]intValue]==2);
|
||||
NSMutableDictionary *bad=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);bad[@"removedBase"]=@[@"hsl",@"hsl"];run.record(@"removed-base-document-rejects-duplicates",!DYValidToolDocument(bad));bad[@"removedBase"]=@[@"unknown"];run.record(@"removed-base-document-rejects-unknown-modules",!DYValidToolDocument(bad));
|
||||
// A stale host value from another time must not affect a deleted module.
|
||||
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
|
||||
auto pixelsForDeletion=[&](NSDictionary *doc,DYUniforms u,NSDictionary *paths,NSString *name){NSError *failure=nil;BOOL ok=[renderer renderSource:source destination:destination uniforms:u paths:paths spider:nil tools:doc error:&failure];run.need(name,ok,@{@"error":reason(failure)});return read(destination,gpu);};
|
||||
NSDictionary *empty=[[[DYToolDocument alloc]init]autorelease].document;Pixels neutral=pixelsForDeletion(empty,DYToolUniforms(@{@"type":@"hsl"}),@{},@"delete-neutral-render-reference");
|
||||
NSMutableDictionary *skinDoc=DYMutablePlist(empty);DYSetBaseToolRemoved(skinDoc,@"base",YES);DYUniforms skinOracle=DYToolUniforms(@{@"type":@"hsl",@"values":@{@"hsl0_0":@70,@"hsl1_0":@55}});skinOracle.skinProtection.x=1;skinOracle.skinProtection.y=90;Pixels skinBefore=pixelsForDeletion(empty,skinOracle,@{},@"delete-basic-skin-reference");Pixels skinAfter=pixelsForDeletion(skinDoc,skinOracle,@{},@"delete-basic-keeps-skin-render");run.record(@"deleting-basic-adjustment-preserves-separate-skin-rendering",difference(skinBefore,skinAfter).maximum<.0001);
|
||||
NSMutableDictionary *doc=DYMutablePlist(empty);DYSetBaseToolRemoved(doc,@"hsl",YES);DYUniforms stale=DYToolUniforms(@{@"type":@"hsl",@"values":@{@"hsl0_0":@75,@"hsl1_1":@60}});Pixels active=pixelsForDeletion(empty,stale,@{},@"delete-active-hsl-reference");Pixels hidden=pixelsForDeletion(doc,stale,@{},@"delete-stale-hsl-render");run.record(@"deleted-base-is-neutral-even-with-stale-nonzero-host-values",difference(active,neutral).different>20&&difference(hidden,neutral).maximum<.0001);
|
||||
doc=DYMutablePlist(empty);DYSetBaseToolRemoved(doc,@"look",YES);stale=DYToolUniforms(@{@"type":@"look"});hidden=pixelsForDeletion(doc,stale,@{@"look0":@"/missing/deleted-look.cube"},@"deleted-look-does-not-load-stale-file");run.record(@"deleted-lut-does-not-load-or-inherit-stale-file-reference",difference(hidden,neutral).maximum<.0001);
|
||||
doc=DYMutablePlist(empty);for(NSString *type in DYToolTypes())DYSetBaseToolRemoved(doc,type,YES);stale=DYToolUniforms(@{@"type":@"film"});stale.film.grainEnabled=1;stale.film.grainAmount=.8;stale.hslHueA.x=80;stale.hslSectionEnabled=1;hidden=pixelsForDeletion(doc,stale,@{@"input":@"/missing/input.cube",@"look0":@"/missing/look.cube"},@"all-deleted-base-modules-render");run.record(@"all-modules-can-be-removed-without-hidden-render-adjustments",difference(hidden,neutral).maximum<.0001);
|
||||
|
||||
@@ -11,7 +11,7 @@ NSArray<NSDictionary *> *DYBaseToolDescriptors(NSString *type){
|
||||
if(![DYToolTypes()containsObject:type])return @[];NSMutableSet *pids=[NSMutableSet set];
|
||||
for(NSString *part in DYBaseToolParts(type)){NSDictionary *section=DYToolSection(part);if(section[@"enabled"])[pids addObject:section[@"enabled"]];for(NSDictionary *row in section[@"rows"]){if(row[@"pid"])[pids addObject:row[@"pid"]];if(row[@"enabled"])[pids addObject:row[@"enabled"]];}}
|
||||
NSMutableArray *result=[NSMutableArray array];for(NSDictionary *d in DYDescriptors()){
|
||||
NSString *key=d[@"key"];BOOL extra=([type isEqual:@"primary"]&&([key hasPrefix:@"cm"]||[@[@"primaryMasterEnabled",@"inputProfile",@"preLUTStrength"]containsObject:key]))||([type isEqual:@"base"]&&[@[@"skinEnabled",@"copyAutoGrade"]containsObject:key])||([type isEqual:@"look"]&&([key hasPrefix:@"look"]||[key isEqual:@"postLUTStrength"]))||([type isEqual:@"film"]&&[key hasPrefix:@"film"]);
|
||||
NSString *key=d[@"key"];BOOL extra=([type isEqual:@"primary"]&&([key hasPrefix:@"cm"]||[@[@"primaryMasterEnabled",@"inputProfile",@"preLUTStrength"]containsObject:key]))||([type isEqual:@"base"]&&[key isEqual:@"copyAutoGrade"])||([type isEqual:@"look"]&&([key hasPrefix:@"look"]||[key isEqual:@"postLUTStrength"]))||([type isEqual:@"film"]&&[key hasPrefix:@"film"]);
|
||||
if(extra||[pids containsObject:d[@"pid"]])[result addObject:d];
|
||||
}return result;
|
||||
}
|
||||
@@ -26,7 +26,6 @@ void DYApplyRemovedBaseTools(DYUniforms *u,NSDictionary *doc){
|
||||
for(NSDictionary *d in DYBaseToolDescriptors(type))if([d[@"offset"]integerValue]>=0)*(float*)((uint8_t*)u+[d[@"offset"]unsignedIntegerValue])=[d[@"default"]floatValue];
|
||||
for(NSString *part in DYBaseToolParts(type))for(NSDictionary *d in DYDescriptors())if([d[@"pid"]isEqual:DYToolSection(part)[@"enabled"]])*(float*)((uint8_t*)u+[d[@"offset"]unsignedIntegerValue])=0;
|
||||
if([type isEqual:@"primary"]){u->primarySectionEnabled=0;u->inputProfile=0;u->preLUTStrength=0;}
|
||||
if([type isEqual:@"base"])u->skinProtection.x=0;
|
||||
}
|
||||
}
|
||||
NSDictionary *DYVisibleBaseToolPaths(NSDictionary *paths,NSDictionary *doc){
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.7.4</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>50</string>
|
||||
<string>51</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.7.4</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>50</string>
|
||||
<string>51</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
在新工单中引用
屏蔽一个用户