diff --git a/template/verification/StaticContract.json b/template/verification/StaticContract.json index a97479a..b8c99a6 100644 --- a/template/verification/StaticContract.json +++ b/template/verification/StaticContract.json @@ -1,6 +1,6 @@ { "passed": true, - "sha256": "e6f3fe538e4ef4e1ea2946d360120747a53c088a2c872330f6d79275d253ea5e", + "sha256": "9b8f6e407545429b77c1de88d4cceb738760771c5a7f1dbd9732bdcc95c23738", "version": "5.13", "displayversion": "5.6.7", "filterCount": 1, diff --git a/template/大鱼调色.moef b/template/大鱼调色.moef index aea4f1b..915ff61 100644 --- a/template/大鱼调色.moef +++ b/template/大鱼调色.moef @@ -288,7 +288,7 @@ - + 8589934608 @@ -543,7 +543,7 @@ - + 1 diff --git a/tools/build_template.py b/tools/build_template.py index 0ea9040..a1fcd95 100644 --- a/tools/build_template.py +++ b/tools/build_template.py @@ -67,7 +67,7 @@ def build(model): insert_at=list(root).index(root.findall('factory')[-1])+1 for uuid,fid in factory_ids.items(): factory=copy.deepcopy(lookup[uuid]);factory.set('id',fid);root.insert(insert_at,factory);insert_at+=1 - filt=E.parse(SOURCES/'NativeFxPlugShell.xml').getroot() + filt=E.parse(SOURCES/'NativeFxPlugShell.xml').getroot();filt.set('pluginVersion','0') # Keep the original native host mix/flip/input-point/OSC parameters, replace # the product's entire registered parameter set and custom archives. host=list(filt.findall('parameter')) @@ -84,7 +84,7 @@ def build(model): value=format(float(row['default']),'.17g') E.SubElement(filt,'parameter',name=row['title'],id=str(row['pid']),flags='12889161776' if row.get('notAnimatable') else '12889161760',default=value,value=value) for node in host: - if node.get("id")=="10005":node.set("value","1");node.set("default","1") + if node.get("id")=="10005":node.set("value","1");node.set("default","0");node.set("flags","8589934592") filt.append(node) source.append(filt) copyright=E.parse(SOURCES/'CopyrightRig.xml').getroot() @@ -120,7 +120,7 @@ def verify(data,model): assert len(filters)==1 and filters[0].get('pluginUUID')==PLUGIN_UUID f=filters[0];params={p.get('id'):p for p in f.findall('parameter')} assert len(params)==len(list(f.findall('parameter'))) - assert params["10005"].get("value")==params["10005"].get("default")=="1" + assert params["10005"].get("value")=="1" and params["10005"].get("flags")=="8589934592" and f.get("pluginVersion")=="0" for row in model['parameters']: p=params[str(row['pid'])];assert float(p.get('default'))==float(row['default'])==float(p.get('value')) assert all(not v in data for v in (b'CameraRawTables',b'1.png',b'relativeURL')) diff --git a/tools/create_mask_host_fixture.py b/tools/create_mask_host_fixture.py index 00ad160..db4340e 100644 --- a/tools/create_mask_host_fixture.py +++ b/tools/create_mask_host_fixture.py @@ -6,7 +6,7 @@ out=Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa');out.mkdi media=out/'大鱼调色_蒙版合成运动.mov' if not media.exists(): subprocess.run(['/opt/homebrew/bin/ffmpeg','-v','error','-f','lavfi','-i',"nullsrc=s=1080x640:r=25:d=4,geq=lum='128+70*sin(X/11)*cos(Y/9)+35*sin((X+Y)/4)':cb='128+35*sin(X/17)':cr='128+35*cos(Y/21)',crop=960:540:'40+10*t':'40+5*t'",'-c:v','prores_ks','-profile:v','2','-pix_fmt','yuv422p10le','-color_primaries','bt709','-color_trc','bt709','-colorspace','bt709',str(media)],check=True) -root=E.Element('fcpxml',version='1.12');res=E.SubElement(root,'resources');E.SubElement(res,'format',id='f1',width='960',height='540',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)');a=E.SubElement(res,'asset',id='a1',name='合成运动纹理',start='0s',duration='4s',format='f1',hasVideo='1',videoSources='1');E.SubElement(a,'media-rep',kind='original-media',src=media.as_uri());template=Path('/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef');E.SubElement(res,'effect',id='fx',name='大鱼调色',uid='~/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef',src=template.as_uri());lib=E.SubElement(root,'library');event=E.SubElement(lib,'event',name='大鱼调色_1.4_21_蒙版与工具层验收') -for name in ['大鱼调色_1.4_21_独立工具与蒙版','大鱼调色_1.4_21_逐帧跟踪']: +root=E.Element('fcpxml',version='1.12');res=E.SubElement(root,'resources');E.SubElement(res,'format',id='f1',width='960',height='540',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)');a=E.SubElement(res,'asset',id='a1',name='合成运动纹理',start='0s',duration='4s',format='f1',hasVideo='1',videoSources='1');E.SubElement(a,'media-rep',kind='original-media',src=media.as_uri());template=Path('/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef');E.SubElement(res,'effect',id='fx',name='大鱼调色',uid='~/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef',src=template.as_uri());lib=E.SubElement(root,'library');event=E.SubElement(lib,'event',name='大鱼调色_1.4_22_蒙版与工具层验收') +for name in ['大鱼调色_1.4_22_独立工具与蒙版','大鱼调色_1.4_22_逐帧跟踪']: project=E.SubElement(event,'project',name=name);seq=E.SubElement(project,'sequence',format='f1',tcStart='0s',tcFormat='NDF',audioLayout='stereo',audioRate='48k',duration='4s');spine=E.SubElement(seq,'spine');clip=E.SubElement(spine,'asset-clip',ref='a1',name=name,offset='0s',start='0s',duration='4s');E.SubElement(clip,'filter-video',ref='fx',name='大鱼调色',enabled='1') -E.indent(root);xml=out/'大鱼调色_1.4_21_蒙版与工具层.fcpxml';xml.write_text('\n\n'+E.tostring(root,encoding='unicode')+'\n');print(xml) +E.indent(root);xml=out/'大鱼调色_1.4_22_蒙版与工具层.fcpxml';xml.write_text('\n\n'+E.tostring(root,encoding='unicode')+'\n');print(xml) diff --git a/verification/Delivery.json b/verification/Delivery.json index 3f8f4a2..cce8fab 100644 --- a/verification/Delivery.json +++ b/verification/Delivery.json @@ -3,14 +3,14 @@ "path": "/Library/Plug-Ins/FxPlug/大鱼调色.app", "bundleID": "com.dayu.color", "version": "1.4.0", - "build": "20", + "build": "21", "team": "B3W25FX5H5", - "notaryID": "f3a3ff9e-91e6-4d7f-9e3b-12cb19e74e31", + "notaryID": "fc44ab42-4b46-491d-9733-f4ad6c5233df", "notaryStatus": "Accepted", "gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID", - "sourceCommit": "659a8c540db47ed593059127ab7c5ab018c359c0", + "sourceCommit": "3fc32f3e1913c9887a6c6d1c384ed0297930c600", "templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef", - "templateSHA256": "3fa725f9d6f7de662afe9f6aa1269a39187457077c86afa8af5c09df9d3205b8", + "templateSHA256": "e6f3fe538e4ef4e1ea2946d360120747a53c088a2c872330f6d79275d253ea5e", "shaderSHA256": "df82ed0310281e854085063276ab161db7c623511751a1c1c63607b4072c8097", - "previousInstallBackup": "/Library/Plug-Ins/FxPlug/.dayu-color-previous-793570296f434520b48336b9fc33da85.app" + "previousInstallBackup": "/Library/Plug-Ins/FxPlug/.dayu-color-previous-cc56f5cdd2894832abaa89e76df4de8b.app" } diff --git a/verification/InstalledSelfTest.json b/verification/InstalledSelfTest.json index d76ed65..78a73c5 100644 --- a/verification/InstalledSelfTest.json +++ b/verification/InstalledSelfTest.json @@ -12,7 +12,7 @@ "error": "未提供错误信息", "name": "runtime-directory", "pass": true, - "path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/4AA64968-A886-4BB3-8D20-C24A575A601D" + "path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/9046B7E8-EA9F-453A-BFBC-7603A1FE84A1" }, { "descriptors": 234, @@ -816,7 +816,7 @@ "error": "未提供错误信息", "name": "renderer-export-33cube", "pass": true, - "path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/4AA64968-A886-4BB3-8D20-C24A575A601D/diagnostic-export.cube" + "path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/9046B7E8-EA9F-453A-BFBC-7603A1FE84A1/diagnostic-export.cube" }, { "bytes": 1186074, @@ -836,7 +836,7 @@ }, { "heartbeats": 0, - "maximumGapMS": 84.198874887079, + "maximumGapMS": 85.91441670432687, "name": "external-activation-main-loop-responsive", "pass": true }, @@ -1146,6 +1146,6 @@ "pass": true } ], - "runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/4AA64968-A886-4BB3-8D20-C24A575A601D", + "runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/9046B7E8-EA9F-453A-BFBC-7603A1FE84A1", "scope": "Native model and renderer integration with real Metal/IOSurface textures and fake FxPlug host selectors; no GUI or live host document." } diff --git a/大鱼调色/Plugin/DYPlugIn.mm b/大鱼调色/Plugin/DYPlugIn.mm index 9652608..94c7e68 100644 --- a/大鱼调色/Plugin/DYPlugIn.mm +++ b/大鱼调色/Plugin/DYPlugIn.mm @@ -6,6 +6,7 @@ #import "DYAutoGrade.h" #import "DYToolState.h" #import +#import #include "MaskCore/DYTracker.hpp" #include #include "DYToolHostDeclarations.inc.h" diff --git a/大鱼调色/Plugin/DYToolHostMethods.inc.h b/大鱼调色/Plugin/DYToolHostMethods.inc.h index eea6d66..bdc8d9a 100644 --- a/大鱼调色/Plugin/DYToolHostMethods.inc.h +++ b/大鱼调色/Plugin/DYToolHostMethods.inc.h @@ -7,7 +7,7 @@ [_toolSession release];[_selectedToolNode release];[_selectedToolMask release];[_toolCanvasDraft release];[_toolCanvasOriginal release];[_trackingNode release];[_trackingMaskID release];[_trackingFrozenMask release];[_trackingCandidate release];[_trackingSamples release];[_trackingMessage release];[_toolCaptureDevices release]; } - (void)scheduleToolCanvasRegistration { - _toolCaptureEnabled=YES;dispatch_async(dispatch_get_main_queue(),^{ida=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];@try{if(!self->_toolSession){NSString *session=NSUUID.UUID.UUIDString;ids=[self->_apiManager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];if([s setStringParameterValue:session toParameter:DYCanvasSessionParameterID]){self->_toolSession=[session copy];@synchronized(DYToolCanvasSessions()){[DYToolCanvasSessions()setObject:self forKey:session];}}}}@finally{[a endAction:self];}}); + _toolCaptureEnabled=YES;dispatch_async(dispatch_get_main_queue(),^{ida=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];@try{if(!self->_toolSession){NSString *session=NSUUID.UUID.UUIDString;ids=[self->_apiManager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];BOOL accepted=[s setStringParameterValue:session toParameter:DYCanvasSessionParameterID];os_log(OS_LOG_DEFAULT,"dayu_tool_canvas_registered accepted=%{public}d",(int)accepted);{self->_toolSession=[session copy];@synchronized(DYToolCanvasSessions()){[DYToolCanvasSessions()setObject:self forKey:session];}}}}@finally{[a endAction:self];}}); } - (dy::GrayFrame)toolGrayFrame:(FxImageTile*)tile error:(NSError**)error { @synchronized(_toolCaptureDevices){FxRect b=tile.tilePixelBounds,image=tile.imagePixelBounds;if(b.left!=image.left||b.right!=image.right||b.bottom!=image.bottom||b.top!=image.top)return {}; @@ -21,7 +21,7 @@ NSString *node=[[_trackingNode?:_selectedToolNode copy]autorelease];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrackingStatus" object:self->_apiManager userInfo:@{@"node":node?:@"",@"message":message?:@""}];}); } - (void)toolCanvasSelection:(NSNotification*)notification { - NSString *node=notification.userInfo[@"node"],*mask=notification.userInfo[@"mask"];if(!node||!mask)return; + NSString *node=notification.userInfo[@"node"],*mask=notification.userInfo[@"mask"];if(!node||!mask)return;os_log(OS_LOG_DEFAULT,"dayu_tool_canvas_selected"); @synchronized(self){if(_trackingActive.load()&&(![_trackingNode isEqual:node]||![_trackingMaskID isEqual:mask])){_trackingCancelled.store(true);_trackingDiscard=YES;}[_selectedToolNode release];_selectedToolNode=[node copy];[_selectedToolMask release];_selectedToolMask=[mask copy];_toolCanvasHidden=[notification.userInfo[@"hidden"]boolValue];_toolDrawingPen=[notification.userInfo[@"draw"]boolValue];[_toolCanvasDraft release];_toolCanvasDraft=nil;[_toolCanvasOriginal release];_toolCanvasOriginal=nil;} } - (BOOL)toolCanvasVisible {@synchronized(self){return _selectedToolNode&&_selectedToolMask&&!_toolCanvasHidden;}} diff --git a/大鱼调色/Plugin/DYToolOSC.inc.h b/大鱼调色/Plugin/DYToolOSC.inc.h index 1e0ec4f..e2fe4a9 100644 --- a/大鱼调色/Plugin/DYToolOSC.inc.h +++ b/大鱼调色/Plugin/DYToolOSC.inc.h @@ -4,9 +4,9 @@ @end @implementation DYToolOSC { id _device;id _queue;CIContext *_context; - CGFloat _height;NSRect _imageRect;NSDictionary *_mask;NSMutableArray *_handles;NSBezierPath *_outline; + CGFloat _height;NSRect _imageRect;NSDictionary *_mask;NSMutableArray *_handles;NSBezierPath *_outline;NSInteger _lastRoute;NSUInteger _drawCount; } -- (instancetype)initWithAPIManager:(id)manager{if((self=[super init])){_apiManager=manager;_handles=[NSMutableArray new];}return self;} +- (instancetype)initWithAPIManager:(id)manager{if((self=[super init])){_apiManager=manager;_handles=[NSMutableArray new];_lastRoute=-1;os_log(OS_LOG_DEFAULT,"dayu_tool_osc_init");}return self;} - (void)dealloc{[_device release];[_queue release];[_context release];[_mask release];[_handles release];[_outline release];[super dealloc];} - (FxDrawingCoordinates)drawingCoordinates{return kFxDrawingCoordinates_CANVAS;} - (DYPlugIn*)pluginAtTime:(CMTime)time{NSString *value=nil;idget=[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];[get getStringParameterValue:&value fromParameter:DYCanvasSessionParameterID];@synchronized(DYToolCanvasSessions()){return [DYToolCanvasSessions()objectForKey:value];}} @@ -19,7 +19,7 @@ idtexture=[destination metalTextureForDevice:_device];if(!texture||!_queue)return;idcommands=[_queue commandBuffer];MTLRenderPassDescriptor *pass=[MTLRenderPassDescriptor renderPassDescriptor];pass.colorAttachments[0].texture=texture;pass.colorAttachments[0].loadAction=MTLLoadActionClear;pass.colorAttachments[0].storeAction=MTLStoreActionStore;pass.colorAttachments[0].clearColor=MTLClearColorMake(0,0,0,0);idencoder=[commands renderCommandEncoderWithDescriptor:pass];[encoder endEncoding]; _height=destination.imagePixelBounds.top-destination.imagePixelBounds.bottom;CGFloat canvasWidth=destination.imagePixelBounds.right-destination.imagePixelBounds.left; idapi=[_apiManager apiForProtocol:@protocol(FxOnScreenControlAPI_v4)];double lx=0,ly=0,ux=0,uy=0;[api convertPointFromSpace:kFxDrawingCoordinates_OBJECT fromX:0 fromY:0 toSpace:kFxDrawingCoordinates_CANVAS toX:&lx toY:&ly];[api convertPointFromSpace:kFxDrawingCoordinates_OBJECT fromX:1 fromY:1 toSpace:kFxDrawingCoordinates_CANVAS toX:&ux toY:&uy];_imageRect=NSMakeRect(lx,_height-uy,ux-lx,uy-ly); - DYPlugIn *plugin=[self pluginAtTime:time];NSDictionary *mask=[plugin toolCanvasMaskAtTime:time];[_mask release];_mask=[mask copy];[_handles removeAllObjects];[_outline release];_outline=nil; + DYPlugIn *plugin=[self pluginAtTime:time];NSDictionary *mask=[plugin toolCanvasMaskAtTime:time];NSInteger route=(plugin?1:0)+(mask?2:0);if(route!=_lastRoute||_drawCount++<2){_lastRoute=route;os_log(OS_LOG_DEFAULT,"dayu_tool_osc_route plugin=%{public}d mask=%{public}d width=%{public}.2f height=%{public}.2f",plugin!=nil,mask!=nil,_imageRect.size.width,_imageRect.size.height);}[_mask release];_mask=[mask copy];[_handles removeAllObjects];[_outline release];_outline=nil; if(mask&&canvasWidth>0&&_height>0&&canvasWidth<16384&&_height<16384&&_imageRect.size.width>0&&_imageRect.size.height>0){ NSBitmapImageRep *bitmap=[[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:NULL pixelsWide:(NSInteger)canvasWidth pixelsHigh:(NSInteger)_height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:(NSInteger)canvasWidth*4 bitsPerPixel:32]autorelease];memset(bitmap.bitmapData,0,bitmap.bytesPerRow*bitmap.pixelsHigh);[NSGraphicsContext saveGraphicsState];[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:bitmap]];NSAffineTransform *flip=[NSAffineTransform transform];[flip translateXBy:0 yBy:_height];[flip scaleXBy:1 yBy:-1];[flip concat]; DYMaskParameters p;[mask[@"parameters"]getBytes:&p length:sizeof(p)];p.imageAspect=_imageRect.size.width/_imageRect.size.height;_outline=[[NSBezierPath bezierPath]retain]; diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index 6020a65..4caa8ad 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.4.0 CFBundleVersion - 21 + 22 NSHumanReadableCopyright PlugInKit @@ -71,7 +71,7 @@ uuid 1C17B73B-F229-4C09-A434-EAF6DFF5F22A version - 1.0 + 1.4.0 className diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index 7d8439a..5883494 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.4.0 CFBundleVersion - 21 + 22 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright