diffusionstudio / core

The Video Creation Engine: Edit videos with code, featuring the fastest WebCodecs renderer for in-browser video processing.
https://examples.diffusion.studio/
Mozilla Public License 2.0
269 stars 19 forks source link

Clip id’s able to set #21

Open girayk opened 2 days ago

girayk commented 2 days ago

Some projects we re recalling clips from db, etc. Can we make id’s re able to set, it’s will save time to chase them 😂

k9p5 commented 2 days ago

I'm not quite sure what you're referring to, could you elaborate?

girayk commented 2 days ago

https://github.com/diffusionstudio/core/blob/9a501fee9aa442c749bfecbc215c34b9b2c75d5f/src/mixins/event.ts#L27

The ids on clips are random and not over writable.

k9p5 commented 1 day ago

Is the name property not sufficient? It's like an ID but user defined

voladelta commented 19 hours ago

i can't set name, i'd love to set id as well

image image
girayk commented 18 hours ago

other hand, name is could something visible and id is something private. for example when i add 2.mp4 on my project, i would like to show name on timeline etc with original name and i need to use id for able to identify them. name is could be same for anything but id must have unique. second name is deprecated on pixi, we need use label instead of Name. also when we create new clip object we are able to overwrite id, but when we create clip object from Json we re not able, when we create image clip we re able to set start and end time, but when its video object we re not able. I know clips are has different properties but image and video should have common properties. and last thing, there is getSize method on clip stage, which is useful for text or html clips because we re not scaling sizes of object but we re changing font size etc, my suggestion is getSize method should have for any clip object for ignoring potential errors.