Page 1 of 1

Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 3:10 pm
by bwolf88
Hi guys !

I want to import some files into moho document and place by defferent categories (folders, for example: Characters, Audio etc.). The problem is: I can't find in scripting references how to create folder in current document library and move imported files into.

So how can I do this ?
Thanks.

Re: Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 5:06 pm
by Víctor Paredes
I think what you are looking for is in the menu File -> Gather Media...

Re: Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 6:21 pm
by bwolf88
Víctor Paredes wrote: Mon Aug 23, 2021 5:06 pm I think what you are looking for is in the menu File -> Gather Media...
I didn't quite understand what this functionality does.
What I need is: by scripting, after file importing in document library (image below), creating some category folder in this library (Image, sound, etc.) and put the file reference into this category folder.

For example this "download.jpg" put into [Untitled.moho->Images] folder

Image

Re: Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 7:04 pm
by synthsin75
Since there is no scripting access to the Library, Victor's suggestion is probably the closest.

File>Gather Media collects all the referenced files in the document and puts them in Images, Audio, etc. folders with the Moho file.
To speed this up, enable Edit>Preferences>Documents tab>Open and switch to new file after Gather.

Then you can just File>Gather Media and add to the Library.

Re: Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 8:08 pm
by Greenlaw
FYI, this issue might be fixed by now but double-check that Moho project file size after Gather isn't unusually huge. If it is, just resave it. If the file size seems correct, never mind. :)

The problem back then was that compression wasn't being applied to the Moho file after Gather; resaving the file compresses it. I think this issue may have gotten fixed but it's been a long time since I last used Gather so I'm not sure. This is more of an issue when you need to send somebody the gathered files, or if you have very limited diskspace.

Re: Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 8:22 pm
by Hoptoad
I used Gather Media for the first time a couple days ago and it worked like I had expected. It made a new folder, and in that folder was a folder called Audio with the audio files duplicated, a folder called Images with the image files duplicated, the relevant .moho file, and a text file called Bill of Materials which listed all the filed that had been gathered. I had to compress it myself, Moho didn't do that.

Re: Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 8:42 pm
by synthsin75
Hoptoad wrote: Mon Aug 23, 2021 8:22 pm I had to compress it myself, Moho didn't do that.
Dennis was talking about the Moho file itself, not the folder of all the assets. A Moho file is already a compressed archive file, containing the JSON Moho file and thumbnail image. If Gather doesn't compress all the whitespace in the JSON, the file can be a lot bigger.


EDIT: Just checked, and Moho still isn't compressing the Moho JSON for Gather. So if you have Moho automatically opening the gathered file, you'll want to immediately save it again to compress the file size.

Re: Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 9:47 pm
by Hoptoad
Oh, okay. Immediately save, to make a smaller file. Got it. Thanks.

Re: Moho document library: create folder and move existed imported file into

Posted: Mon Aug 23, 2021 10:46 pm
by Greenlaw
Thanks for checking. It was probably one of the things that got fixed in 13.0 and then lost in the 13.5 reboot. I'll report it.

Re: Moho document library: create folder and move existed imported file into

Posted: Tue Aug 24, 2021 12:24 am
by synthsin75
Greenlaw wrote: Mon Aug 23, 2021 10:46 pm Thanks for checking. It was probably one of the things that got fixed in 13.0 and then lost in the 13.5 reboot. I'll report it.
Although it is nice to have some way to view the uncompressed file, without having to jump through Python to beautify it.

Re: Moho document library: create folder and move existed imported file into

Posted: Tue Aug 24, 2021 6:26 pm
by Greenlaw
Some 3D and compositing programs I've used give you the option to save compressed or uncompressed, and let you set the default behavior for how it saves.

Maybe Moho can use this feature?

Re: Moho document library: create folder and move existed imported file into

Posted: Wed Aug 25, 2021 8:21 am
by davoodice2
last lime I use gather media it broken my project. Moho did not know the path of any of the files, even when I was redirecting and saving, and the same thing happened again. Until I had to delete every folder and file I had created in the library to fix the problem.

Re: Moho document library: create folder and move existed imported file into

Posted: Wed Aug 25, 2021 4:02 pm
by synthsin75
davoodice2 wrote: Wed Aug 25, 2021 8:21 am last lime I use gather media it broken my project. Moho did not know the path of any of the files, even when I was redirecting and saving, and the same thing happened again. Until I had to delete every folder and file I had created in the library to fix the problem.
Sounds like user error. May not switching to the gathered file, not moving it by its containing folder, etc..