Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to keep the original selected elements unchanged after Inserts keyframes

Explorer ,
Dec 19, 2023 Dec 19, 2023

I selected 5 elements in a single layer and lost the original selection after using the following command. How can I still keep the original selection after Inserts keyframes?
fl.getDocumentDOM().getTimeline().insertKeyframe();

TOPICS
Exchange extensions , How to , Timeline
392
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2023 Dec 20, 2023

save them

then reselect with jsfl after taking deselecting steps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 20, 2023 Dec 20, 2023

Can you provide specific jsfl code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2023 Dec 20, 2023

use the api. i'm on my mobile phone.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2023 Dec 20, 2023

back at computer

 

var selectedA = fl.getDocumentDOM().selection;

fl.getDocumentDOM().getTimeline().insertKeyframe();

 

// you may want to deselect everything here

 

for(var i=0;i<selectedA.length;i++){

selectedA[i].selected = true;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 20, 2023 Dec 20, 2023

It's strange that after testing, the selected element is not restored

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 20, 2023 Dec 20, 2023

The previous keyframe remains selected, but the current keyframe is not selected

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2023 Dec 20, 2023

how are you using the code i suggested?  ie, you select on-stage objects, then you execute the amended script so you insert a keyframe where desired and still have the selected objects, selected.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 20, 2023 Dec 20, 2023
LATEST

Yes, I followed the steps you mentioned to execute jsfl, but after inserting keyframes, the object is not automatically selected.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines