I just wrote a script for my own use that will set the exact crop settings needed to crop 1080i HDV for output to SD. This lets you edit with 1080i project settings (which I think preserves the maximum resolution for everything, and then downsample when you do the Render As using the NTSC DV template.
The script works fine, but in the process of writing it I had to test whether pan/crop had already been set, so I could ignore those events where I had already created a pan/crop (for instance where I wanted to pan/scan an HDV frame). Obviously if there is more than one keyframe, I know that pan/crop has been changed and I ignore the event. However, the FIRST keyframe might have been changed and, if so, I don't want my script to touch that event.
The only way I could figure out to know whether the settings were other than default was to hard-wire the project settings for each corner of the pan/crop and test those, e.g.,
if ( (keyframes.Count <= 1) && (keyframe.TopLeft.Y == 0) && (keyframe.TopLeft.X==0) && (keyframe.BottomRight.X==1440) && (keyframe.BottomRight.Y == 1080) ){
Even this doesn't really test all the default values, but it was good enough for the script that I am only going to use for my own purposes.
Basically what I want to be able to test is whether the pan/crop button in the event is highlighted. There has to be a "dirty" flag somewhere in Vegas that sets this, and that's what I would like to be able to test.
The script works fine, but in the process of writing it I had to test whether pan/crop had already been set, so I could ignore those events where I had already created a pan/crop (for instance where I wanted to pan/scan an HDV frame). Obviously if there is more than one keyframe, I know that pan/crop has been changed and I ignore the event. However, the FIRST keyframe might have been changed and, if so, I don't want my script to touch that event.
The only way I could figure out to know whether the settings were other than default was to hard-wire the project settings for each corner of the pan/crop and test those, e.g.,
if ( (keyframes.Count <= 1) && (keyframe.TopLeft.Y == 0) && (keyframe.TopLeft.X==0) && (keyframe.BottomRight.X==1440) && (keyframe.BottomRight.Y == 1080) ){
Even this doesn't really test all the default values, but it was good enough for the script that I am only going to use for my own purposes.
Basically what I want to be able to test is whether the pan/crop button in the event is highlighted. There has to be a "dirty" flag somewhere in Vegas that sets this, and that's what I would like to be able to test.