@@ -5230,9 +5230,18 @@ global let enterFrame = startTextEntryMode(\: (string;) {"Go To Frame: ";}, goto
52305230 state . ddFileKind == MovieFileKind ||
52315231 state . ddFileKind == DirectoryFileKind )
52325232 {
5233- state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5234- string [] {"Add as Layer" ,
5235- "Add Source to Session" });
5233+ string [] regions = string [] {"Add as Layer" , "Add Source to Session" };
5234+ bool mediaAllowed = isEventCategoryEnabled ("media_category" );
5235+
5236+ if (mediaAllowed )
5237+ {
5238+ state . ddRegion = drawDropRegions (w , h , x , y , 20 , regions );
5239+ }
5240+ else
5241+ {
5242+ drawBlockedRegions (w , h , x , y , 20 , regions );
5243+ state . ddRegion = - 1 ; // No valid drop region
5244+ }
52365245
52375246 (void ;string ) F = if state . ddRegion == 0
52385247 then addToClosestSource (,"drop" )
@@ -5271,80 +5280,114 @@ global let enterFrame = startTextEntryMode(\: (string;) {"Go To Frame: ";}, goto
52715280 }
52725281 else if (state . ddFileKind == CDLFileKind )
52735282 {
5274- state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5275- string [] {"Set File CDL" ,
5276- "Set Look CDL" });
5277-
5278- let N = if state . ddRegion == 0
5279- then "#RVLinearize"
5280- else if state . ddRegion == 1
5281- then "#RVColor"
5282- else "" ;
5283-
5284- state . ddDropFunc = \: (void ; int a , string s )
5285- {
5286- if (N == "" )
5287- {
5288- ddCancelled (s );
5289- }
5290- else
5291- {
5292- try
5283+ bool sourceAllowed = isEventCategoryEnabled ("source_category" );
5284+
5285+ if (sourceAllowed )
5286+ {
5287+ state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5288+ string [] {"Set File CDL" ,
5289+ "Set Look CDL" });
5290+
5291+ let N = if state . ddRegion == 0
5292+ then "#RVLinearize"
5293+ else if state . ddRegion == 1
5294+ then "#RVColor"
5295+ else "" ;
5296+
5297+ state . ddDropFunc = \: (void ; int a , string s )
5298+ {
5299+ if (N == "" )
52935300 {
5294- readCDL (s , N , true );
5295- displayFeedback ("%s CDL" % path . basename (s ));
5301+ ddCancelled (s );
52965302 }
5297- catch ( exception exc )
5303+ else
52985304 {
5299- let sexc = string (exc );
5300- displayFeedback ("Unable to read CDL %s: %s" % (path . basename (s ), sexc ));
5305+ try
5306+ {
5307+ readCDL (s , N , true );
5308+ displayFeedback ("%s CDL" % path . basename (s ));
5309+ }
5310+ catch (exception exc )
5311+ {
5312+ let sexc = string (exc );
5313+ displayFeedback ("Unable to read CDL %s: %s" % (path . basename (s ), sexc ));
5314+ }
53015315 }
5302- }
5303- };
5316+ };
5317+ }
5318+ else
5319+ {
5320+ // Show blocked regions when source category is disabled
5321+ drawBlockedRegions (w , h , x , y , 20 , string [] {"Set File CDL" , "Set Look CDL" });
5322+ state . ddRegion = - 1 ;
5323+ }
53045324 }
53055325 else if (state . ddFileKind == LUTFileKind )
53065326 {
5307- state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5308- string [] {"Set Display LUT" ,
5309- "Set File LUT" ,
5310- "Set Look LUT" });
5311-
5312- let N = if state . ddRegion == 0
5313- then "@RVDisplayColor"
5314- else if state . ddRegion == 1
5315- then "#RVLinearize"
5316- else if state . ddRegion == 2
5317- then "#RVLookLUT"
5318- else "" ;
5327+ // Check if source modifications are allowed
5328+ bool sourceAllowed = isEventCategoryEnabled ("source_category" );
5329+
5330+ if (sourceAllowed )
5331+ {
5332+ state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5333+ string [] {"Set Display LUT" ,
5334+ "Set File LUT" ,
5335+ "Set Look LUT" });
5336+
5337+ let N = if state . ddRegion == 0
5338+ then "@RVDisplayColor"
5339+ else if state . ddRegion == 1
5340+ then "#RVLinearize"
5341+ else if state . ddRegion == 2
5342+ then "#RVLookLUT"
5343+ else "" ;
53195344
5320- state . ddDropFunc = \: (void ; int a , string s )
5321- {
5322- if (N == "" )
5323- {
5324- ddCancelled (s );
5325- }
5326- else
5327- {
5328- try
5345+ state . ddDropFunc = \: (void ; int a , string s )
5346+ {
5347+ if (N == "" )
53295348 {
5330- readLUT (s , N , true );
5331- displayFeedback ("%s LUT" % path . basename (s ));
5349+ ddCancelled (s );
53325350 }
5333- catch ( exception exc )
5351+ else
53345352 {
5335- let sexc = string (exc );
5336- displayFeedback ("Unable to read LUT %s: %s" % (path . basename (s ), sexc ));
5353+ try
5354+ {
5355+ readLUT (s , N , true );
5356+ displayFeedback ("%s LUT" % path . basename (s ));
5357+ }
5358+ catch (exception exc )
5359+ {
5360+ let sexc = string (exc );
5361+ displayFeedback ("Unable to read LUT %s: %s" % (path . basename (s ), sexc ));
5362+ }
53375363 }
5338- }
5339- };
5364+ };
5365+ }
5366+ else
5367+ {
5368+ // Show blocked regions when source category is disabled
5369+ drawBlockedRegions (w , h , x , y , 20 , string [] {"Set Display LUT" , "Set File LUT" , "Set Look LUT" });
5370+ state . ddRegion = - 1 ;
5371+ }
53405372 }
53415373 else if (state . ddFileKind == RVFileKind )
53425374 {
5343- state . ddProgressiveDrop = true ;
5344- state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5345- string [] {"Replace Session" });
5375+ bool mediaAllowed = isEventCategoryEnabled ("media_category" );
5376+
5377+ if (mediaAllowed )
5378+ {
5379+ state . ddProgressiveDrop = true ;
5380+ state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5381+ string [] {"Replace Session" });
53465382
5347- state . ddDropFunc = \: (void ; int a , string s ) { addSources (string [] {s }, "drop" ); };
5383+ state . ddDropFunc = \: (void ; int a , string s ) { addSources (string [] {s }, "drop" ); };
5384+ }
5385+ else
5386+ {
5387+ // Show blocked regions when media category is disabled
5388+ drawBlockedRegions (w , h , x , y , 20 , string [] {"Replace Session" });
5389+ state . ddRegion = - 1 ;
5390+ }
53485391 }
53495392 else
53505393 {
@@ -5377,46 +5420,80 @@ global let enterFrame = startTextEntryMode(\: (string;) {"Go To Frame: ";}, goto
53775420 state . ddFileKind == MovieFileKind ||
53785421 state . ddFileKind == DirectoryFileKind )
53795422 {
5380- state . ddProgressiveDrop = true ;
5381- state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5382- string [] {"Add Source to Session" });
5383- state . ddDropFunc = \: (void ; int a , string s )
5384- {
5385- let f = frameEnd (),
5386- empty = sources (). size () == 0 ;
5423+ bool mediaAllowed = isEventCategoryEnabled ("media_category" );
5424+
5425+ if (mediaAllowed )
5426+ {
5427+ state . ddProgressiveDrop = true ;
5428+ state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5429+ string [] {"Add Source to Session" });
5430+ state . ddDropFunc = \: (void ; int a , string s )
5431+ {
5432+ let f = frameEnd (),
5433+ empty = sources (). size () == 0 ;
53875434
5388- addSources (string [] {s }, "drop" );
5435+ addSources (string [] {s }, "drop" );
53895436
5390- if (empty )
5391- {
5392- setFrame (frameStart ());
5393- }
5394- else
5395- {
5396- setFrame (f + 1 );
5397- //markFrame(f + 1, true);
5398- //markFrame(frameStart(), true);
5399- }
5400- redraw ();
5401- };
5437+ if (empty )
5438+ {
5439+ setFrame (frameStart ());
5440+ }
5441+ else
5442+ {
5443+ setFrame (f + 1 );
5444+ //markFrame(f + 1, true);
5445+ //markFrame(frameStart(), true);
5446+ }
5447+ redraw ();
5448+ };
5449+ }
5450+ else
5451+ {
5452+ // Show blocked regions when media category is disabled
5453+ drawBlockedRegions (w , h , x , y , 20 , string [] {"Add Source to Session" });
5454+ state . ddRegion = - 1 ;
5455+ }
54025456 }
54035457 else if (state . ddFileKind == RVFileKind )
54045458 {
5405- state . ddProgressiveDrop = true ;
5406- state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5407- string [] {"Load Session" });
5459+ bool mediaAllowed = isEventCategoryEnabled ("media_category" );
5460+
5461+ if (mediaAllowed )
5462+ {
5463+ state . ddProgressiveDrop = true ;
5464+ state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5465+ string [] {"Load Session" });
54085466
5409- state . ddDropFunc = \: (void ; int a , string s ) { addSources (string [] {s }, "drop" ); };
5467+ state . ddDropFunc = \: (void ; int a , string s ) { addSources (string [] {s }, "drop" ); };
5468+ }
5469+ else
5470+ {
5471+ // Show blocked regions when media category is disabled
5472+ drawBlockedRegions (w , h , x , y , 20 , string [] {"Load Session" });
5473+ state . ddRegion = - 1 ;
5474+ }
54105475 }
54115476 else if (state . ddFileKind == LUTFileKind )
54125477 {
5413- state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5414- string [] {"Set Display LUT" });
5478+ // Check if source modifications are allowed
5479+ bool sourceAllowed = isEventCategoryEnabled ("source_category" );
5480+
5481+ if (sourceAllowed )
5482+ {
5483+ state . ddRegion = drawDropRegions (w , h , x , y , 20 ,
5484+ string [] {"Set Display LUT" });
54155485
5416- state . ddDropFunc = \: (void ; int a , string s )
5417- {
5418- readLUT (s , "@RVDisplayColor" , true );
5419- };
5486+ state . ddDropFunc = \: (void ; int a , string s )
5487+ {
5488+ readLUT (s , "@RVDisplayColor" , true );
5489+ };
5490+ }
5491+ else
5492+ {
5493+ // Show blocked regions when source category is disabled
5494+ drawBlockedRegions (w , h , x , y , 20 , string [] {"Set Display LUT" });
5495+ state . ddRegion = - 1 ;
5496+ }
54205497 }
54215498 else
54225499 {
0 commit comments