YafaRay for trueSpace 2019

LightWorks, VRay, Dribble, YafaRay and more..
User avatar
trueBlue
Captain
Posts: 2170
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: YafaRay for trueSpace 2019

Post by trueBlue » 12 Nov 2019, 17:37

Use Custom Temporary Directory - Path to the Custom 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.

Use Custom XML Export file - Use the File browse dialog button for selecting custom XML file export location.
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.

Export XML - Creates an XML file without rendering.

Render XML - Renders the Custom XML file or the last XML file that was generated.
The above is from the help file.
Not really sure how this is suppose to work, so I will leave it up to you that it is working as expected.

If when using the above options, and an image is suppose to render to these paths, it does not work.
It dose seem to render to the Output Render File path though.

There is one glitch when checking 'Delete XML file after render', and using the Render XML button on second attempt. It will produce a handled error.

Maybe the help file can be amended?

ExportXMLFnSet is using System.SetBusyCursor(true); in your code.
I can confirm that this is not working as you have said previously.
I would suggest removing this just incase it may be causing any problems.

User avatar
trueBlue
Captain
Posts: 2170
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: YafaRay for trueSpace 2019

Post by trueBlue » 12 Nov 2019, 20:25

RenderAnim2
Reseting the default values do not work on the Anim aspect nor the Render to File aspect for the following attributes

Code: Select all

function OnDefaultValue(params)
{
	conName = params.Param('conName');
	switch (conName)
	{
		case 'Start_Frame':
			params.Param('vtData') = 0;
			params.Param('bHandled') = true;
			break;

		case 'End_Frame':
			params.Param('vtData') = 0;
			params.Param('bHandled') = true;
			break;

		case 'Number_Start':
			params.Param('vtData') = 0;
			params.Param('bHandled') = true;
			break;

		case 'Zero_Padding':
			params.Param('vtData') = 3;
			params.Param('bHandled') = true;
			break;
	}

}
If you can get these to work, I would suggest that the End_Frame be set to 1
The reason why is, if there is no anmimation, it only renders one frame.
As is, it is set to 10. So if you select the Render Animation button, and if there is no animation, it renders 10 frames even though there is no animation.

Also if use Set from Keyframe and there is no animation, the End Frame is set to 0, which causes an error!
Line 29 = animEnd = 0;
Is Line 29 is wrong? Should it be set to animEnd = 1;

YafarayScripts/RenderAnimation
There is no code to render an animation in this script.
LMB = Loads the YafaRay4tS panel in the scene, if it does not exist, and opens the Anim aspect in the Stack.
RMB = Opens the Direct Lighting in the Stack.

In Vray
LMB = Opens it's Render to File
RMB = Opens the Vray panel in the Default aspect

Maybe YafaRay4tS should have the same behavior?
LMB = Opens it's Render to File and the Default Lighting panel in the Stack
RMB = Opens the YafaRay4tS panel in the Anim aspect

This seems to work:
RenderAnimation
Change
//UserInterface.OpenToolPanelViewEx2("" , "" ,Space.CurrentScene()+"/YafaRay4tS", 8, 1, 0);
OfflineRender.OpenPreferencesPanel()
Activity.Run(Space.CurrentScene() + "/YafaRay4tS/open panel");

User avatar
trueBlue
Captain
Posts: 2170
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: YafaRay for trueSpace 2019

Post by trueBlue » 12 Nov 2019, 20:31

YafaRay4tS/Render to File toolbar command
If there is no YafaRay4tS panel in the scene, the LMB and or the RMB command do not do anything.
I am going to change the commands as follows:
LMB

Code: Select all

if (!Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){if(Node.Exists("/Yafaray Folder")){Node.Copy("/Yafaray Folder/YafaRay4tS", Space.CurrentScene());}}Activity.Run(Space.CurrentScene() + "/YafaRay4tS/open panel");
RMB

Code: Select all

OfflineRender.OpenPreferencesPanel()

User avatar
trueBlue
Captain
Posts: 2170
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: YafaRay for trueSpace 2019

Post by trueBlue » 12 Nov 2019, 21:06

YafaRay4tS/Anim
Backup button script
Activity.Run("Scripts/CustomCommands/ProtectWorkspace/BackupButton")
Activity.Run( "Scripts/CustomCommands/ProtectWorkspace/Popup Panel/OpenPanelFrame")

Thinking ahead, what if a scene is shared without the ProtectWorkspace script installed?
The way it is presently noted above, it would produce an error!
You could include the ProtectWorkspace script with the scene.

Maybe something like this for the above script?

Code: Select all

var protectNode = "Scripts/CustomCommands/ProtectWorkspace";
var ScnProtectNode = Space.CurrentScene() + "/ProtectWorkspace";
if(Node.Exists(protectNode || ScnProtectNode))
{
Activity.Run("Scripts/CustomCommands/ProtectWorkspace/BackupButton")
Activity.Run("Scripts/CustomCommands/ProtectWorkspace/Popup Panel/OpenPanelFrame")
} else {
Activity.Run(Space.CurrentScene() + "/ProtectWorkspace/BackupButton")
Activity.Run(Space.CurrentScene() + "/ProtectWorkspace/Popup Panel/OpenPanelFrame")
}

User avatar
trueBlue
Captain
Posts: 2170
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: YafaRay for trueSpace 2019

Post by trueBlue » 12 Nov 2019, 21:14

YafModelspaceTest06.RsScn at your website has a few problems.
1.) The scene was saved with the python script assigned to the Scene
2.) NoName,1.RsObj Transparent D3D Preview needed to be reset and Protect Materials resaved.

Here is the scene with the above changes:

Also as a follow up, I confirmed that Workspace's Play Range is saved with the scene by trueSpace and has nothing to do with YafaRay4tS.
Attachments
YafModelspaceTest06.RsScn
(2.89 MiB) Downloaded 3 times

User avatar
trueBlue
Captain
Posts: 2170
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: YafaRay for trueSpace 2019

Post by trueBlue » 13 Nov 2019, 02:01

Suggestions:

Updates 11/15/2019:

YafarayScripts
Changed
Version 8

AnimationRender
Changed

Code: Select all

//UserInterface.OpenToolPanelViewEx2("" , "" ,Space.CurrentScene()+"/YafaRay4tS", 8, 1, 0);
OfflineRender.OpenPreferencesPanel()
Activity.Run(Space.CurrentScene() + "/YafaRay4tS/open panel");


YafaRa4tS

RenderAnim2
Changed End_Frame Default from 0

Code: Select all

case 'End_Frame'
params.Param('vtData') = 1;
Note: Fixed the Defaults by re exporting and re applying the LINKS to the Anim and Render to File aspects

Changed

Code: Select all

Errors.Add("End Frame must be greater then the Start Frame. Rendering Animation has been canceled");
if(!Question(numFrames + " - XML files will be created because\nDelete XML files after render\nis not Enabled\n\nWould you like to continue?")) {
Add

Code: Select all

	if(Node.Exists("/Status Line"))
		if(!Node.ConExists("/Status Line", "YafaRay"))
		Node.ConCreate("Status Line", "YafaRay", "string", 4);
		Node.Value("/Status Line", "YafaRay") = "Model Processing is not supported and has been disabled"
		Activity.Run(Space.CurrentScene() + "/YafaRay4tS/ClearStatus")

		System.Alert("Batch Render will start now...");
About
Changed
Version 0.9.8

AboutBitmap
Changed
Version 0.9.8
Date 11/14/2019

Render
Changed 'Adds a little more time to the status message'

Code: Select all

//Node.ConRemove("/Status Line", "YafaRay")
Activity.Run(Space.CurrentScene() + "/YafaRay4tS/ClearStatus")
endAniamtion
Changed 'Adds a little more time to the status message'

Code: Select all

//Node.ConRemove("/Status Line", "YafaRay")
Activity.Run(Space.CurrentScene() + "/YafaRay4tS/ClearStatus")

Code: Select all

System.Alert("Model Mesh Processing - Render complete\nWARNING!\nSwitching layouts will crash trueSpace if you do not Exit trueSpace first")
Anim
Backup button
Changed

Code: Select all

var protectNode = "Scripts/CustomCommands/ProtectWorkspace";
if(Node.Exists(protectNode))
{
Activity.Run("Scripts/CustomCommands/ProtectWorkspace/BackupButton")
Activity.Run("Scripts/CustomCommands/ProtectWorkspace/Popup Panel/OpenPanelFrame")
}
Restore buttton
Changed

Code: Select all

var protectNode = "Scripts/CustomCommands/ProtectWorkspace";
if(Node.Exists(protectNode))
{
Activity.Run("Scripts/CustomCommands/ProtectWorkspace/RestoreButton")
}
Cancel Render button 'changed to an On/Off button'

Create XML files and start Batch Render 'changed wording'

Setup
Changed the viewer(s) check boxes to On/Off buttons

Note: Changed the Disable All Viewers button to a On/Off button and linked it to the useRendertoFile attribute.
So if you enable the Disable All Viewers button when using Render to File, no viewers will spawn.

Set from Keyframe 'If there is no animation, the End Frame is set to 0, which causes an error!'
Changed Line 29 = animEnd = 0;
Line 29 = animEnd = 1;

ExportXMLFnSet
Comment
//System.SetBusyCursor(true);
//System.SetBusyCursor(false);

RenderFrame
Add var to

Code: Select all

Yaf_UseInternalViewer = Node.Value(System.ThisOwner() + '/UIstate', "Yaf_UseInternalViewer") ;
Yaf_UseCustomViewer = Node.Value(System.ThisOwner() + '/UIstate', "Yaf_UseCustomViewer");
Yaf_UseCustomViewer = Node.Value(System.ThisOwner() + '/UIstate', "Yaf_CustomViewer");
Note: Batch Render error undefined line 145




YafaRay4tS Scene Utilities
Update YafaRay Render Node
Add

Code: Select all

Node.Value(Destination, "useRenderToFile") = true;

Code: Select all

UserInterface.OpenToolPanelViewEx2("" , "" ,Space.CurrentScene()+"/YafaRay4tS", 6, 1, 0);
Space.Select(Space.CurrentScene()+"/YafaRay4tS") 
Process Imported Scene
Add

Code: Select all

UserInterface.OpenToolPanelViewEx2("" , "" ,Space.CurrentScene()+"/YafaRay4tS", 6, 1, 0);
Space.Select(Space.CurrentScene()+"/YafaRay4tS") 



YafaRay4tS Setup library
SynchronizeWorkspace.RsObj

Synchronize Workspace with Model

Yafaray EntryPoint Camera
When the scene loads the view will switch
to this Camera's view.
In the YafaRay4tS/Camera aspect,
with this camera selected,
select the Set Camera button when
rendering from a Camera View.
In Model select View From Object.




YafaRayBar
Render to File
Changed
LMB

Code: Select all

if (!Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){if(Node.Exists("/Yafaray Folder")){Node.Copy("/Yafaray Folder/YafaRay4tS", Space.CurrentScene());}}Activity.Run(Space.CurrentScene() + "/YafaRay4tS/open panel");
RMB

Code: Select all

OfflineRender.OpenPreferencesPanel()
Attachments
Screenshot.png

clintonman
Captain
Posts: 2922
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: YafaRay for trueSpace 2019

Post by clintonman » 14 Nov 2019, 08:00

trueBlue wrote:
12 Nov 2019, 21:14
YafModelspaceTest06.RsScn at your website has a few problems.
1.) The scene was saved with the python script assigned to the Scene
2.) NoName,1.RsObj Transparent D3D Preview needed to be reset and Protect Materials resaved.

Here is the scene with the above changes:

Also as a follow up, I confirmed that Workspace's Play Range is saved with the scene by trueSpace and has nothing to do with YafaRay4tS.
Uploaded to the website, thanks.
Clinton Reese

http://clintons3d.com

clintonman
Captain
Posts: 2922
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: YafaRay for trueSpace 2019

Post by clintonman » 14 Nov 2019, 08:11

trueBlue wrote:
12 Nov 2019, 17:15
...
The only thing I notice is when NOT using the Viewer buttons, but using the check boxes, the viewers do not spawn in some cases. Never the less everything still renders without errors!
As an example, uncheck all of the viewer options except the OptDetector Viewer.
...
Actually, changing the check boxes Type to On/Off buttons works better IMHO.
Right, I just put what seemed like the most desirable outcome based on the checkbox choices. So if Optdetector is the only thing checked, it assumes internal render is wanted and "checks" it behind the scenes. Some cases may be better to have some kind of message or question. 3 checkboxes plus the external renderer translates to 16 possible combinations. I worked it out with a spreadsheet so the 16 is reduced down to the 3 buttons plus external definition. The only case that gives an error is an invalid external renderer. It's the one thing that can't be guessed at.

Not in love with the toggle buttons, but it's really no worse than the checkboxes.
Clinton Reese

http://clintons3d.com

clintonman
Captain
Posts: 2922
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: YafaRay for trueSpace 2019

Post by clintonman » 14 Nov 2019, 08:24

trueBlue wrote:
12 Nov 2019, 17:37
Use Custom Temporary Directory - Path to the Custom 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.

Use Custom XML Export file - Use the File browse dialog button for selecting custom XML file export location.
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.

Export XML - Creates an XML file without rendering.

Render XML - Renders the Custom XML file or the last XML file that was generated.
The above is from the help file.
Not really sure how this is suppose to work, so I will leave it up to you that it is working as expected.

If when using the above options, and an image is suppose to render to these paths, it does not work.
It dose seem to render to the Output Render File path though.

There is one glitch when checking 'Delete XML file after render', and using the Render XML button on second attempt. It will produce a handled error.

Maybe the help file can be amended?

ExportXMLFnSet is using System.SetBusyCursor(true); in your code.
I can confirm that this is not working as you have said previously.
I would suggest removing this just incase it may be causing any problems.
The image only renders to the selected render path.
I have no idea why there would be a temporary image in the custom directory.
Use Custom XML Export is for directly rendering a preexisting xml file instead of the normal process of generation then rendering. I'm guessing the export xml is useful only for developers.
Can you explain the glitch more?
Are the steps:
Delete XML file after render
Render
Render XML
Render
Render and get Error
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 2170
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: YafaRay for trueSpace 2019

Post by trueBlue » 14 Nov 2019, 14:48

clintonman wrote:
14 Nov 2019, 08:11
trueBlue wrote:
12 Nov 2019, 17:15
...
The only thing I notice is when NOT using the Viewer buttons, but using the check boxes, the viewers do not spawn in some cases. Never the less everything still renders without errors!
As an example, uncheck all of the viewer options except the OptDetector Viewer.
...
Actually, changing the check boxes Type to On/Off buttons works better IMHO.
Right, I just put what seemed like the most desirable outcome based on the checkbox choices. So if Optdetector is the only thing checked, it assumes internal render is wanted and "checks" it behind the scenes. Some cases may be better to have some kind of message or question. 3 checkboxes plus the external renderer translates to 16 possible combinations. I worked it out with a spreadsheet so the 16 is reduced down to the 3 buttons plus external definition. The only case that gives an error is an invalid external renderer. It's the one thing that can't be guessed at.

Not in love with the toggle buttons, but it's really no worse than the checkboxes.
You did a great job on the updates for the viewers!
Especially that Disable All Viewers actually works and does not switch off!
Some cases may be better to have some kind of message or question.
I did not see any need for this! Unless I am missing something?
So if Optdetector is the only thing checked, it assumes internal render is wanted and "checks" it behind the scenes
This did not work for me. Meaning that the Internal Viewer was not being checked and the iOptDetector Viewer did not spawn. I had to manually check both viewers to get the iOptDetector Viewer to spawn.
Which is why I am suggesting the toggle buttons.
All of the toggle buttons use your new command(s).
Only differences is the iOptDetector Viewer enables the Internal Viewer.
And I had to changed the Disable All Viewers button to a On/Off button and linked it to the useRendertoFile attribute.
So if you enable the Disable All Viewers button when using Render to File, no viewers will spawn.
More testing is needed, but this was the only way I could get the Render to File to work with no viewers.
Now that I understand your viewer button scripts, and the above modifications to the Disable All Viewers, need to add
Node.Value(yafNode, "useRenderToFile") = false;
to the scripts.

Post Reply