# List of edits in which the segments are found. In xsls

**URL:** <https://forum.logik.tv/t/list-of-edits-in-which-the-segments-are-found-in-xsls/7718>\
**Category:** Python\
**Tags:** shot-sequence\
**Created:** [February 14, 2023, 3:02pm UTC](https://forum.logik.tv/t/list-of-edits-in-which-the-segments-are-found-in-xsls/7718 "2023-02-14T15:02:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebquismoke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/sebquismoke/32/1178_2.png) [@Sebquismoke](https://forum.logik.tv/u/Sebquismoke)\
**Post date:** [February 14, 2023, 3:02pm UTC](https://forum.logik.tv/t/list-of-edits-in-which-the-segments-are-found-in-xsls/7718/1 "2023-02-14T15:02:03Z")

</div>

Hello,

I would like from a Shot sequence to be able to recover for each segment, the list in xslx of the clips in which they are found. Via a python script accessible from a right-click on the shot-sequence

example:  
SH\_0010 present in the clip Edit\_01, Edit\_03…  
SH\_0020 present in the clip Edit\_10, Edit\_05…

Thank you  
Seb

---

<div class="post-metadata">

**Author:** ![Slabrie](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@Slabrie](https://forum.logik.tv/u/Slabrie)\
**Post date:** [February 14, 2023, 6:35pm UTC](https://forum.logik.tv/t/list-of-edits-in-which-the-segments-are-found-in-xsls/7718/3 "2023-02-14T18:35:01Z")

</div>

Salut Sebastien!

Please fill a General Request on flame-feedback since I doubt Python API is capable of extracting the relationship of connected segments. That would be a very welcome addition.

---

<div class="post-metadata">

**Author:** ![fredwarren](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/fredwarren/32/158_2.png) [@fredwarren](https://forum.logik.tv/u/fredwarren)\
**Post date:** [February 16, 2023, 1:22pm UTC](https://forum.logik.tv/t/list-of-edits-in-which-the-segments-are-found-in-xsls/7718/4 "2023-02-16T13:22:22Z")

</div>

This is an example of how you can achieve the part needed using the Flame API:

In the Flame Python Console you can execute this (please note that you will need to intend rows 2, 3, and 5 by 4 characters and row 4 by 8 characters):

import flame

> for clip in flame.timeline.current\_segment.connected\_segments():  
> parent = clip.parent  
> while ((isinstance(parent, (flame.PyClip)) != True) and parent):  
> parent = parent.parent  
> print(parent.name)

Here’s a file that you can put in /opt/Autodesk/shared/python to get the same as a custom action. Note that this one will print the name of the segments in the shell/terminal you used to launch Flame.

You will need to adapt it to propagate the information to an Excel document.

[get\_connected\_segments.py](https://forum.logik.tv/uploads/short-url/jkPNUuGzR30qjdebWHk4DP4YQM3.py) (977 Bytes)

---

<div class="post-metadata">

**Author:** ![Sebquismoke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/sebquismoke/32/1178_2.png) [@Sebquismoke](https://forum.logik.tv/u/Sebquismoke)\
**Post date:** [February 17, 2023, 8:40am UTC](https://forum.logik.tv/t/list-of-edits-in-which-the-segments-are-found-in-xsls/7718/5 "2023-02-17T08:40:48Z")

</div>

Hi Fred,  
Thank you very much, I will be able to have fun for this last day before my vacation.  
Have a good day.  
Seb
