Post Process - truePlay

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.

Post Process - truePlay // Scriptorium

1  |  

Post by trueBlue // Nov 15, 2006, 11:21pm

trueBlue
Total Posts: 1761
pic
1.) Why is it that I can not set default values in this script?

The Add advanced handlers button is not working in this script.
I have also imported an OnDefaultValue script from a working version and modified it but it will not work. I did get the two Boolean to work but not the number attributes.

2.) Would any Caligari developers be willing to share the command to open the PostProcessing node?

// Name: Post Process - truePlay
// Author: David A.Egan (trueBlue)
// Date: November 2006
//Purpose: Enables a trueSpace7 user to change and save Post Process settings to truePlay scene.
function Execute(params)
{
SuperSampling = params.conValue('SuperSampling'); //Boolean
Bloom = params.conValue('Bloom'); //Boolean
Bloom_intensity = params.conValue('Bloom intensity'); //Number
Highlight_intensity = params.conValue('Highlight intensity'); //Number
Highlight_Threshold = params.conValue('Highlight Threshold'); //Number
Scene_intensity = params.conValue('Scene intensity'); //Number
Bloom_quality = params.conValue('Bloom quality'); //Number
Bloom_downsample = params.conValue('Bloom downsample'); //Number

if (Node.Exists("/Project/Windows Manager Space/Frame Window/PostProcessing"))

Node.Value(
"/Project/Windows Manager Space/Frame Window/PostProcessing",
"SuperSampling") = SuperSampling
Node.Value(
"/Project/Windows Manager Space/Frame Window/PostProcessing",
"Bloom") = Bloom
Node.Value(
"/Project/Windows Manager Space/Frame Window/PostProcessing",
"Bloom intensity") = Bloom_intensity
Node.Value(
"/Project/Windows Manager Space/Frame Window/PostProcessing",
"Highlight intensity") = Highlight_intensity
Node.Value(
"/Project/Windows Manager Space/Frame Window/PostProcessing",
"Highlight Threshold") = Highlight_Threshold
Node.Value(
"/Project/Windows Manager Space/Frame Window/PostProcessing",
"Scene intensity") = Scene_intensity
Node.Value(
"/Project/Windows Manager Space/Frame Window/PostProcessing",
"Bloom quality") = Bloom_quality
Node.Value(
"/Project/Windows Manager Space/Frame Window/PostProcessing",
"Bloom downsample") = Bloom_downsample
// OnDefaultValue
// Called to set default value for specific connector
function OnDefaultValue(params)
{
conName = params.Param('conName');
switch (conName)
{
case'SuperSampling':
params.Param('vtData') = false
break;
case'Bloom':
params.Param('vtData') = false
break;
case'Bloom_intensity':
params.Param('vtData') = 0.300
break;
case'Highlight_intensity':
params.Param('vtData') = 1.500
break;
case'Highlight_Threshold':
params.Param('vtData') = 0.900
break;
case'Scene_intensity':
params.Param('vtData') = 0.700
break;
case'Bloom_quality':
params.Param('vtData') = 4
break;
case'Bloom_downsample':
params.Param('vtData') = 2
break;
}
}
}

Post by Norm // Nov 16, 2006, 7:38am

Norm
Total Posts: 862
pic
divide and conquor.

Try single parameter instead of all of them?

Makes it easier to troubleshoot (and faster) :)

Post by trueBlue // Nov 16, 2006, 11:29am

trueBlue
Total Posts: 1761
pic
Thanks Norm for this information.
Could you give me an example on what you mean?
I updated the post below to show how I am trying to set the Default values.
Again SuperSampling and Bloom do work but nothing below that.

Post by stan // Nov 16, 2006, 12:38pm

stan
Total Posts: 1240
pic
trueblue..the name of the [post process]node you are using must be wrong or it would show up on a recursive search..which I have tried, and with many name variations and even a wildcard
it found the "D3DWindowedRT' node just fine

Post by Norm // Nov 16, 2006, 1:42pm

Norm
Total Posts: 862
pic
path info you are using in your code does not match what i have here so not sure what or how you are getting your path. Might be the problem.

Post by trueBlue // Nov 16, 2006, 1:58pm

trueBlue
Total Posts: 1761
pic
Did you notice that this was for truePlay Norm?
Enclosed screen grab is the Post Process panel that shows in truePlay.
Text copied from the Rosetta.log for truePlay:

UserInterface.OpenPreferencesPanelView('{D3BADABB-62CC-4450-9713-B2046E8FD70F}', '','/Project/Windows Manager Space/Frame Window/PostProcessing',3);

Post by stan // Nov 16, 2006, 3:05pm

stan
Total Posts: 1240
pic
actually your code works [but with an error message] once the post process trueplay panel is open..only then does a recursive search find it too..you may have to get that panel to open first in your code..
if that PP panel is closed neither work..

Post by trueBlue // Nov 16, 2006, 11:19pm

trueBlue
Total Posts: 1761
pic
Thanks for that little tidbit stan. I think all I need now is the command to open and close the PostProcessing node. Here is an example scene demonstrating what you found. In the final solution it is not my intent to have the panel I made to open in truePlay. But to activate the settings that the user wants when the scene loads into truePlay and also trueSpace7.

Post by Norm // Nov 17, 2006, 6:05am

Norm
Total Posts: 862
pic
From what I understand, Command Scripts can not use "OnDefaultValue()" type scenario. Only standard script can use, which is why the function is not available on adv handler scenario in a Command script.


Good news is this is not so in ts7.5.

Post by trueBlue // Nov 17, 2006, 11:47am

trueBlue
Total Posts: 1761
pic
Thanks Norm I have been tearing my hair out on this one. But I did find a part solution which is a button with the folowing:

Node.Value('%THIS_NAME%/', 'SuperSampling') = 0
Node.Value('%THIS_NAME%/', 'Bloom') = 0
Node.Value('%THIS_NAME%/', 'BloomIntensity') = 0.3
Node.Value('%THIS_NAME%/', 'HighlightIntensity') = 1.5
Node.Value('%THIS_NAME%/', 'HighlightThreshold') = 0.9
Node.Value('%THIS_NAME%/', 'SceneIntensity') = 0.7
Node.Value('%THIS_NAME%/', 'BloomQuality') = 4
Node.Value('%THIS_NAME%/', 'BloomDownsample') = 2

What is great about writing it this way '%THIS_NAME%/' is that if a user renames the panel it will still works.
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