Closed crydrk closed 3 years ago
Hi!
Your problem is coming from the formating of the path. On windows paths should be written using backslashes (\
) instead of the usual slashes (/
).
If you use simple slashes in python some APIs won't properly work and it is the case for pymiere.
You can see an indepth explanation with some solutions here : https://medium.com/@ageitgey/python-3-quick-tip-the-easy-way-to-deal-with-file-paths-on-windows-mac-and-linux-11a072b58d5f I would personnaly use the "Old solution" from the above article
If you want a quick and (really) dirty fix, you can add this line after line 61 (after for image in downloadedFiles:
) :
image = os.path.normpath(image)
It will convert your simpleslash path in a backslash windows compliant path.
Let me know if you have any other issues!
Ah, thank you very much. Hoping this response doesn't reopen the ticket, but want to give thanks. ~Corey On Tuesday, March 23, 2021, 02:05:03 PM PDT, Quentin Masingarbe @.***> wrote:
Closed #31.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I'm trying to move imported images into a sequence, and am having problem with this path:
C:/Users/Corey/Desktop/testFolder/download21/0.jpg
When replacing the path in the example code with this new path, I get the error below. This same error happens whether I use the example code or my full code even further below. Any thoughts?
Traceback (most recent call last): File "C:/Users/Corey/Documents/OrganizedDocs/python/PremiereScripts/downloadFilesAndCreateSequence.py", line 17, in <module> project.activeSequence.videoTracks[0].insertClip(items[0], time_from_seconds(0)) File "C:\Python27\lib\site-packages\pymiere\objects\premiere_objects.py", line 3764, in insertClip self._check_type(clipProjectItem, ProjectItem, 'arg "clipProjectItem" of function "Track.insertClip"') File "C:\Python27\lib\site-packages\pymiere\core.py", line 209, in _check_type raise ValueError("{} shoud be of type {} but got '{}' (type {})".format(name, cls, obj, type(obj))) ValueError: arg "clipProjectItem" of function "Track.insertClip" shoud be of type <class 'pymiere.objects.premiere_objects.ProjectItem'> but got 'undefined' (type <type 'str'>)
My code below if it helps, but as I said the path itself is the problem, since I tried it manually with the example code. [edit] Apologies, a quote somewhere is messing up the code formatting here in github.