Yafaray4tS v0.9.0

LightWorks, VRay, Dribble, YafaRay and more..
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

Your code works. It was just tS being finicky. The OwnerMatrix for the camera is in some kind of unstable state. You can recreate it on any object by right click to expand the connector then delete the ExpandIn node. The fact that you don't disconnect first makes the connector value invalid/unstable.
Added a try catch to get around it.

Edit: Come to think of it maybe should add try catch for all cases where connector values are copied.
Attachments
YafaRay4tS Scene Utilities0e4e.RsObj
(121.09 KiB) Downloaded 233 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Oh cool!
I think we cross post or did you notice:
Also added the YafaaRay Light Material to you materialtoload list but it does not work
Also I made a mistake by deleting the Update YafaRay Render Node.RsObj in the YafaRay4tS Scene Utilities.RsObj that I shared with you in that scene.
That script by the way does not copy the selected Camera from the old YafaRay4tS,RsObj and tranfer it to the new one.
That looks like a tough task given the differences of the Select Camera buttons scripts. Yikes!


Edit:
If FolderForFiles is empty the Alerts do not work and I also notice an error.
Steps:
Select the Browse button and the Cancel button = empty string in FolderForFiles
Select the Process Imported Scene button
Error:
Capture.PNG
Capture.PNG (11.17 KiB) Viewed 4668 times
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 07 Aug 2018, 04:16 Oh cool!
I think we cross post or did you notice:
Also added the YafaaRay Light Material to you materialtoload list but it does not work
Also I made a mistake by deleting the Update YafaRay Render Node.RsObj in the YafaRay4tS Scene Utilities.RsObj that I shared with you in that scene.
That script by the way does not copy the selected Camera from the old YafaRay4tS,RsObj and tranfer it to the new one.
That looks like a tough task given the differences of the Select Camera buttons scripts. Yikes!


Edit:
If FolderForFiles is empty the Alerts do not work and I also notice an error.
Steps:
Select the Browse button and the Cancel button = empty string in FolderForFiles
Select the Process Imported Scene button
Error:
Capture.PNG
That error has nothing to do with FolderForFiles and I went through your steps and it behaved properly. If you share the problem scene I can look at it.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

More changes:

YafaRay4tS
changed the way the camera works and removed the code from the choose camera button.
added error processing to the camera.
added camera selection to the render to file panel
during render if camera is invalid will search for cameras at the top scene level and also inside of groups while ignoring cameras inside of lights

YafaRay4tS Scene Utilities
added copy for YafaRay4tS camera
re-added the missing script
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 07 Aug 2018, 19:49
trueBlue wrote: 07 Aug 2018, 04:16 Oh cool!
I think we cross post or did you notice:
Also added the YafaaRay Light Material to you materialtoload list but it does not work
Also I made a mistake by deleting the Update YafaRay Render Node.RsObj in the YafaRay4tS Scene Utilities.RsObj that I shared with you in that scene.
That script by the way does not copy the selected Camera from the old YafaRay4tS,RsObj and tranfer it to the new one.
That looks like a tough task given the differences of the Select Camera buttons scripts. Yikes!


Edit:
If FolderForFiles is empty the Alerts do not work and I also notice an error.
Steps:
Select the Browse button and the Cancel button = empty string in FolderForFiles
Select the Process Imported Scene button
Error:
Capture.PNG
That error has nothing to do with FolderForFiles and I went through your steps and it behaved properly. If you share the problem scene I can look at it.
I tested my steps again and I get that error.
I updated the YafarayScripts/OpenView with your code.
I selected the Offline Render Scene icon.
I tested my steps again and it works without errors.


I am guessing when YafaRay4tS adds an error, you should take a break and Render something ;)
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 07 Aug 2018, 19:59 More changes:

YafaRay4tS
changed the way the camera works and removed the code from the choose camera button.
added error processing to the camera.
added camera selection to the render to file panel
during render if camera is invalid will search for cameras at the top scene level and also inside of groups while ignoring cameras inside of lights

YafaRay4tS Scene Utilities
added copy for YafaRay4tS camera
re-added the missing script

Awesome!
Glad to see you changed how the Select Camera works.
I have noticed several times using the Choose Texture Source Folder buttton that the dialog is not showing.
I addded WindowsManager.ActivateFrame(1); to that button.

Do you mind sharing your updated YafaRaytS.RsObj and YafaRay4tS Scene UtilitiesRsObj ???
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

RC 25

bug - the YafaRay4tS scene file in the YafaRay4tS Setup library is wrong
Attachments
YafaRay4tSv090-RC-25.zip
(14.92 MiB) Downloaded 208 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

YafaRay4tS Scene Utilities
Steps
Remove YafaRay4tS from scene
Select the Process Imported Scene button
Alert "Scene does not contain a YafaRay4tS node"
I get an error.

Update YafaRay Render Node2 script:
First I tried incorporating a try/catch/error
That did not work

I think, I found a solution to this problem that I found in the Interactive Replace Tool.RsObj in the Activities - My Activities library.
Author sets a params.SetTerminationFlag();

Fix:

Code: Select all

	var template = "Yafaray Folder/YafaRay4tS";
	var Source = Space.CurrentScene() + "/YafaRay4tS";

	if(!Node.Exists(Source)) {
		System.Alert("Scene does not contain a YafaRay4tS node");
		params.SetTerminationFlag(); 
		return;
	}
	try {
//
	} catch(e) {
		System.Alert("Scene does not contain a YafaRay4tS node");
		return;
	}

	if(!Node.Exists(template)) {
		System.Alert("Error: YafaRay4tS does not seem to be installed");
		params.SetTerminationFlag(); 
		return;
	}
	try {
//
	} catch(e) {
		System.Alert("Error: YafaRay4tS does not seem to be installed");
		return;
	}
I tried the above immediately after getting an error and so far it is working.
The params.SetTerminationFlag(); and the try/catch/error is need in both blocks of code.
I tested with and without and both are needed.
Your thoughts?
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 08 Aug 2018, 01:34 YafaRay4tS Scene Utilities
Steps
Remove YafaRay4tS from scene
Select the Process Imported Scene button
Alert "Scene does not contain a YafaRay4tS node"
I get an error.
...
I have now idea where you're going with this. The code is written to update a scene that has a yafaray4ts node. It's like running it on a vray scene then declaring it doesn't work? :? 100% lost here.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 08 Aug 2018, 02:50
trueBlue wrote: 08 Aug 2018, 01:34 YafaRay4tS Scene Utilities
Steps
Remove YafaRay4tS from scene
Select the Process Imported Scene button
Alert "Scene does not contain a YafaRay4tS node"
I get an error.
...
I have now idea where you're going with this. The code is written to update a scene that has a yafaray4ts node. It's like running it on a vray scene then declaring it doesn't work? :? 100% lost here.
Wow, this is a bubble buster! :(
I asked you a few months back how I could help you test your project.
Your reply was to use it and try and break it.
I have reported this broad issue to your several times and it is a pretty big deal if you do not know how to recoup from it.
You recently confirmed you were able to confirm this issue with the scene that I shared with you and supplied a fix in your Integrated Offline Render icons.

Yesterday I reported that it was not entirely fixed but there was indeed a workaround.

I was pretty stoked finding and sharing, what looks like, a solid fix and perhaps a better way to write if statements.!

I am pretty sure that the author of that script is Vladimir, who was one of the longest core developers of trueSpace and the iOptDetectors plugin.
That script is pretty simple and he uses the params.SetTerminationFlag() at the beginning of his if statements.
To be honest with you, I do not know what it does or how it works. I was hoping you had a better understanding of its use.

So to answer your question, I was simply sharing that script with you and hoping that it helps.
As always I respect your expertise and look for your approval! :)
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 08 Aug 2018, 16:44
clintonman wrote: 08 Aug 2018, 02:50
trueBlue wrote: 08 Aug 2018, 01:34 YafaRay4tS Scene Utilities
Steps
Remove YafaRay4tS from scene
Select the Process Imported Scene button
Alert "Scene does not contain a YafaRay4tS node"
I get an error.
...
I have now idea where you're going with this. The code is written to update a scene that has a yafaray4ts node. It's like running it on a vray scene then declaring it doesn't work? :? 100% lost here.
Wow, this is a bubble buster! :(
I asked you a few months back how I could help you test your project.
Your reply was to use it and try and break it.
I have reported this broad issue to your several times and it is a pretty big deal if you do not know how to recoup from it.
You recently confirmed you were able to confirm this issue with the scene that I shared with you and supplied a fix in your Integrated Offline Render icons.

Yesterday I reported that it was not entirely fixed but there was indeed a workaround.

I was pretty stoked finding and sharing, what looks like, a solid fix and perhaps a better way to write if statements.!

I am pretty sure that the author of that script is Vladimir, who was one of the longest core developers of trueSpace and the iOptDetectors plugin.
That script is pretty simple and he uses the params.SetTerminationFlag() at the beginning of his if statements.
To be honest with you, I do not know what it does or how it works. I was hoping you had a better understanding of its use.

So to answer your question, I was simply sharing that script with you and hoping that it helps.
As always I respect your expertise and look for your approval! :)
Fair enough. I just don't see the use case where someone would delete the node and then try to convert data from the missing node. It's like if the user went into the link editor and removed some of the nodes in YafaRay4tS Scene Utilities, that would break it too. What specifically is the broad issue you are referring to that you've been talking about? and you are saying that the params.SetTerminationFlag() may fix it?
params.SetTerminationFlag(); is an interesting find along with all the other params dot functions. I have no idea what they do. Here's the confusion in the code you provided:

Code: Select all

try {
   tryStatements}
catch(exception){
   catchStatements}
finally {
   finallyStatements}
 
from the docs
tryStatements
Required. Statements where an error can occur.
exception
Required. Any variable name. The initial value of exception is the value of the thrown error.
catchStatements
Optional. Statements to handle errors occurring in the associated tryStatements.
finallyStatements
Optional. Statements that are unconditionally executed after all other error processing has occurred.

The code that can break goes into the try section, your sample has nothing in the try so the catch will never do anything unless that params.SetTerminationFlag is doing something magical.

I'll add your changes and test it. It may be a case of truespace holding something in memory again where you making a coding change and the old values are still having an effect.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Broad meaning if statements that are not being honored or throw errors. Like empty string errors.
Also several different instances where the error stops the execution of the script.
Looking back at the pics of the errors posted the common one are where the Exporting XML file is being stopped.
Or the access YafarayXMLFileFnSet which gives you no clue. This is with old scenes and new scenes.

Again I am not saying that my code is correct.
Just a test or experiment if you will.
And yes I deliberately removed the YafaRay4tS node from the scene and renamed the YafaRay Folder to test it.
If an if statement has a break and it does not stop or handle the error and or allows the script to continue, there is something wrong with that if statement.

I have been searching for a definition of the SetTerminationFlag() but so far no go.
Here is another definition of Throw and Try to Catch Errors

The try statement lets you test a block of code for errors.
The catch statement lets you handle the error.
The throw statement lets you create custom errors.
The finally statement lets you execute code, after try and catch, regardless of the result.

https://www.w3schools.com/js/js_errors.asp
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

Well I guess the bottom line is that only specific, repeatable errors can be fixed. If I have errors and you never see them you'll have a hard time trying to fix them. One of the errors you had I never saw until after you shared a scene file, the kitchen scene which was included with all those other scenes. That one would still be giving errors if you hadn't shared the scene. Gotta have samples and steps to recreate errors, otherwise it's hit and miss.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Agreed I have not been a very good beta tester, still learning.
My thought is that the SetTerminationFlag is an Important/Mandatory part of the script that actualy kills the process.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 08 Aug 2018, 01:34 YafaRay4tS Scene Utilities
Steps
Remove YafaRay4tS from scene
Select the Process Imported Scene button
Alert "Scene does not contain a YafaRay4tS node"
I get an error.

Update YafaRay Render Node2 script:
First I tried incorporating a try/catch/error
That did not work

I think, I found a solution to this problem that I found in the Interactive Replace Tool.RsObj in the Activities - My Activities library.
Author sets a params.SetTerminationFlag();

Fix:
...

I tried the above immediately after getting an error and so far it is working.
The params.SetTerminationFlag(); and the try/catch/error is need in both blocks of code.
I tested with and without and both are needed.
Your thoughts?
SetTerminationFlag.jpg
Here is what I found.
The try catches don't do anything and I don't know why it made a difference for you. Makes me think you need to restart the computer before testing further. Truespace will keep thinks in memory and mess you up, I've lost hours because of that in the past. If it misbehaves for no reason - restart.
"I get an error" - The error comes from the Process Textures script which is inline after the Update YafaRay Render Node2
The params.SetTerminationFlag() seems to stop downstream connected scripts from running - super useful! :bananathumb:
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 08 Aug 2018, 20:48 ...
My thought is that the SetTerminationFlag is an Important/Mandatory part of the script that actualy kills the process.
Close - see the previous cross post. Experiment shows it stops the trailing scripts from running.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Okay I get the reboot tS and PC, makes a lot of sense. :)
Sincere apology for the wasted hours!!!

Not sure I am following your test. I misled you in my post. I used the modified code in the other Update YafaRay Render Node.RsObj to test.
"I get an error" - The error comes from the Process Textures script which is inline after the Update YafaRay Render Node2
The params.SetTerminationFlag() seems to stop downstream connected scripts from running - super useful!
If the params.SetTerminationFlag() stops the downstream connected scripts from running, why did you get an error?
Not so sure your theory is correct about stopping connected scripts. If you look at that script in the Interactive Replace Tool at the bottom there is params.Param("lastSelectedObject") in with which lastSelectedObject is an Output. Seems to me that if the script ran without errors then there would be success verses failure at the Termination Flag. If there was success then and only then would a chained script fire. Nevertheless this is all an assumption on my part.
You know best, so whatever works correctly, works for me. Let me know how to use it properly.

Testing your new Camera modifications.
Looks like all of the old attributes in the Cam Name script are no longer needed.
As a TEST, I selected a Yafaray Camera and pressed the Set Camera button.
Works and renders as expected.
I rename the Yafaray Camera to Camera without setting it up in the UI.
I get the Errors Found message and it renders the scene. <- The message is misleading with regards invalid selection in this scenario.
All is good except you are not setting the Output - Render File to View.
Thinking this might be a problem with imported scenes too if you do not make the switch!!!

Also made some changes for a future RC-26 candidate:
RC-26
Replaced YafaRay4tS.RsScn

YafarayScripts
Changed Intergrated Buttons to version to 5
Changed Console and Alert messages
Object Render (experimental mode) Added (HideALL/Show Selected) and (ShowALL after render)

Installer does not show YafaRay4tS Setup. Could be because I had Vray loaded.

YafaRay4tS Setup library - Fixed D3D Preview Background objects icons and descriptions

YafaRay4tS Scene Utilities.RsObj
Add - WindowsManager.ActivateFrame(1); to the Browse button
Add - try/catch code from the Camera script to Lights, Update YafaRay Render Node2, and Update YafaRay Render Node2 scripts

Code: Select all

	try {
		utilitydata = System.CreateDO("Clintons3D Package/Utility functions");
	} catch(err) {
		System.Alert("Requires Clintons3dPlugin.rsx plugin");
		return;
	}
	currentnode = Source;
	thedata = utilitydata.GetConnectorData(currentnode);
	connectors = thedata.split("\n");
	for(var i=0;i<connectors.length;i++) {

		connector = connectors[i].split("\t");

		if(connector[3] & CONFLG_IN && !(connector[3] & CONFLG_HIDDEN)) {
			if(Node.ConExists(Destination, connector[0])) {
				if(connector[0] == "Yaf_Path") {
					continue;
				} else {
					Node.Value(Destination, connector[0]) = Node.Value(Source, connector[0]);
					System.Trace(connector[0]);
				}
			}
		}
	}
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 08 Aug 2018, 21:52 ...
If the params.SetTerminationFlag() stops the downstream connected scripts from running, why did you get an error?
...
Without the fix:
1. new scene - so no YafaRay4tS node
2. run and get message "Scene does not contain a YafaRay4tS node" then get an error on line 19 of Process Textures
line 19 of Process Textures error because trying to read value from non-existent YafaRay4tS node

Code: Select all

var filename = Node.Value(Space.CurrentScene() + "/YafaRay4tS", "Yaf_BkgImage");
With fix only get the message "Scene does not contain a YafaRay4tS node".
Process Textures never runs so don't get the error
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 08 Aug 2018, 21:52 ...
Not so sure your theory is correct about stopping connected scripts. If you look at that script in the Interactive Replace Tool at the bottom there is params.Param("lastSelectedObject") in with which lastSelectedObject is an Output. Seems to me that if the script ran without errors then there would be success verses failure at the Termination Flag. If there was success then and only then would a chained script fire. Nevertheless this is all an assumption on my part.
...
I don't think the params.SetTerminationFlag(); does anything in that script. It still works if the line isn't there. My guess is either the SetTerminationFlag behavior changed after he wrote the script or the script was used with some down stream functionality that was removed.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 08 Aug 2018, 21:52 ...

Testing your new Camera modifications.
Looks like all of the old attributes in the Cam Name script are no longer needed.
As a TEST, I selected a Yafaray Camera and pressed the Set Camera button.
Works and renders as expected.
I rename the Yafaray Camera to Camera without setting it up in the UI.
I get the Errors Found message and it renders the scene. <- The message is misleading with regards invalid selection in this scenario.
...
What is the Errors Found message?
If the camera in the YafaRay4tS node is invalid it will give a message and then search the scene for a camera and use it. If it finds no camera at all it uses the 3D view and if it still fails it gives some other error and probably fails to render.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 08 Aug 2018, 21:52 ...

Installer does not show YafaRay4tS Setup. Could be because I had Vray loaded.

...
I saw that too with no vray installed. I'll see if I can find it before your next rc release.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

New Installer:

Checks for prerequisites earlier
Removed most of the Activity.Run statements - makes it difficult to run things in order
Uses the newly discovered params.SetTerminationFlag()

Install YafaRay4tSv0.9.0 node is now directly connected to the Integrated Button Install node
Removed YafaRay4tS scene loading - prevents the change to the Setup tab during installation

I don't know any way around the "don't load a scene" if you want to be able to save the setup. maybe it could be a button on the panel to load the scene after installation is done
Edit: - or maybe you can somehow make the YafaRay4tS scene show the setup panel when it loads

Nothing else has changed, only the installer code has changed all else is still rc25 code
Attachments
YafaRay4tS_Installer.RsObj
(1.13 MiB) Downloaded 266 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 09 Aug 2018, 02:48
trueBlue wrote: 08 Aug 2018, 21:52 ...

Testing your new Camera modifications.
Looks like all of the old attributes in the Cam Name script are no longer needed.
As a TEST, I selected a Yafaray Camera and pressed the Set Camera button.
Works and renders as expected.
I rename the Yafaray Camera to Camera without setting it up in the UI.
I get the Errors Found message and it renders the scene. <- The message is misleading with regards invalid selection in this scenario.
...
What is the Errors Found message?
If the camera in the YafaRay4tS node is invalid it will give a message and then search the scene for a camera and use it. If it finds no camera at all it uses the 3D view and if it still fails it gives some other error and probably fails to render.
Again this is just a slightly different TEST
Set Camera is not set in the Camera aspect (Empty String) and Camera is set to Render
YafaRay Camera exist in scene
As you can see Open View is called as well as the Errors Add
Notice also that the Render is complete in the Status line but the Rendered image is not shown.
Console shows that XML file is open for writing etc.. AFTER the Render is completed
Capture.PNG
It works much better if you eliminate the Errors Add
And in the case of no camera in the scene, switch to View

Code: Select all

				Yaf_CamPath = FindSceneCamera(scene);
				if(Yaf_CamPath != "") {
//tB
System.Trace("Camera not Set...");System.Trace("Found Camera in scene " + Yaf_CamPath)
//Errors.Add("Selected camera is not valid, using a scene camera instead.");

				CamMatrix = Node.Value(Yaf_CamPath, "WldMatrix");
				PerspectiveCheck = Node.Value(Yaf_CamPath + "/Camera", "Perspective");
				CamFOV = Node.Value(Yaf_CamPath + "/Camera", "FOV");
				} else {
				//System.Alert("Could not find camera.  Please choose a camera in the scene.")
				if(!d3dviewOpen) {
					System.Alert('CameraFnSet: ERROR - No 3D View window found!');
					return;
				}
				CamMatrix = Node.Value("/D3DView/" + EyeCam, "WldMatrix");
				PerspectiveCheck = Node.Value("/D3DView/" + EyeCam, "Perspective");
				CamFOV = Node.Value("/D3DView/" + EyeCam, "FOV");
//tB
//Errors.Add("No camera selected, using the active 3d view instead.");
System.Trace("Camera not Set...");System.Trace("Camera does not exist...");System.Trace("Switch to View");
Node.Value(System.ThisOwner(), 'Yaf_CamChoice') = 0;
Not sure what to say about the Open View and Render completed before the XML file is created. But it does seem to be reversed.


Also the Render Object would work better (in my opinion) if there was no Alert, if nothing was selected or an invalid selection. That's the way Vray works. If you do not select an object with a mesh it does not render.
In the Default/Render Mode, after using the experimental mode, both Radio Buttons are disabled. So you do not know which mode you are using.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 09 Aug 2018, 06:32
...

It works much better if you eliminate the Errors Add
And in the case of no camera in the scene, switch to View
...
Not sure what to say about the Open View and Render completed before the XML file is created. But it does seem to be reversed.


Also the Render Object would work better (in my opinion) if there was no Alert, if nothing was selected or an invalid selection. That's the way Vray works. If you do not select an object with a mesh it does not render.
In the Default/Render Mode, after using the experimental mode, both Radio Buttons are disabled. So you do not know which mode you are using.
If user has invalid input they should know about it.
Plan make non-blocking error display so it's not out of order.
Lack of feedback in vray is a flaw, if a program is making decisions for the user the user should know about it.
Can simplify the programs decision to render view instead trying a camera first - still user needs to know.

Combination of the 2 object modes plus scene render mode was a pain in the ass to get working, so I won't be touching it. Other option is to get rid of the experimental mode and have no choice visible on the ui. All the code would still be there(like I said not touching it) it's just the option for the user would be removed.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 10 Aug 2018, 04:39
trueBlue wrote: 09 Aug 2018, 06:32
...

It works much better if you eliminate the Errors Add
And in the case of no camera in the scene, switch to View
...
Not sure what to say about the Open View and Render completed before the XML file is created. But it does seem to be reversed.


Also the Render Object would work better (in my opinion) if there was no Alert, if nothing was selected or an invalid selection. That's the way Vray works. If you do not select an object with a mesh it does not render.
In the Default/Render Mode, after using the experimental mode, both Radio Buttons are disabled. So you do not know which mode you are using.
If user has invalid input they should know about it.
Plan make non-blocking error display so it's not out of order.
Lack of feedback in vray is a flaw, if a program is making decisions for the user the user should know about it.
Can simplify the programs decision to render view instead trying a camera first - still user needs to know.

Combination of the 2 object modes plus scene render mode was a pain in the ass to get working, so I won't be touching it. Other option is to get rid of the experimental mode and have no choice visible on the ui. All the code would still be there(like I said not touching it) it's just the option for the user would be removed.
You know best. I just hate nagging window messages. :)
Have you thought about using the Status line, instead of the Alerts?

I have given up on the Object Render experimental mood. Do not like the window switching.
Tried Vray again and it renders the selected object just like yours.

Nevertheless in the new Update 4 there will be an additional option in the Background widget.
Comma key + LMB drag = Zoom 2 Object, Hide All except selected.
Period key + LMB drag = Show All
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

YafaRay4tSv090-RC-26

Includes new YafaRay4tS_Installer.RsObj

YafaRay4tS Setup library
Fixed D3D Preview Background objects icons and descriptions
Replaced YafaRay4tS.RsScn

YafarayScripts
Changed Intergrated Buttons to version to 5
Changed Console and Alert messages
Object Render - Removed (experimental mode)

YafaRay4tS
Removed Object Mode from the Default aspect

Yafaray Settings LMB Command
.RsObj
Add :
Space.LoadScene(System.GetMainDir() + "/Rs Main Libraries/YafaRay4tS Setup/YafaRay4tS.RsScn")
System.Alert("Right click to change to YafaRay4tS")

Yafaray Settings RMB Command
.RsObj
Add:
Space.SceneHasChanged(false)
Space.LoadScene(System.GetMainDir() + "/Rs Main Libraries/YafaRay4tS Setup/YafaRay4tS.RsScn")

CameraFnSet
Add to line 20 - Node.Value(System.ThisOwner(), 'Yaf_CamChoice') = 0;
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Whoever downloaded YafaRay4tSv090-RC-26
There was a mistake!
Fixed and re uploaded in the previous post.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

The installer is missing from the rc26.
YafaRay4tS_Installer.RsObj is really just the YafaRay4tS node.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 10 Aug 2018, 20:33 Whoever downloaded YafaRay4tSv090-RC-26
There was a mistake!
Fixed and re uploaded in the previous post.
Cross post! :) That was me.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 10 Aug 2018, 20:34
trueBlue wrote: 10 Aug 2018, 20:33 Whoever downloaded YafaRay4tSv090-RC-26
There was a mistake!
Fixed and re uploaded in the previous post.
Cross post! :) That was me.
There is still a mistake, I need to update to the newest installer. I will fix it and re upload it
Edit: It's fixed
Also added an Alert.
Yafaray Settings LMB Command.RsObj
Add :
Space.LoadScene(System.GetMainDir() + "/Rs Main Libraries/YafaRay4tS Setup/YafaRay4tS.RsScn")
System.Alert("Right click to change to YafaRay4tS")

Edit2: If your last download installer shows the Setup aspect after installation and you have the Alert then it is the same.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 10 Aug 2018, 20:57
clintonman wrote: 10 Aug 2018, 20:34
trueBlue wrote: 10 Aug 2018, 20:33 Whoever downloaded YafaRay4tSv090-RC-26
There was a mistake!
Fixed and re uploaded in the previous post.
Cross post! :) That was me.
There is still a mistake, I need to update to the newest installer. I will fix it and re upload it
Edit: It's fixed
Also added an Alert.
Yafaray Settings LMB Command.RsObj
Add :
Space.LoadScene(System.GetMainDir() + "/Rs Main Libraries/YafaRay4tS Setup/YafaRay4tS.RsScn")
System.Alert("Right click to change to YafaRay4tS")

Edit2: If your last download installer shows the Setup aspect after installation and you have the Alert then it is the same.
Too late, I already did a bunch of tests and changes.

Replaced the installer nodes with the new ones.
added SetTermination Code to the Yaf scene Utilities
cleanup non functioning code

I'm not going to download it a 3rd time, you can have control back when I'm finished with the changes I already started.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 10 Aug 2018, 21:42
trueBlue wrote: 10 Aug 2018, 20:57
clintonman wrote: 10 Aug 2018, 20:34
Cross post! :) That was me.
There is still a mistake, I need to update to the newest installer. I will fix it and re upload it
Edit: It's fixed
Also added an Alert.
Yafaray Settings LMB Command.RsObj
Add :
Space.LoadScene(System.GetMainDir() + "/Rs Main Libraries/YafaRay4tS Setup/YafaRay4tS.RsScn")
System.Alert("Right click to change to YafaRay4tS")

Edit2: If your last download installer shows the Setup aspect after installation and you have the Alert then it is the same.
Too late, I already did a bunch of tests and changes.

Replaced the installer nodes with the new ones.
added SetTermination Code to the Yaf scene Utilities
cleanup non functioning code

I'm not going to download it a 3rd time, you can have control back when I'm finished with the changes I already started.
Understand. :)
If you can with your utility script, capture, select and set the old Camera and transfer to the new YafaRay4tS node, that would be awesome. Noticed with your demo scenes it being an issue.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 10 Aug 2018, 08:16 ...
You know best. I just hate nagging window messages. :)
Have you thought about using the Status line, instead of the Alerts?

...
I hear you, maybe in a future version that's been rewritten from the ground up can add truespace style options to not show various error messages(checkbox with, "Do not show this message again") and a preferences section to turn it on again.

Errors can take up several lines that would not fit well in the status line. Also the need to clear the status line makes it less than ideal.

I've reached a stopping point where I can send the changes back to you. Will upload RC27 soon.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

RC27 Changes
The big change is the new installer
clintonman wrote: 09 Aug 2018, 04:32 New Installer:

Checks for prerequisites earlier
Removed most of the Activity.Run statements - makes it difficult to run things in order
Uses the newly discovered params.SetTerminationFlag()

Install YafaRay4tSv0.9.0 node is now directly connected to the Integrated Button Install node
Removed YafaRay4tS scene loading - prevents the change to the Setup tab during installation
...
Process Imported Scene on the Yaf Scene Utilities - added SetTerminationFlag to stop execution
cleaned out non-functional camera code
cleaned unused connectors and code from the Update Yafaray Material

OK it's all yours.
Attachments
YafaRay4tSv090-RC-27.zip
(14.74 MiB) Downloaded 256 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

YafaRay4tS Scene Utilities

Noticed that you did not use the SetTermimanationFlag (s)
on the other Update YafaRay Render Node.RsObj and the other scripts where your plugin is required.
I made those changes and is included here:
YafaRay4tS Scene Utilities.RsObj
Let me know if this works for you.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 11 Aug 2018, 02:25 YafaRay4tS Scene Utilities

Noticed that you did not use the SetTermimanationFlag (s)
on the other Update YafaRay Render Node.RsObj and the other scripts where your plugin is required.
I made those changes and is included here:
YafaRay4tS Scene Utilities.RsObj
Let me know if this works for you.
My understanding is that it is only needed in the one place because of the command link between the 2 nodes.
From an earlier post, " Experiment shows it stops the trailing scripts from running."
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

The changes I made and was talking about were to different scripts that are not chained together.


Again, I am not so sure that your are entirely correct.

I believe that you setup this SetTreminationFlag at the beginning of a block of if statements with a return

Code: Select all

	// check if new object selection has been made and if it is object with matrix
	currentSelected = Node.FirstSelected(); 
	if ((lastSelected == currentSelected) || (currentSelected == "") || !Node.ConExists(currentSelected, 'ObjMatrix')) 
	{
		params.SetTerminationFlag(); 
		return; //--> 
	}

	// check replacement object
	if (replacName == "") {
		System.Alert("No replacement object selected !");
		return; //-->
	}
	if (!Node.Exists(replacName)) {
		System.Alert("Invalid replacement object selected !");
		return; //-->
	}
	if (!Node.ConExists(replacName, 'ObjMatrix')) {
		System.Alert("Replacement object does't have transform matrix attribute!");
		return; //-->
	}
If any of the if statements are incorrect then the script stops here.
If correct then from here you can process any of the above attributes.

Code: Select all

	// get target matrix 
	matrixT = Node.Value(currentSelected, 'ObjMatrix')

	// get replacement matrix 
	matrixR = Node.Value(replacName, 'ObjMatrix')

	// copy object 
	pureCurrName = Node.ShortName(currentSelected); 
	Node.Delete(currentSelected); 
	newName = Node.Copy(replacName, Space.CurrentScene());
	Node.Rename(newName, pureCurrName); 

	// update target matrix
	if (!keepOrient)
	{
		matrixT.SetRoll(matrixR.GetRoll()); 
		matrixT.SetYaw(matrixR.GetYaw()); 
		matrixT.SetPitch(matrixR.GetPitch()); 
	}
	if (!keepScale)
	{
		matrixT.SetScaleX(matrixR.GetScaleX()); 
		matrixT.SetScaleY(matrixR.GetScaleY()); 
		matrixT.SetScaleZ(matrixR.GetScaleZ()); 
	}
	Node.Value(currentSelected, 'Matrix') = matrixT; 

	params.Param("lastSelectedObject") = currentSelected;
My thought is, if you have more code from here in the same script with different attributes, you would need to setup another SetTreminationFlag with a return, etc..
This would include separate functions as well.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

"after" never prints, the return ends the script
placing params.SetTerminationFlag(); before the return doesn't change the fact that the return statement ends a function execution

Code: Select all

// Execute 
// Called to execute the command 
function Execute(params)
{
	System.Trace("before");
	if(true) {
		return;
	}
	System.Trace("after")
}
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Gotcha! :)
Gonna test this further to see if I can find out it's use and how to use it properly.


Will you test this scene and let me know what you think?
Modified YafaRay4tS.RsObj
New Viewer buttons
New RTF.PNG
New RTF.PNG (10.97 KiB) Viewed 4813 times
New Render to File
The attachment New RTF.PNG is no longer available
Things to try:
The new viewer button's scripts
Render to File button scripts
Note: You can still use the viewer Check Boxes if you wanted to enable a viewer along with the Render to File.
Attachments
New Viewer buttons.PNG
New Viewer buttons.PNG (4.31 KiB) Viewed 4813 times
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

Changing user preferences on the popup panel without any visible feedback is unacceptable and doesn't respect user choices. The only setup button I like is the optdetector activating the internal render. The other buttons are like playing whack a mole.

If you like the buttons keep them, but get rid of the popup panel change.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Whack a Mole? :o
At first, I added the button scripts to the Render to File attribute.
Goal was to disable all other viewers.
Then I thought that since the Internal Viewer needed to be enabled when using the Opt Dectector, I would do that one too.
The rest of the viewers was two fold, to keep the UI uniform and disable all other viewers.


FYI...Interesting observation this morning testing the SetTerminationFlag.
First as shown in Test 2, setting the script to -> if true -> SetTerminationFlag -> return, changes Control Out to 2
Test 3 script was setup to -> if false -> SetTerminationFlag -> return
With that script it does (as you say) not let a linked script run.
Other observation, it matters how you hook up the linked scripts.
If you hook up Test 2 first it runs first. If you hook Test 3 next it runs second. If you hook Test 1 next it runs third.
SetTerminationFlag changes Control Out to 2.PNG
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 11 Aug 2018, 19:21 ...

FYI...Interesting observation this morning testing the SetTerminationFlag.
First as shown in Test 2, setting the script to -> if true -> SetTerminationFlag -> return, changes Control Out to 2
Test 3 script was setup to -> if false -> SetTerminationFlag -> return
With that script it does (as you say) not let a linked script run.
Other observation, it matters how you hook up the linked scripts.
If you hook up Test 2 first it runs first. If you hook Test 3 next it runs second. If you hook Test 1 next it runs third.
SetTerminationFlag changes Control Out to 2.PNG
Glad to see you're investigating the SetTerminationFlag.

Would have been nice if connected scripts ran in parallel.

I found a couple of other useful methods attached to the params.
params.GetControlIn() gets the name of the control input that runs the script, so can have several input controls and make code decisions based on which input was used
params.SetControlOut(str) does the opposite and lets you choose which output control will fire off
ControlInOut.jpg

Code: Select all

function Execute(params)
{
	var controlIn1 = params.ConValue('controlIn1');
	var controlIn2 = params.ConValue('controlIn2');

	var scriptFrom = params.GetControlIn();

	System.Trace(scriptFrom);

	if(scriptFrom == "controlIn2")
		params.SetControlOut("ControlOut2")
	else
		params.SetControlOut("ControlOut1")

	// params.ConValue("controlOut1") = ...
	// params.ConValue("ControlOut2") = ...
}
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

This may be the same thing but you can create your own Control Outputs checking Control flow
Attachments
Control Flow.PNG
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 11 Aug 2018, 22:01 This may be the same thing but you can create your own Control Outputs checking Control flow
Yep, same thing.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

bug
line 127 ExportXMLFnSet
"+ XMLFile" should be "+ File"

Code: Select all

System.Trace("ExportXMLFnSet Error: XML_file does not exist!" + File);
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

NonBlockingErrors.jpg
Got working version of error display that does not block the render display.

Errors shown in image shows reverse animation range, blank texture map, no blend material collection and invalid camera selection.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Oh cool!
I was working on the same thing.
I hit a brick wall on how to send the message from script.
The Edit Control does not have Word Wrap.
It does have Multiple lines.
I do not know how to use a Carriage Return in the string, like you can in an Alert string. /n
Capture.PNG
Looks like you went a different route,
Are you creating and displaying an html file from the Console messages?
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 13 Aug 2018, 13:17 Oh cool!
I was working on the same thing.
I hit a brick wall on how to send the message from script.
The Edit Control does not have Word Wrap.
It does have Multiple lines.
I do not know how to use a Carriage Return in the string, like you can in an Alert string. /n
Capture.PNG

Looks like you went a different route,
Are you creating and displaying an html file from the Console messages?
Yes, uses html code embedded in a string and the errors function set controls the error messages and panel display.
I don't know if it works but you can try /r/n for the carriage return.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Got an idea from one of Marcel's material for the YafaRay Materials
Instead of switching the user interface he just selects the panel.
Please try and see if you like it.

YafaRay Materials library
Changed all material's OpenMap.RsObj

OpenMap.RsObj
Changed to Node.Select/Unselect
//UserInterface.OpenToolPanelViewEx2("" , "" ,owner + "/" + MapAttribute, 3,true,false);
Node.Select(owner + "/" + MapAttribute);Space.Unselect()

SwitchImage.RsObj
Changed to Node.Select/Unselect
//UserInterface.OpenToolPanelViewEx2("" , "" ,owner + "/Cloud", 3,true,false);
Node.Select(owner + "/Cloud");Space.Unselect()
etc...

Map.RsObj
SwitchImage.RsObj

Changed to Node.Select/Unselect
//UserInterface.OpenToolPanelViewEx2("" , "" ,owner + "/Cloud", 3,true,false);
Node.Select(owner + "/Cloud");Space.Unselect()
etc...

Blend Material Collection
Changed the Spheres to new YafaRay Shiny_Diffuse material

YafaRay Blend
SwitchDiffuseImage.RsObj

Changed to Node.Select/Unselect
//UserInterface.OpenToolPanelViewEx2("" , "" ,owner + "/DiffuseCloud", 3,true,true);
Node.Select(owner + "/DiffuseCloud");Space.Unselect()
etc...

Previous way
New_Switch.PNG
New_Switch.PNG (68.3 KiB) Viewed 5062 times
New way
The attachment New_Switch.PNG is no longer available
Attachments
Old_Switch.PNG
Old_Switch.PNG (61.78 KiB) Viewed 5062 times
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

Testing Rc28:

testing on standalone unpatched + optdetector
install failed with error after answering the question dialog - fix: change model status code back to original

Edit: animation rendering causing errors - fix: change ShowDisplayFnSet back to RC27 version

will need to replace all nodes where status line was changed, guess change must only work in patched tS versions

Edit: List of replacements
ShowDisplayFnSet
update Opti display
YafarayXMLFileFnSet
RenderFnSet
SaveSettings
Render
ExportXML

remove Node.ConRemove("/Status Line", "YafaRay4tS"); from ExportXMLFnSet
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

YafaRay Blend Material
bug - user choices erased when updating the material lists

new code for Populate Material List inside the YafaRay Blend node:

Code: Select all

// Execute 
// Called to execute the command 
function Execute(params)
{
	var MaterialList1 = params.ConValue('MaterialList1');
	var MaterialList2 = params.ConValue('MaterialList2');

	var oldMatListSel1 = MaterialList1.GetSelectedString();
	var oldMatListSel2 = MaterialList2.GetSelectedString();

	var newMaterialList1 = System.CreateDO("Common Data Package/String Enum Data");
	var newMaterialList2 = System.CreateDO("Common Data Package/String Enum Data");

	newMaterialList1.Clear();
	scene = Space.CurrentScene();
	bmc = scene + "/Blend Material Collection";

	if(!Node.Exists(bmc)) return;


	var numMaterials = Node.Value(bmc, "NumMaterials");

	for(var i=0;i<numMaterials;i++) {
		newMaterialList1.SetStringAt(i, "BlendMaterial" + (i+1)); 
		newMaterialList2.SetStringAt(i, "BlendMaterial" + (i+1));
	}

	//newMaterialList1.SetSelectedString("BlendMaterial" + (i-1));
	newMaterialList1.SetSelectedString(oldMatListSel1);

	Node.Value(System.ThisOwner(), "MaterialList1") = newMaterialList1;

	params.ConValue('MaterialList1') = newMaterialList1;


	//newMaterialList2.SetSelectedString("BlendMaterial" + (i));
	newMaterialList2.SetSelectedString(oldMatListSel2);

	Node.Value(System.ThisOwner(), "MaterialList2") = newMaterialList2;

	params.ConValue('MaterialList2') = newMaterialList2;

}
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Oh Bummer :(
Wonder why it did not work.
Same old Status Line.

Just revert back to RC - 27
The installer had changes to the Status Line too.
I will delete RC 28
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 18 Aug 2018, 01:15 Oh Bummer :(
Wonder why it did not work.
Same old Status Line.

Just revert back to RC - 27
The installer had changes to the Status Line too.
I will delete RC 28
Too late, already spent the time fixing it and rc27 didn't have your setup buttons on the YafaRay4tS node.

To answer questions on the deleted post:

Thought about it and going to keep the Render to File default.

Spent over half hour trying to figure way to delete the "Yaf_render.cmd" file with no luck.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 17 Aug 2018, 18:47 Got an idea from one of Marcel's material for the YafaRay Materials
Instead of switching the user interface he just selects the panel.
Please try and see if you like it.

...
Only seems to work for image maps. Procedural maps not working. Looks like these changes were in RC28 as well. Are you planning to spend more time on the materials? If not I'll revert to RC27 materials.

Edit: Hold on, looks like RC27 is bad too - checking...

Edit: Good news, it was my error. In Blender the Texture Mapping color defaults to a hot pink color so you see the results of procedurals by default. In truespace it got changed to white so it was invisible by default. Either that or it was never set to begin with.

Testing shows it looks like it keeps the material editor open? I'm not sure all you said was "try it" so I don't know what it's supposed to do.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 18 Aug 2018, 01:47
trueBlue wrote: 18 Aug 2018, 01:15 Oh Bummer :(
Wonder why it did not work.
Same old Status Line.

Just revert back to RC - 27
The installer had changes to the Status Line too.
I will delete RC 28
Too late, already spent the time fixing it and rc27 didn't have your setup buttons on the YafaRay4tS node.

To answer questions on the deleted post:

Thought about it and going to keep the Render to File default.

Spent over half hour trying to figure way to delete the "Yaf_render.cmd" file with no luck.
I would be concerned that you may miss something with the changes to the Status Line. I went thorough every node and changed even the Clear Status lines. The Buttons for the Viewers would be easy to recreate.
Thanks for trying to fix deleting the "Yaf_render.cmd" file.
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 18 Aug 2018, 02:07
trueBlue wrote: 17 Aug 2018, 18:47 Got an idea from one of Marcel's material for the YafaRay Materials
Instead of switching the user interface he just selects the panel.
Please try and see if you like it.

...
Only seems to work for image maps. Procedural maps not working. Looks like these changes were in RC28 as well. Are you planning to spend more time on the materials? If not I'll revert to RC27 materials.

Edit: Hold on, looks like RC27 is bad too - checking...

Edit: Good news, it was my error. In Blender the Texture Mapping color defaults to a hot pink color so you see the results of procedurals by default. In truespace it got changed to white so it was invisible by default. Either that or it was never set to begin with.

Testing shows it looks like it keeps the material editor open? I'm not sure all you said was "try it" so I don't know what it's supposed to do.
Yep, it stops the ME from switching. It seems to work better. Not 100% sure the same goes for the Blend Material Collection, but from what I can tell it seems to work the same as before.

The changes were simple as shown, I commented out your line and replaced with the node.Select/UnSelect
//UserInterface.OpenToolPanelViewEx2("" , "" ,owner + "/DiffuseCloud", 3,true,true);
Node.Select(owner + "/DiffuseCloud");Space.Unselect()
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 18 Aug 2018, 02:23
clintonman wrote: 18 Aug 2018, 01:47
trueBlue wrote: 18 Aug 2018, 01:15 Oh Bummer :(
Wonder why it did not work.
Same old Status Line.

Just revert back to RC - 27
The installer had changes to the Status Line too.
I will delete RC 28
Too late, already spent the time fixing it and rc27 didn't have your setup buttons on the YafaRay4tS node.

To answer questions on the deleted post:

Thought about it and going to keep the Render to File default.

Spent over half hour trying to figure way to delete the "Yaf_render.cmd" file with no luck.
I would be concerned that you may miss something with the changes to the Status Line. I went thorough every node and changed even the Clear Status lines. The Buttons for the Viewers would be easy to recreate.
Thanks for trying to fix deleting the "Yaf_render.cmd" file.
OK, will abandon RC28 completely.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

YafaRay4tS node with non-blocking error messages based in html display. Based on RC27.
with fix for System.Trace("ExportXMLFnSet Error: XML_file does not exist!" + File);
Attachments
YafaRay4tSa3bf.RsObj
(864.18 KiB) Downloaded 318 times
Last edited by clintonman on 18 Aug 2018, 04:21, edited 1 time in total.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

YafaRay Materials library based on "New YafaRay Materials library" with
Map node color fixed with Blender purple default and
Blend Material Update list that does not destroy previous user selection.
Attachments
YafaRay Materialsa562.zip
(691.27 KiB) Downloaded 294 times
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

YafaRay4tS Scene Utilities
fixed bug - Process Imported Scene - UpdateRenderPaths function was not being called.
removed extra alert dialog
Attachments
YafaRay4tS Scene Utilities901e.RsObj
(125.92 KiB) Downloaded 272 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Testing your new ConsoleObject
I have not been able to see it so far.

Use External Viewer - Without setting the Output - Render File to TGA format
Use External Viewer ErrorEvent.PNG
Use External Viewer Alert.PNG
Use External Viewer Alert.PNG (3.67 KiB) Viewed 9981 times
YafaRay Installation Path - With empty string and using the Render button
2 Alerts and Status Line shows Rendering... (clears)
YafaRay Installation Path - With empty string and using the Offline Render icons
1 Alert and Status Line shows Rendering... (clears)

Output Render File with BMP and DDS format. No Alert or Warning and renders a file with zero bytes.
Output Render File with no filename 'C:\trueSpace761\tS\Image Folder\'
No Alert or Warning and Status Line shows Frame# -1 - Render complete (Does NOT clear) and viewer displays the last succesful rendered image.
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

YafaRay4tSv090-RC-29

RC-27 YafaRay4tS_Installer
Includes updates:
YafaRay4tS node Fri Aug 17, 2018
YafaRay Materials library Fri Aug 17, 2018
YafaRay4tS Scene Utilities Fri Aug 17, 2018

Sat Aug 18, 201
Changes:

Removed Yaf_temp.xml file from the installation distribution folder.

New YafaRay4tS Help.chm

YafaRay4tS Setup library
New YafaRay4tS.RsScn - Previous scene had a Vray node and did not show the 'YafaRay4tS Settings' Default aspect.

YafaRay4tS.RsObj
Setup aspect - Changed all of the Viewer attributes to On/Off buttons.
* Use Render to File button - On, disables all other viewers. Off, enables the 'default' Internal and Opt Detector Viewers.
* Use External Viewer button - On, disables all other viewers. Off, enables the 'default' Internal and Opt Detector Viewers.
* Use Internal Viewer button - On, disables all other viewers. Off, disables Internal Viewer
* Use Opt Detector Viewer button - On, disables all other viewers except the required Internal Viewer.
* Use Custom Viewer button - On, disables all other viewers. Off, enables the 'default' Internal and Opt Detector Viewers.

Render to File aspect - Removed 'Use Render to File' On/Off button

GetRenderFile script - Added descriptions of the different image formats
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

So I figured out why RC - 28 did not work with unpatched trueSpace versions.
The Status Line was missing.
What is different from the patched versions is the included onnewscene.xml file.
I added this to onnewscene.xml file

Code: Select all

if(!Node.Exists("Status Line"))
return;
if(!Node.ConExists("Status Line", "Model"))
Node.ConCreate("Status Line", "Model", "string", 4);
Node.Value("Status Line", "Model") = "";
}
This gets installed to the Scripts\ScriptCommands folder.
It gets called every time a new scene is generated and the reset.js file also generates new scene.
I fixed the installer, if interested.
I am not sure how to include your new updates to the YafaRay4tS.RsObj though.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

RC29 so far:
tested on unpatched tS std

added disable button to the Render to File popup

bug: YafaRay4tS help not working - just opens windows explorer

Added error checks for blank files and invalid file extensions to RenderFnSet and the OpenView in Yafaray Scripts

Fixed bug in ErrorsFnSet where it would only work if called from a script inside of the YafaRay4tS node. That was a tough one to find since function sets always lie about where the error is.
Attachments
YafarayScriptsfdf0.RsObj
(47.43 KiB) Downloaded 365 times
YafaRay4tSbb28.RsObj
(871.77 KiB) Downloaded 316 times
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

fix for chm help
was not working because my truespace path had a space in it

HelpHTML

Code: Select all

function Execute(params)
{
	WshShell = new ActiveXObject("WScript.Shell");
	//help = 'file:///' + System.GetMainDir() + '\/YafaRay4tS%20Help.chm';
	//change all \ to /
	//var re;
	//re = /\\/g;
	//help2 = help.replace(re,"\/");
	help2 = '"' +  System.GetMainDir() + '\\YafaRay4tS Help.chm"';
	WshShell.Run(help2);
}
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Testing in unpatched Rosetta

YafaRay Installation Path - With empty string and using the Render button
2 Alerts and Status Line shows Rendering... (clears)
YafaRay Installation Path - With empty string and using the Offline Render icons
1 Alert and Status Line shows Rendering... (clears)

1.) Any way to abort the Render or stop the process? -> SetTerminationFlag()

Output Render File with BMP and DDS format. ConsoleObject/Alert "Error: Invalid file extension", (Yay it works) creates a file with zero bytes, and the last succesful render displays.

2.) Any way to abort the Render or stop the process? -> SetTerminationFlag()

Output Render File with no filename 'C:\trueSpace761\tS\Image Folder\'
ConsoleObject/Alert "Error: Invalid file name & extension", Status Line shows "Frame# -1 - Render complete" (Does NOT clear) and viewer displays the last succesful rendered image.

3.) Any way to abort the Render or stop the process? -> SetTerminationFlag()


Render XML button - Alert "XML file does not exist. Render aborted" and Status Line shows Rendering... (clears)
Render XML button script = Activity.Run("%THIS_NAME%" + "/Render");
Uncheck "Delete XML Export file" and select Export XML button
Render XML button - Renders without above Alert until you enable "Delete XML Export file"
You can repeat this over and over again with the same results.

4.) Any way to stop the Status Line message since the Alert says it has been aborted?

Not sure it's use but the Render button does not have this issue.
Render button script = Activity.Run("%THIS_NAME%" + "/DoFrameRender");
They both seem to use the the same Output - Render File path, but the Render button does NOT have a problem like the Render XML button has.

Thinking this is related, in a common way, to the issue within the YafarayXMLFileFnSet
Line 26 System.Trace("YafarayXMLFileFnSet Error: try catch error fix - close tS, delete xml file, open tS");

Edit: Cross post... I noticed one time that the help file did not show but its working for me.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

I'll see what I can do, but it's no where near as simple as a SetTerminationFlag(), which only works with connected nodes. Maybe it can be done through the new Errors system otherwise it might require extensive rewrites.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

trueBlue wrote: 18 Aug 2018, 20:15 So I figured out why RC - 28 did not work with unpatched trueSpace versions.
The Status Line was missing.
What is different from the patched versions is the included onnewscene.xml file.
I added this to onnewscene.xml file

Code: Select all

if(!Node.Exists("Status Line"))
return;
if(!Node.ConExists("Status Line", "Model"))
Node.ConCreate("Status Line", "Model", "string", 4);
Node.Value("Status Line", "Model") = "";
}
This gets installed to the Scripts\ScriptCommands folder.
It gets called every time a new scene is generated and the reset.js file also generates new scene.
I fixed the installer, if interested.
I am not sure how to include your new updates to the YafaRay4tS.RsObj though.
LOL :lol: Quoting myself.
Further testing, the only thing that seems not to work is Animation.

Looking at the lying FnSet error and trying to find the line in the script which is causing the error, it looks like what I have been reporting with the exporting/deleting/missing xml file.
Line 26 System.Trace("YafarayXMLFileFnSet Error: try catch error fix - close tS, delete xml file, open tS");
Just a huge guess on my part though.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

Errors with true abort of the rendering process.
A lot of little changes all over the place. Working, but could also be broken in a lot of places.
Attachments
YafaRay4tS8303.RsObj
(874.85 KiB) Downloaded 314 times
YafarayScripts0fbd.RsObj
(48.6 KiB) Downloaded 327 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Yay! :D
Think there is a problem with the Render XML button.
At first it works but second attempts the ConsoleObject does not show and the ConsoleObject's htmlcode attribute is not Reset.
Clear Alert in 10 seconds.PNG
Steps
Open Render XML button.RsScn
Select the Render XML button and wait for 10 seconds until the ConsoleObject's Alert closes automatically. (See ClearAlert below)
Select the Render XML button several times and look at the YafaRay4tS/ConsoleObject


Also included in this scene is a ClearAlert that is similar to your ClearStatus.
The attachment Clear Alert in 10 seconds.PNG is no longer available
Not fully tested with your new updates yet.
I commented out the con reset so you could see the above.
//Node.ConReset(Space.CurrentScene() + "/YafaRay4tS/ConsoleObject", "htmlcode")
Attachments
ConsoleObject Render XML.PNG
ConsoleObject Render XML.PNG (10.37 KiB) Viewed 9964 times
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Testing in unpatched Rosetta
Sunday, August 19, 2018 RC-29v3

ToDo - Set ConsoleFrame's OwnedBy = {2C152F81-45A2-4035-8896-9E49D60C8A7A}

Invaild file name - Does not run ClearStatus. Add "Render aborted"
Invalid File extension - Does not run ClearStatus and creates zero byte file. Add "Render aborted"

Use Custom XML Export file's File Dialog does not allow you to save the CustomTemp.xml if it does not exist. Uses tS Open dialog. Needs to be a Save As dialog if possible.
Other possible fix not related to the above, would be add (Export XML button code):
Activity.Run("%THIS_NAME%" + "/VersionCheck");
Activity.Run("%THIS_NAME%" + "/ExportXML");
to the Render XML button?

"External Viewer only works with TGA format files. Render aborted." Works but does not run ClearStatus.

If Yaf_CamPath is empty and a node (not Camera) is selected works as expected but does not change the Output - Render File to -> View. Also the Yaf_CamPath default setup use to have Camera as the default.

Use Custom Temporary Directory (enabled) does not render to C:\Temp\



Note: Does not run ClearStatus
In testing the ClearAlert mentioned in the previous post, I notice that it does not work where noted above. Mostly it works on other ConsoleObject alerts. (Closes the ConsoleFrame in 10 seconds)
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 19 Aug 2018, 15:56 Yay! :D
Think there is a problem with the Render XML button.
At first it works but second attempts the ConsoleObject does not show and the ConsoleObject's htmlcode attribute is not Reset.
ConsoleObject Render XML.PNG

Steps
Open Render XML button.RsScn
Select the Render XML button and wait for 10 seconds until the ConsoleObject's Alert closes automatically. (See ClearAlert below)
Select the Render XML button several times and look at the YafaRay4tS/ConsoleObject


Also included in this scene is a ClearAlert that is similar to your ClearStatus.
Clear Alert in 10 seconds.PNG
Not fully tested with your new updates yet.
I commented out the con reset so you could see the above.
//Node.ConReset(Space.CurrentScene() + "/YafaRay4tS/ConsoleObject", "htmlcode")
I don't like the idea of closing a dialog automatically. It should be closed by the user after it has been read.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

clintonman wrote: 19 Aug 2018, 18:46
trueBlue wrote: 19 Aug 2018, 15:56 Yay! :D
Think there is a problem with the Render XML button.
At first it works but second attempts the ConsoleObject does not show and the ConsoleObject's htmlcode attribute is not Reset.
ConsoleObject Render XML.PNG

Steps
Open Render XML button.RsScn
Select the Render XML button and wait for 10 seconds until the ConsoleObject's Alert closes automatically. (See ClearAlert below)
Select the Render XML button several times and look at the YafaRay4tS/ConsoleObject


Also included in this scene is a ClearAlert that is similar to your ClearStatus.
Clear Alert in 10 seconds.PNG
Not fully tested with your new updates yet.
I commented out the con reset so you could see the above.
//Node.ConReset(Space.CurrentScene() + "/YafaRay4tS/ConsoleObject", "htmlcode")
I don't like the idea of closing a dialog automatically. It should be closed by the user after it has been read.
Kinda figured you would say that. No problemo!
However for testing purposes I wonder whatever you do where it works you should do where it does not work.
Example where it does work is with the empty YafaRay path. So whatever you do there with your code, maybe do the same thing where it does not work. This all evolved from trying to figure out the Export XML issue.


Thinking ahead and NOT saying you should do this but it looks like you would be able to establish an YafaRay4ts User Preferences much like tS has.
ConsoleObject UI.PNG
ConsoleObject UI.PNG (7.26 KiB) Viewed 10133 times
Yaf user preferences.PNG
Yaf user preferences.PNG (9.29 KiB) Viewed 10133 times
Dialog settings could be on another YafaRay4tS aspect
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 19 Aug 2018, 18:53 ...
This all evolved from trying to figure out the Export XML issue.

...
And that issue is it doesn't work properly if run more than once? Are there any other factors like is the XML file valid or is the field blank?
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

Some fixes for the Export XML and Render XML buttons.

Export XML Button:

Code: Select all

var Errors = Node.AccessFnSet("%THIS_NAME%" + '/ErrorsFnSet');
Errors.Clear();
Activity.Run("%THIS_NAME%" + "/VersionCheck");
Activity.Run("%THIS_NAME%" + "/ExportXML");
Render XML Button:

Code: Select all

var Errors = Node.AccessFnSet("%THIS_NAME%" + '/ErrorsFnSet');
Errors.Clear();
Activity.Run("%THIS_NAME%" + "/Render");
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 19 Aug 2018, 18:32 ...Also the Yaf_CamPath default setup use to have Camera as the default.

...
The default can be whatever you like.

Unpatched tS new scene default is "Camera1"
Patched tS new scene default is "Camera"
YafaRay scene file has "Camera"
loading Yafaray Camera from the toolbar gives "YafaRay Camera"
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

YafaRay4tS node

fixed export xml button
fixed render xml button
added magic number to console frame owner attribute
Attachments
YafaRay4tSd804.RsObj
(875.09 KiB) Downloaded 319 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Using your code I think I found a way to delete the Yaf_render.cmd file by hooking up this script to the Render script.

Code: Select all

function StripPath(Str) {
	var pos = Str.lastIndexOf('\\');
	if (pos > 0)
		return Str.substring(0, pos + 1);
	return Str;
}

function Execute(params)
{
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	var Yaf_TempDir = Node.Value(System.ThisOwner() + '/Render', 'Yaf_TempDir');
	var CMD_Filename = Yaf_TempDir + 'Yaf_render.cmd';

	if (fso.FileExists(CMD_Filename)) {
		fso.DeleteFile(CMD_Filename, true);
	}

	var Yaf_RenderFilename = Node.Value(System.ThisOwner() + '/Render', 'Yaf_RenderFilename');
	var Yaf_RenderPath = StripPath(Yaf_RenderFilename);
	var Yaf_RenderPath = Yaf_RenderPath + 'Yaf_render.cmd';

	if (fso.FileExists(Yaf_RenderPath)) {
		fso.DeleteFile(Yaf_RenderPath, true);
	}

}
Delete CMD file.PNG
Delete CMD file.PNG (22.02 KiB) Viewed 10121 times
Need to add a params.SetTerminationFlag() to the Render script and or anything else you think it might need.
Render script.PNG
Render script.PNG (6.53 KiB) Viewed 10119 times
Testing in unpatched Rosetta, it works so far except when rendering an animation. Not a big deal, my only goal was deleting the Yaf_render.cmd for when you wanted to render an image to the Desktop. Can not image a user rendering an animation to the Desktop.


Well that was short lived. Ugh!
Rendering an animation with empty string in the YafaRay Installation Path throws an error.
Render Animation test with an empty YafaRay Installation Path .PNG

Edit: Nope, this ERROR exist with or with out the Delete CMD script
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Yafaray4tS v0.9.0

Post by trueBlue »

Testing in unpatched Rosetta

Monday, August 20, 2018 RC-29v4

ToDo
Add - Yaf_CamPath = "Camera" to ExportXML - OnDefaultValue
Add - "Camera" in the Yaf_CamPath to the YafaRay4tS.RsObj in the YafaRay4tS_Installer.RsObj
Add - Node.Value(Space.CurrentScene() + "/YafaRay4tS", "Yaf_CamChoice") = "0" (Line 190) in CameraFnSet
Note: (Line 76) does not work but the above does.

1.) This is not working:
"Use Custom temporary directory - Directory for storing generated XML file and temporary YafaRay output image. Default working directory is the same as the output image directory. Use this option if you want to use a different directory from the final image output directory."

2.) Is this working as expected?
"Use Custom XML export file - Use a custom filename and directory for the generated XML file. This is useful when generating multiple XML files for batch rendering or for rendering a previously generated XML file."

3.) Rendering an animation with empty string in the YafaRay Installation Path throws an error.
Render Animation test with an empty YafaRay Installation Path .PNG
4.) Output Render File with unsupported image format. Creates Yaf_render.cmd, yaf_temp.xml, and a file with zero bytes.
yaf_test bmp zero bytes.PNG
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Yafaray4tS v0.9.0

Post by clintonman »

trueBlue wrote: 20 Aug 2018, 18:48 Testing in unpatched Rosetta

Monday, August 20, 2018 RC-29v4

ToDo
Add - Yaf_CamPath = "Camera" to ExportXML - OnDefaultValue
Add - "Camera" in the Yaf_CamPath to the YafaRay4tS.RsObj in the YafaRay4tS_Installer.RsObj
Add - Node.Value(Space.CurrentScene() + "/YafaRay4tS", "Yaf_CamChoice") = "0" (Line 190) in CameraFnSet
Note: (Line 76) does not work but the above does.

1.) This is not working:
"Use Custom temporary directory - Directory for storing generated XML file and temporary YafaRay output image. Default working directory is the same as the output image directory. Use this option if you want to use a different directory from the final image output directory."

2.) Is this working as expected?
"Use Custom XML export file - Use a custom filename and directory for the generated XML file. This is useful when generating multiple XML files for batch rendering or for rendering a previously generated XML file."

3.) Rendering an animation with empty string in the YafaRay Installation Path throws an error.
Render Animation test with an empty YafaRay Installation Path .PNG

4.) Output Render File with unsupported image format. Creates Yaf_render.cmd, yaf_temp.xml, and a file with zero bytes.yaf_test bmp zero bytes.PNG
4.) fixed
3.) fixed
2.) looks ok to me
1.) looks like it's working to me

camera default set to "Camera"

CameraFnSet behaving as it should - please define the behavior you want to change or describe how it should work
Attachments
YafaRay4tSd46a.RsObj
(877.24 KiB) Downloaded 336 times
Clinton Reese

http://clintons3d.com

Return to “Rendering”