## Autodetect Clip length on loader

miaz3
Fusioneer
Posts: 203
Joined: Sat Jan 03, 2015 1:43 am
Location: Angoulême / France
Been thanked: 1 time
Contact:

### Autodetect Clip length on loader

Hello,

I can't find a way to print this value on a loader. Right Clic on Trim bar > Autodetect Clip Length
forum_help_screen001.jpg
thanks,
You do not have the required permissions to view the files attached to this post.

Tags:

SirEdric
Fusionator
Posts: 1564
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 45 times
Contact:

### Re: Autodetect Clip length on loader

Sorry, but what do you mean with "
miaz3 wrote:
Thu Mar 07, 2019 8:07 am
print this value on a loader
"?

intelligent machine
Fusionista
Posts: 341
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 16 times
Contact:

### Re: Autodetect Clip length on loader

from the manual:
Autodetect Clip Length
This rescans the clip to see if frames have been added or removed since the last time the clip was scanned (when it was loaded).
The function would just have a set of current values and new values to compare and adjust if there is a difference.
The current clip length will always be last - first. Is that what you want to print in console?

miaz3
Fusioneer
Posts: 203
Joined: Sat Jan 03, 2015 1:43 am
Location: Angoulême / France
Been thanked: 1 time
Contact:

### Re: Autodetect Clip length on loader

Erf, sorry.
I mean, how can i get this function with lua.

intelligent machine
Fusionista
Posts: 341
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 16 times
Contact:

### Re: Autodetect Clip length on loader

take a look at the ReloadLoaders python script from Reactor for some clues.

miaz3
Fusioneer
Posts: 203
Joined: Sat Jan 03, 2015 1:43 am
Location: Angoulême / France
Been thanked: 1 time
Contact:

### Re: Autodetect Clip length on loader

I do not want to reload a loader, but I just want to know how to recover this attributes.

SirEdric
Fusionator
Posts: 1564
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 45 times
Contact:

### Re: Autodetect Clip length on loader

As @intelligent machine pointed out, clues to that might live inside that script...

miaz3
Fusioneer
Posts: 203
Joined: Sat Jan 03, 2015 1:43 am
Location: Angoulême / France
Been thanked: 1 time
Contact:

### Re: Autodetect Clip length on loader

ok, so 'TOOLIT_Clip_Length' is just a trimIN - trimOUT. is that 'Autodetect Clip length' ?

Movalex
Posts: 45
Joined: Fri Nov 03, 2017 5:36 am
Been thanked: 6 times
Contact:

### Re: Autodetect Clip length on loader

The script does a false rename of the Loader to reload duration. So probably Alberto did not find the answer to that question:
viewtopic.php?p=16423#p16423

SirEdric
Fusionator
Posts: 1564
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 45 times
Contact:

### Re: Autodetect Clip length on loader

'Autodetect Clip length' is a function inside Fusion.
Not sure if it can be called directly.
I normally check via bmd.readdir() to get the number of files on a sequence.

intelligent machine
Fusionista
Posts: 341
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 16 times
Contact:

### Re: Autodetect Clip length on loader

Autodetect Clip length "rescans the clip to see if frames have been added or removed since the last time the clip was scanned (when it was loaded)."
The scan happens automatically when you first select a sequence with the loader tool.

What is the end goal of your script?

The alternative if you want to write something from scratch to recreate the same functionality is:
Separate the filename from path
Find the sequence number within the file name using a simple regex
Since that number may not be the first frame:
recursively step backward with the numbering in the name until it fails - now you have the first frame - store that number somewhere
and then step forward until you find the last frame

Added in 3 minutes 11 seconds:
SirEdric wrote:
Thu Mar 07, 2019 12:31 pm
'Autodetect Clip length' is a function inside Fusion.
Not sure if it can be called directly.
I normally check via bmd.readdir() to get the number of files on a sequence.
This will be correct if there are no missing files in the middle of the sequence and what I mentioned above will cut the sequence at the first missing file.

What are you looking for in the end?

miaz3
Fusioneer
Posts: 203
Joined: Sat Jan 03, 2015 1:43 am
Location: Angoulême / France
Been thanked: 1 time
Contact:

### Re: Autodetect Clip length on loader

movalex shows the right way,
I know how to load images in a loader, trim, duration time...either via readdir (), or via a simple len () or via a bdd (ftrack/shotgun...)

I just want to know what's going on below 'Autodetect Clip length', and especially if it's possible to call it.

SirEdric
Fusionator
Posts: 1564
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 45 times
Contact:

### Re: Autodetect Clip length on loader

Once you detected Path and Filename/Extension in the loader,
bmd.readdir() can do great things for you:

Code: Select all

ct = comp.CurrentTime
print('Count: ' .. count)