Page 4 of 4

Re: Add custom commands to context menu ?

Posted: 26 Apr 2015 20:04
by bdeshi
CookieMonster wrote:Can the -o option be renamed to One_Level
-m option be renamed to MIP_MAP_Levels
-r option be renamed to RIP_MAP_Levels ?
The tooltip popup for out file pattern, disappears too quickly, can that stay up for a longer duration ?
You can also move the OK button to the opposite side of where the close button is ;-)
Done. (outfile pattern hint: click the "i" after the textbox)
exrmaketiled.zip
(2.58 KiB) Downloaded 131 times
btw, now you can either rewrite the exepath into the script file OR BETTER, save it as a permanent variable $P_exrmaketiledexe. Paste this into the adressbar of XY:

Code: Select all

::perm $P_exrmaketiledexe = "path\to\exrmaketiled.exe"; //replace dummy path with correct path
enable Tools > Configuration > Refresh, Icons, History > Scripting > Remember permanent variables. This way you won't have to edit the script file every time I make a change and post it anew.
Can the script be executed, if and only if I have an EXR file selected
I made sure it stops if no EXR files are selected, but
and only by right clicking on an empty part of the selected window pane in XY, instead of selecting the EXR file and going to the script in the Custom Toolbar menu ?
I don't want to talk about that. Too much trouble (for me). I suggest you use this script: http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=13831 . (Read that discussion for learning how to make it work)
Still, if clicking a button feels too slow, you can also assign a keyboard shortcut to the script.
Open Menu > User > Manage Commands > Run Script category > new command , paste script into "script" box after pressing Edit, then "Assign Keyboard Shortcut".
A output file pattern is helpful, except if I enter in a relative path, and that path doesn't exist can it prompt to make that folder ?
I think the openexr program takes care of creating target folders, but I don't know. Can you try?
The script works well, makes it more efficient then loading the command prompt, moving the file to the location where the EXR tools exist, entering the command .... etc etc etc.
thanks! :)

Re: Add custom commands to context menu ?

Posted: 27 Apr 2015 00:54
by CookieMonster
btw, now you can either rewrite the exepath into the script file OR BETTER, save it as a permanent variable $P_exrmaketiledexe. Paste this into the adressbar of XY:

Code: Select all

::perm $P_exrmaketiledexe = "path\to\exrmaketiled.exe"; //replace dummy path with correct path
enable Tools > Configuration > Refresh, Icons, History > Scripting > Remember permanent variables. This way you won't have to edit the script file every time I make a change and post it anew.
I don't understand what this does, can you explain a little more ? :)
I think the openexr program takes care of creating target folders, but I don't know. Can you try?
C:\5\tiledimages\*_tiled.?

Should that for the outfile pattern not save my EXR file with a file name as <filename>_tiled.exr in the folder labeled 5 ?

If so it's not working, I tried a relative path as well hoping it would create a folder on my desktop called "tiledimages" and placed the tiled exr file created by the script that exact folder, that didn't work either.

tiledimages\<filename>_tiled.exr

I realized that the script made need the absolute path, which would be :\users\<user name>\etc\etc. If I wanted to create a folder on the desktop for the current user which is logged in can you create a pattern labeled simply desktop and therefore the folder will be created on the desktop with the EXR files within the folder ?

Re: Add custom commands to context menu ?

Posted: 27 Apr 2015 07:07
by bdeshi
this version should create target paths before running the program.
exrmaketiled.zip
(2.64 KiB) Downloaded 128 times
CookieMonster wrote:[...]I don't understand what this does, can you explain a little more ? :)
Remember the first time I posted this script and I asked you to open it in a text editor and add the path to exrmaketiled? You would have to do this every time I post a new version of this script.
But if you do that $P_exrmaketiledexe permanent variables stuff, then you won't have to edit the script manually anymore. Got it?

C:\5\tiledimages\*_tiled.?
it didn't work? Maybe the folder "C:\5\tiledimages\" did not exist. Anyways, try with this version of the script again please.
I tried a relative path as well hoping it would create a folder on my desktop called "tiledimages" and placed the tiled exr file created by the script that exact folder, that didn't work either.
tiledimages\<filename>_tiled.exr
You said you use paths like this: tiledimages\<filename>_tiled.exr. This is not suggested as a relative path to anywhere, not even desktop. (but actually it creates a tiledimages folder in current path)

Firstly, begin relative paths with a ".\" like this (but there are other possibilities): .\tiledimages\*_tiled.exr. This will create a tiledimages folder in each input file's location, and output there.
.\ means the samw location of input file, ..\ means parent (of previous path component), so .\..\ mean parent folder of .\, or parent folder of input file's location.

Secondly, why did you think that would create folders in desktop? Use a pattern like this to output to desktop: Desktop\tiledimages\*.? -- this will create output files with the same name as input in a tiledimages folder on the desktop.
(and thirdly, I sincerely hope you didn't actually use "<filename>" literally)

Re: Add custom commands to context menu ?

Posted: 28 Apr 2015 20:00
by CookieMonster
SammaySarkar wrote:this version should create target paths before running the program.
exrmaketiled.zip
CookieMonster wrote:[...]I don't understand what this does, can you explain a little more ? :)
Remember the first time I posted this script and I asked you to open it in a text editor and add the path to exrmaketiled? You would have to do this every time I post a new version of this script.
But if you do that $P_exrmaketiledexe permanent variables stuff, then you won't have to edit the script manually anymore. Got it?
I understand, very smart ! :)

C:\5\tiledimages\*_tiled.?
it didn't work? Maybe the folder "C:\5\tiledimages\" did not exist. Anyways, try with this version of the script again please.
I tried a relative path as well hoping it would create a folder on my desktop called "tiledimages" and placed the tiled exr file created by the script that exact folder, that didn't work either.
tiledimages\<filename>_tiled.exr
You said you use paths like this: tiledimages\<filename>_tiled.exr. This is not suggested as a relative path to anywhere, not even desktop. (but actually it creates a tiledimages folder in current path)
The sub-folder "tiledimages" was created within the main folder of 5. Except the EXR file I had selected, which I gave the _tiled suffix in the script wasn't created in the subfolder of "tiledimages" ? I'm wondering if maybe, the variable you told me to setup in XY didn't work ?
Firstly, begin relative paths with a ".\" like this (but there are other possibilities): .\tiledimages\*_tiled.exr. This will create a tiledimages folder in each input file's location, and output there.
.\ means the samw location of input file, ..\ means parent (of previous path component), so .\..\ mean parent folder of .\, or parent folder of input file's location.
You don't recommend I use the method posted in the first statement of my quote, you suggest I use the ./../ type path system when creating folders or sub-folders ?
Secondly, why did you think that would create folders in desktop? Use a pattern like this to output to desktop: Desktop\tiledimages\*.? -- this will create output files with the same name as input in a tiledimages folder on the desktop.
(and thirdly, I sincerely hope you didn't actually use "<filename>" literally)
I didn't think I would need to create folders in the desktop, if I wanted to create a folder on the desktop and place a tiled image in that folder, I didn't know how you would do this, that's why I mentioned a few methods. Now that you have explained that I can simply use Desktop\ for creating a folder on the desktop that is the information I wanted to know. There is one thing I realized if I use the path Desktop\tiledimages\<filename>_tiled.exr, what happens on my end is a folder called "desktop" is created, within that folder is a sub-folder called "tiledimages", instead of only a folder called "tiledimages" created on the desktop, there is, literally a desktop folder created ?

You take me for an idiot :( :eh: Of course I didn't use <filename> literally, that was a placeholder, common :)

Re: Add custom commands to context menu ?

Posted: 28 Apr 2015 20:16
by bdeshi
CookieMonster wrote:if I use the path Desktop\tiledimages\<filename>_tiled.exr, what happens on my end is a folder called "desktop" is created, within that folder is a sub-folder called "tiledimages", instead of only a folder called "tiledimages" created on the desktop
huh, my folders are created in my real desktop folder, don't know why this doesn't work for you... :?
You don't recommend I use the method posted in the first statement of my quote, you suggest I use the ./../ type path system when creating folders or sub-folders ?
either use full paths like C:\5\tiled\ or relative paths like .\5\tiled\ but not just 5\tiled\
You take me for an idiot :( :eh: Of course I didn't use <filename> literally, that was a placeholder, common :)
Sorry to offend you!


About the no-output problem, I really should try live with some exr files. I didn't want to at first because the openEXR sample images archive was ~50 mb. But looks inevitable now. :whistle:
Stay tuned!

Re: Add custom commands to context menu ?

Posted: 29 Apr 2015 07:31
by bdeshi
This version allows variables in output path (silly me) . Only the variables that evaluate to a real full path can result to anything.
exrmaketiled.xys
(7.49 KiB) Downloaded 128 times
now,to create output in desktop use this outfile_pattern:

Code: Select all

 %desktopreal%\*_tiled.? 
%desktopreal% points to your desktop folder.


CookieMonster wrote:C:\5\tiledimages\*_tiled.?
[...]The sub-folder "tiledimages" was created within the main folder of 5. Except the EXR file I had selected, which I gave the _tiled suffix in the script wasn't created in the subfolder of "tiledimages" ? I'm wondering if maybe, the variable you told me to setup in XY didn't work ?
Well, I tried the last-uploaded xys script with two exr files, outfile pattern being C:\5\tiled\*_t.? and it worked, those output files were created, so I guess you have not defined the right path to exrmaketiled.exe. (do you see a flashing command prompt?)
Anyway, run this script to setup the absolutely correct path (paste into the addressbar and press ENTER)

Code: Select all

::perm $P_exrmaketiledexe = inputfile("%programfiles%", "exe", "choose exrmaketiled.exe");
, then try my script again.

Re: Add custom commands to context menu ?

Posted: 29 Apr 2015 14:07
by CookieMonster
When I run the xy variable I get this error;

Image

Re: Add custom commands to context menu ?

Posted: 29 Apr 2015 15:02
by bdeshi
Just run that ::perm ... one-liner exactly as it is posted. You don't have to manually add the exe path in that. The script will let you pick.

Re: Add custom commands to context menu ?

Posted: 30 Apr 2015 02:50
by CookieMonster
SammaySarkar wrote:Just run that ::perm ... one-liner exactly as it is posted. You don't have to manually add the exe path in that. The script will let you pick.
The script works well, I can save a file to the desktop, all the options are laid out well, makes me cry :) I can't think of anything that would need to change. Let me play with it a little, maybe a tweak or two I may suggest, yet, maybe not :)

Re: Add custom commands to context menu ?

Posted: 30 Apr 2015 06:44
by bdeshi
Okay, that's great news!

[don't cry! :kidding: ]