Hi,
Does anybody have an idea how to save once loaded video files (for texturing a 3D object) in the pd patch so that I don't have to load it again everytime I reopen the patch? The same question arises with values of number boxes, is there any possibility to save them in the patch?
hopefully waiting for someone to respond
greetz PidAid
-
Saving video files in the pd patch?
-
you can have default values for number boxes or any other controls quite easily. use the loadbang object.
e.g. for a number box, have this going into its left inlet, where x is whatever number:
[loadbang]
|
[f x]
|
[numberbox]
this approach, however takes up some space and get be annoying. you can 'hide' the initializing objects this way: in the properties for the number box, enter in a name for the 'receive value' property, such as 'number1' then, somewhere else in your patch put this:
[loadbang]
|
[ ; (
[ number1 x ( again, x is the number you want to use as a default.,
so now you're saying, "this is great, but i want it to remember whatever it was set to when i saved the patch...not some default value..." . this is where things can get a little tricky....give me some time and i'll make a sample patch that shows how to do this. hopefully i'll have something posted here in the next couple hours.
hilbert~ -
as promised...a little tutorial on setting default values and restoring saved values in a pd patch. i hope this helps.
the patch is at [url=http://www.geocities.com/z_fron/saving.zip ]http://www.geocities.com/z_fron/saving.zip
sorry it's a zip file, but geocities won't let you upload .pd files for some reason.
pidaid, let me know if you need help applying this to your videos. i am not quite clear on what you mean you want to save the file names or save the actual video in the patch. saving filenames and having them loaded automatically when you start your patch shouldn't be a problem, but there is no way to save the video in the patch file (.pd files just contain text.) although....(this is pretty farfetched), you could save an image or video with in a patch if there were a way to convert the image or video into an array. but then you'd have to convert it back to a video and it would really be a waste of time and by no means useful or necessary or benificial in anyway that i can see.
cheers,
hilbert~ -
Hi,
First, thanks for the information and the tutorial. It was quite useful for me. What I ment with saving video, is as you said to save the filename into the patch so that it loads automatically as soon as I open the patch. I tried this with the method that I used for making default values of number boxes. Instead of a number I just wrote in the path information of the videofile and sent it to the Browser but it didn't work. So, how does it work that the video loads automatically?
greetz PidAid -
what are you using to load the video? i take it you are using gem and using pix_movie or pix_film, but what are doing to open the files? are you sending a message such as [open ../../movie.avi ( to the pix_film object? or are you using the [openpanel] object? if you are simply using message boxes with the command 'open filename', you should just be able to send a loadbang to the message and the movie should load automatically. if you are using the openpanel object, run it's output into a series of messages like this:
[0]
|
[openpanel]
|\
| \[open $1(
| |
| [ s to-pixfilm]
|
[set open $1 (
| [loadbang]
| /
| /
[ ( <---blank message box
|
[r to-pixfilm]
|
[pix_film] etc
that should do it.