PDA

View Full Version : Free Integrated Lightwave File Viewer



Ryan Roye
04-27-2013, 10:56 AM
While this isn't the most graceful of methods to get a file viewer into Lightwave and it isn't 100% perfect, it does serve its function and makes browsing through files visually much more convenient and straightforward. To put it in simple terms, I took a freely available model viewer (BCView) and bridged it with Lightwave using Autohotkey. My bridge program is totally free and open source; use/modify it however you want.

Here's a demo video on it:


http://youtu.be/tps916BTGIY

Download Lightwave FileViewer here (http://www.delura.tanadrine.com/image_manualupload/LW_FileViewer.zip). The program is compiled into an .EXE file, so autohotkey isn't required.

ZIP contains program files, source code (you can use notepad to view the .ahk file), and usage info.

COMPATIBILITY: I have only tested this in Windows 7 using Lightwave 9.6 (64-bit), I know it won't work on windows XP (due to the slight differences in dialogue class names), and it is untested on windows 8.

If the program doesn't work, let me know what version of windows and Lightwave you are using... no promises, but I will try to fix things over time.

evenflcw
04-27-2013, 11:09 AM
Very cool and clever advanced use of AHK. Bcview is an old goody. I was not aware it had received texture support. Did you have any contact with the creator?
Thanks.

Ryan Roye
04-27-2013, 11:16 AM
Very cool and clever advanced use of AHK. Bcview is an old goody. I was not aware it had received texture support. Did you have any contact with the creator?
Thanks.

Texture support is almost the same as layout now... it'll show you textures, bump maps, and even various basic shaders (lines, smooth/flat shade, radiosity), but probably nothing more complex than that. Textures can be somewhat sluggish to load even on a fast system, so that's why I recommend leaving textures off when browsing around and enabling them when you need detail. I know for certain procedurals aren't supported and will just display as flat textures. Again, I was only made aware of BCview via Erikal's post... its possible he provided a link to an updated version which added texture support. Also, subpatching is possible with BCView as well.

To answer your question, I haven't managed to make contact with the creator. Hopefully they won't mind that I've bundled their program and bridged it with Lightwave.

If I were a bit more programmer savvy I could probably make the program a lot more snappy and less messy code-wise, but I did what I could :)

geo_n
04-27-2013, 01:59 PM
running the ahk gives me error in line 166. Program will exit
running exe bcviewer pops up but not seeing any preview from model.

win 7 and win 8, lw 9.6 and lw 11.5

Ryan Roye
04-27-2013, 02:37 PM
That's interesting...

To narrow things down, are you able to load models using BCView by itself? (Open the program, hit "O", and pick an object).

Also, check to see if dragging the file to a window once will cause the script to trigger active. In my tests over here, I realized that BCView always points to the last file opened, so if that file doesn't exist it might confuse the program. Let me know if this works, it'll help me narrow down the error.

EDIT: I think I figured it out... but I'll have to brainstorm how to fix the issue. Dragging any object to the BCview window once fixes the issue permanently, but I'd rather the user not have to even worry about that. I may have to make a "firstrun?" variable that writes to BCView's text file and references a dummy object file to keep the error from occuring.

Ryan Roye
04-27-2013, 10:37 PM
File download linked above has been updated:

- FIX: added a "firstrun" section to the code which will insert the file path of a pre-set .lwo file in the directory the user extracted the zip to. This allows the program to have a valid directory out of the box, and hopefully it eliminates the need to do the one-time click/drag activation.

geo_n
04-28-2013, 12:41 AM
Yep it runs fine now. One problem is textures are not showing unless they're in the same folder as the lwo file. My folder structure follows the conventional lw directory so its scene,objects,images, etc. BCview doesn't seem to be able to read the path of the textures from the lwo like modeller does.

Fadlabi
04-28-2013, 02:21 AM
Some file can't open and there's a message: exceeded limit # of polygons

Doctor49152
04-28-2013, 03:10 AM
you need to go into the prefs and up the # of polys. Since BCview is REALLY old it has a low # of max polys. I just went into the prefs and added 2 0's onto the end

Fadlabi
04-28-2013, 03:20 AM
Thanks, Doctor49152

Ryan Roye
04-28-2013, 07:39 AM
you need to go into the prefs and up the # of polys. Since BCview is REALLY old it has a low # of max polys. I just went into the prefs and added 2 0's onto the end

Oops, when I made the update I forgot to re-insert the initial poly limit settings. I re-uploaded the file so that it defaults to 800,000 polys (bcview's maximum)


Yep it runs fine now. One problem is textures are not showing unless they're in the same folder as the lwo file. My folder structure follows the conventional lw directory so its scene,objects,images, etc. BCview doesn't seem to be able to read the path of the textures from the lwo like modeller does.

Have you tried pointing BCView to the file paths that contain your textures via the f1 menu where it says "Texture Image File Path"?

As for the autohotkey line error mentioned earlier, it is possible that the different versions of it floating around could the culprit (AHK vs. AHK_L). I haven't done any investigation into that yet though.

geo_n
04-28-2013, 10:37 AM
Oops, when I made the update I forgot to re-insert the initial poly limit settings. I re-uploaded the file so that it defaults to 800,000 polys (bcview's maximum)



Have you tried pointing BCView to the file paths that contain your textures via the f1 menu where it says "Texture Image File Path"?


No, but I'm sure that would work if I manually point bcview to the image folder. This is more a problem of lwo format.
The same thing happens when using deep exploration, which is another 3d viewer. Textures have to be in the same folder as the lwo which is a shame as its not standard practice.

PeT
04-28-2013, 11:31 AM
you need to go into the prefs and up the # of polys. Since BCview is REALLY old it has a low # of max polys. I just went into the prefs and added 2 0's onto the end
I can't open BCview.exe to change the prefs,
the programm-window shuts down in the same moment
here on a win vista / 32 / lw 11.5 system ..

Ryan Roye
04-28-2013, 07:11 PM
I can't open BCview.exe to change the prefs,
the programm-window shuts down in the same moment
here on a win vista / 32 / lw 11.5 system ..

If you want to use BCView by itself, make certain to close LW_FileViewer first (the magnifying glass in the taskbar). LW_FileViewer closes BCView if the load object file chooser is not present.

mikadit
04-29-2013, 05:48 AM
Very nice, thank you for sharing!

Simon-S
04-29-2013, 09:57 AM
Tried it on Windows 8 64bit with Lightwave 11.5 (32bit)...

On opening browser to load an object the bcviewer.exe auto docks to the browser window but the display only shows up as blank grey- no 3d model is displayed.

Cheers.

mikadit
04-29-2013, 10:15 AM
To use it on non english os, like italian, my case, have to change the hotkey at line 211 to a working one in the ahk file, and then use it instead of the exe. There is no matching key code for "Control + `"
^`::
Just added an other key like:

^\::

Ryan Roye
04-29-2013, 10:56 AM
Tried it on Windows 8 64bit with Lightwave 11.5 (32bit)...

On opening browser to load an object the bcviewer.exe auto docks to the browser window but the display only shows up as blank grey- no 3d model is displayed.

Cheers.

I'll give the "firstrun" code another look. If it continues to be a problem, I will have the program display a popup box or a tooltip the first time it is run instructing the user to click-drag at least one file so that the file locations in BCview can be propagated. For some reason, my script will not work if BCview has no initial reference filepaths.

Ryan Roye
04-30-2013, 04:13 PM
This seems like a waste of space, I feel compelled to put something here in the next update. Would anyone find it useful to have a set of buttons that navigate you to folders of your choosing (with a corresponding "S" button to save location)? Or is there a different function that would be handy to have here?


http://www.delura.tanadrine.com/image_autoupload/whattoputheretn.jpg (http://www.delura.tanadrine.com/image_autoupload/whattoputhere.jpg)

nickdigital
04-30-2013, 04:17 PM
Would anyone find it useful to have a set of buttons that navigate you to folders of your choosing (with a corresponding "S" button to save location)?

That would be handy. ImageFox used to have location favorites. What you're describing sounds just like that.

nickdigital
04-30-2013, 04:27 PM
I'm just now playing with this. The idea is definitely cool. My assumption is that BCView is refreshing on every mouse click? Every time I click on another folder to navigate it looks like BCView is refreshing with it's file dialogue box. Also the speed at which it refreshes is kinda hit and miss. I'll have a .lwo file selected and it'll be showing my last selection for a few seconds before updating.

I like the idea. It would be nice if NewTek had an integrated solution.

Ryan Roye
04-30-2013, 06:56 PM
I'm just now playing with this. The idea is definitely cool. My assumption is that BCView is refreshing on every mouse click?

That is correct. Whenever you click or use the arrow keys, LW_FileViewer is checking to see what you have selected, and it issues the following commands to BCView's window directly:

-Press "o"
-Insert path of file selected in Lightwave
-Spacebar to "load" button
-Force focus back onto Lightwave file chooser via loop function

If I could find a way to invoke some kind of non-dialogue way of making BCview change the model being displayed (IE: like how it acts when click-dragging or using the native next/prev model commands in BCView), it would make things much faster and reliable. The "open" dialogue steals focus every time in Windows 7 (it didn't in windows xp) which is probably where some problems stem from. BCView's developer made everything hotkeyable... so that definitely helps with development as well.

Also, I think I have a fix for the problem of BCView re-loading objects when clicking elements other than whats in the file chooser such as resize handles/scrollbars... I'll keep improving/fixing this program as time goes on.

And yes, I would not mind in the very least if Newtek rendered this program obsolete!! :D


EDIT: I did some checking, and I may be able to almost eliminate the old method of checking for files to load and replace it with something way more efficient. It depends on how easy it is to get a file's position in an alphabetical list based on a user's highlighted selection.

BCView has a cancel load button, and it performs all of its commands in sequential order. This means that I could have autohotkey rapidly open/cancel objects until it reaches the file that is supposed to display. Initial tests are very promising and near-instantaneous!

Hail
05-02-2013, 03:39 AM
Oh nice.. This will be very handy.
Thanks for sharing this, Chazriker

jwiede
01-26-2015, 07:19 PM
(nvm -- answer was already present in archive)

tonyrizo2003
01-26-2015, 11:47 PM
very cool!! thanks !!