Copy link to clipboard
Copied
Hello,
I am having trouble adding 1000 times the same project item (with different attributes each time) as track items.
At the same time, adding other hundreds of project items (all different this time), and at the same time doing prints in the console.
(Visual code got a bit unresponsive with telling me 3 times though pop up windows: "visual has.., do you wish to continue, cancel,..etc?")
I was wondering, what would be the best practices, to make visual code + Premiere Pro work well and be able to treat the same proj item 1000 times for example while doing other stuff and succeed?
(While I writing this test, the script is still "running"' while nothing happening. And I doubt anything will happen)
The code is fine, It was working with 5 items.
Would making 1000 subclips (which I don't know well yet, is it actually creating "new files"?), better than trying to treat the SAME PROJECT ITEM 1000 times?
Anyway, What Can I do to "help" and "augment" the performances in general? What are the best practices, and what I do in general to make my script complete its run, instead of stopping? at the moment it is supposed to insert items into the tracks..
I have a powerful GPU card by the way, Okay CPU. Right now while the code is running and NOTHING is happening and After saying "yes continue running" 3 times to visual code, the cpu is at 13% and GPU is at low use.
Was Premiere Pro Overwhelmed hence it does not know what to do?
(For the record, the logs show that my code reached the part where the projects items are inserted, and the logs shows that the script run through that "inserting part" many times. Finally when the logs end (supposedfly after 1000 insertion has been passed), .. my premiere pro projectr.. does not "get modified" (no item is added unfortuantely), again, the code worked just fine with 5 items.
Thanks,
Best
Edit:
I tried a "cancel" it showed a message "Canceled" but it is still struglling stoping the script now:
The script is still running (while nothing really happening).
Its as if Visual Code, .. broke.
Not sure what to do to prevent this, while keeping being able to treat the project item 1000 times and adding it 1000 times.
(edit2: added performances tag aswell)
Copy link to clipboard
Copied
Please describe (from a user's perspective) the workflow, in which your script needs to import thousands of items into the project, then add each of those projectItems(?) to a sequence, thousands of times...?
Copy link to clipboard
Copied
(rewrting)
Copy link to clipboard
Copied
What was observed in the logs?
Observation in Premiere: Nothing, not a single item added.
Note: Items are actually added normally with no probelm, if its a loop of 5 items.
Waiting does not solve the problem, CPU and GPU are not at 100%, again GPU I have is powerful.
Extra note: I tried canceling instead of continuing running the script once (when the window pops up asking me what to do), and visual closed its main window, and when I opened it again I had lost my "workspace", its as if its closed.. abnormlly, I had to re find my workspace. (Visual ALWAYS open on your last workspace, but not this time).
Copy link to clipboard
Copied
I still don't understand why it would ever be desirable to add thousands of projectItems, then create thousands of trackItems...
What is the user trying to accomplish, by using your script?
Again, no meaningful comment is possible without your ExtendScript code.
It doesn't sound like you've set any breakpoints in your code, and are instead just waiting for everything to finish; is that the case?
Copy link to clipboard
Copied
>It doesn't sound like you've set any breakpoints in your code, and are instead just waiting for everything to finish; is that the case?
Would that help? I will try it, maybe I could run the loop in 3 times (from 0 to 333, then 333 to 667 then from 667 to 1000), and betwene them use breakpoints? Interesting!
Its one single project item though! (And I make multiple tracks item from that single project item, that's why I asked at beginning if it's better to make "subclips" of that single project item, but I am worried it would worse for performance as it creates.. new projects item (and possibly new files in window explorer?))
Copy link to clipboard
Copied
> Would that help?
Yes, in that it would show you exactly what line of script code is causing the problem.
> Its one single project item though!
Earlier, you said your script was importing thousands of project items. I'm glad to hear that's not the case.
Creating subclips before creating trackItems is not necessary.
Copy link to clipboard
Copied
Ok thank you I will try that,
But since the program works with 5 items, I think it's a question of performances, I mean there is not a particular piece of code NOT working whenits only 5 tracks added to the tracks.
So either visual or PPRO or both being overwhelmed once i reach a THRESHOLD of commands?
Is there a limit to the API actually? That's one question I should have asked from the beginning!
Maybe That's the problem?
I am at MORE than 1000 commands btw, maybe I might have reached some "limit" put on the API.
As for project item(s)
I think my text might have been confusing as I indeed mentioned the word hundrends of 1000 but that was for the track items only.
>Creating subclips before creating trackItems is not necessary.
Noted!
Copy link to clipboard
Copied
> So either visual or PPRO or both being overwhelmed once i reach a THRESHOLD of commands?
Step through your code in the debugger, and you'll know what line of the script causes problems. I doubt VSCode is a bottleneck.
> Is there a limit to the API actually?
No.
Copy link to clipboard
Copied
Thanks,
Ok I got back to it, and I had the feeling I could retry it without adding breakpoints,
Why this feeling? because this time I did not have items overwriting others. Everything separate. Maybe that helped A LOT, somehow, in the speed, processing, safe to say it indeed helped, because the script is running and no error window popping up saying "too long to respond do you wish to abord" type of message.
However, I would like to continue exchanging about this, in case it happends again, and also to help increase performance.
Copy link to clipboard
Copied
>...as if visual was more late for the logs than PPRO for executing the commands. What do you think of that?
I think that software applications should perform the actions they log, before logging them. 🙂
>would you know by any chance if it's possible to have breakpoints inside a for loop that activates only every xx iterations, instead of every single iteration ?
Yes, conditional breakpoints are possible.