Where is the render command?

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Where is the render command? // Archive: Tech Forum

1  |  

Post by PrimMac // Mar 3, 2006, 3:14am

PrimMac
Total Posts: 78
Hello all,


I am new to the forums and all things TS7, though I have used 6.6. I have been looking at the Link Editor's functionality and the VBScript/JScript documentation. There is something I would like to ask, for those who have already done some scripting? I wanted to make an object with a quick render button, so I wouldn't have to worry about clicking the small icon on top of the screen. However, I can't find anywhere in the documentation some command to render the scene. Something like "Scene.Render()". Is there such a command?

Post by Norm // Mar 3, 2006, 8:13am

Norm
Total Posts: 862
pic
Yes you can access this. Is easy enough once you find the info you need. It is not documented as far as I can tell. When in doubt ask the dev guys. Tomas is excellent in this regard as he explains that if you move the Link Editor up to the root level, you see an object named "Toolbar Prototypes Encapsulator" .... Marvin the Martian voice.


Inside this encapsulator you see what I see in attached image. You drill down and have to figure out what is what, but low and behold, you will find:


tsTopBar/Render Current Object/Render Scene, 1


Edit the interface and expand the "command" text. You will find:


tSBridge.SuggestTSStateByAlias("SV_RENDER_RENDER_SCENE")


So I copied this and called up a jscript command object (attached), and programmed its start button with the script text above. Voila.


Yay Tomas :banana:

Post by PrimMac // Mar 3, 2006, 8:46am

PrimMac
Total Posts: 78
Thanks for the info, Norm! This is great. I was able to import the provided script, but I can't see its code. I think I will have to read a bit about jScript Objects in the Manual. In any case, I did manage to access the code on the Prototypes Encapsulator.


It would be great if these functions were documented so that users could add their own custom functionality.

Post by Norm // Mar 3, 2006, 1:54pm

Norm
Total Posts: 862
pic
The only code is for that start button.

If you enter edit mode on the interface/panel, select the button, right-click the button to edit its properties and you will find what you are looking for.


I sort of led you to the land of milk'n'honey there PrimMac. If you understand where you are you can actually flesh out most button commands in the toolbar encapsulator. The code would work equally well in script code/Script Editor. So hope you can play with them a bit. I never really knew about these either.


Still scratching the surface :)

Post by PrimMac // Mar 3, 2006, 5:17pm

PrimMac
Total Posts: 78
You're right, Norm. I've checked out a few other buttons. The tsBridge object is very interesting. I was trying out a method from it called OpenTSWindow and I got a new window to open, though it was blank. If I knew what arguments to pass to this method, I would be able to use it effectively.


Looking at what I've seen so far, it may be possible to extends TS's functionality. For example, I think it would be possible to create a "Pause Render" button.


Another feature I would like to experiment in creating is an exporter for real-time renders. So far, from what I've seen, it is not possible to export real-time renders, even though they look astonishing! Those who have posted real-time renders here have probably used Print Screen to "export" there pics.


But you're the expert here, Norm. What do you think? Can such things be done?

Post by mrbones // Mar 3, 2006, 5:32pm

mrbones
Total Posts: 1280
pic
Good Idea, I think it can be done. :)




Another feature I would like to experiment in creating is an exporter for real-time renders. So far, from what I've seen, it is not possible to export real-time renders, even though they look astonishing! Those who have posted real-time renders here have probably used Print Screen to "export" there pics.


But you're the expert here, Norm. What do you think? Can such things be done?
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn