Yafaray4tS v0.9.0

LightWorks, VRay, Dribble, YafaRay and more..
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: 03 Jul 2018, 16:36
clintonman wrote: 03 Jul 2018, 07:18 Lights are ready.

Changes:

Changed attenuation values for ies light, spotlight, point light, sphere light and area light
changed default power for some lights
Changed the power multiplier in the preview:
ies light = 4 * sqrt(power)
spotlight = 4 * power
pointlight = 2 * power
spherelight = 2 * power * scale
arealight = power * (scaleX + scaleY)/2

sphere size exports the scale value instead of the size attribute
new integrated ies light generator - GenerateIESprofileScript node in YafaRayFolder not used anymore
Testing the Resets
Want to confirm that this is correct or not.
Infinite, Point, and Area 'Cast Shadow' - Reset is unchecked?
Sun and Sphere 'Cast Shadow' - Reset does not Reset checked or unchecked?
Directional, Spot, and IES Spot 'Cast Shadow' - Reset is checked?
Directional 'Size' Reset is 0.785
If it is important I can put a jScriptObject in between.
params.Param('vtData') = true;
Attachments
Capture.PNG
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 »

In your ToDo list before you released the Lights, you mentioned that the Size attribute needed to be added to the Default aspect on the Sphere light. It is not there. Do you want me to add it?
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: 04 Jul 2018, 00:52 In your ToDo list before you released the Lights, you mentioned that the Size attribute needed to be added to the Default aspect on the Sphere light. It is not there. Do you want me to add it?
Nope, "sphere size exports the scale value instead of the size attribute", so size isn't read by the exporter anymore.
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 updates today

changed default solid color background to trueSpace blue

altered the Yafaray Node Camera defaults to angle=90, max angle=90, mirror=false, circular=false

added a valid texture file type check to the materials, specifically the Map node

added an error system to the render process - now just has the same valid texture check as the materials

next need the same texture checks for animation render
Clinton Reese

http://clintons3d.com
User avatar
the_ant
Chief Petty Officer
Posts: 155
Joined: 02 Jun 2009, 09:26
Type the number ten into the box: 0
Location: Perugia - Italy

Re: Yafaray4tS v0.9.0

Post by the_ant »

Hi Clintonman and trueBlue... :worship: :worship:

while I admire your hard-work on this plugin I would like to know if there is a comparision scheme "vRay vs YafaRay" (tSp versions).

The question : will YafaRay-renders be better of vRay-renders ?

:bananahi: :bananahi:
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_ant wrote: 04 Jul 2018, 11:54 Hi Clintonman and trueBlue... :worship: :worship:

while I admire your hard-work on this plugin I would like to know if there is a comparision scheme "vRay vs YafaRay" (tSp versions).

The question : will YafaRay-renders be better of vRay-renders ?

:bananahi: :bananahi:
Here is a quote from one of the original creators of YafaRay4tS
Jack Edwards wrote: 10 Jun 2009, 03:21 ...

As far as comparison goes, I'd say that a big advantage for YafaRay is that it's glass material actually works, where as tsVRay has some problematic bugs related to glass. On the other hand VRay is definitely faster and has an SSS shader.

As far as render quality goes, it's really about learning the render engines. You can do professional work in both.
This was a comparison of an older version of YafaRay. I don't know how VRay compares to the newer version of YafaRay and I don't know if the glass problem in VRay was ever addressed.
Clinton Reese

http://clintons3d.com
User avatar
the_ant
Chief Petty Officer
Posts: 155
Joined: 02 Jun 2009, 09:26
Type the number ten into the box: 0
Location: Perugia - Italy

Re: Yafaray4tS v0.9.0

Post by the_ant »

Thanks a lot...fast and clear answer...as usual! :bananacheers:
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 »

Putting together a trueSpace Update 4 with YafaRay4tS beta, which will include new trueSpace lights with your Color Picker, new Yafaray toolbar, and new Yafaray libraries. Most likely very late tonight or early tomorrow.
Do you have a trueSpace version of your new IES Spot?
Guessing but it looks like I can remove the Yafaray stuff from the Yafaray IES Spot and that would work with tS?
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 Installer RC-1

changes:
updated installer with changes
fixed background preview scale slider to not use negative numbers
error message if render width or height is less than 1 pixel
check for and error if animation start frame is greater than the end frame
render animation abort with "esc" key give error message and clear status via timer
removed IES generator script, function included in each yafaray ies light
light brightness adjustment for whole scene - used for lighting models that depend on bounced light which, purpose is to match the rendered result and is purely a visual effect
Attachments
YafaRay4tSv090-rc-1.zip
(4.8 MiB) Downloaded 377 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 »

First sharable scene is ready. Others will be added soon.

absorbscatter-2spot - demo of volumetrics
outdoors - path tracing and sunsky lighting - shapes outside
glossyasdiffuse - supposed to demo some feature that doesn't exist, cornel box
glass - yafaray glass material
max3dKuchnia - kitchen scene
alphaint_mappaing - alpha intensity mapping leaf

http://clintons3d.com/plugins/truespace ... faray.html
Last edited by clintonman on 06 Jul 2018, 04:41, 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 »

Found a problem with the installer. Fixed in RC-2
Attachments
YafaRay4tSv090-rc-2.zip
(4.8 MiB) Downloaded 209 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 »

Nice work on all of the changes Clinton!
I tried RC-1, I did not see any problem with the installer.
Except for the access file error with or without the libraries opened. Always have to select the Install button twice.
I did see a problem with a couple of lights though.
I think it was the infinite or Point default aspect color picker, I forget now.
But the Directional Color aspect image color picker was missing the code.
I have updated your installer with the lights, new toolbar buttons, and libraries.
Changes:
Added a Render to File icon.
Added more commands to some of the toolbar buttons
Iconized the Material library
Light's Edge opacity lowered to 0.100
Added an error check if string is empty to the IES Spot Generate IES Preview button
Camera has been fixed and updated
Added Status message to the Reset Defaults and Save Settings.
Added the following line to the YafarayScripts/RenderObject.

Code: Select all

if (Node.FirstSelected() == "") {return;}if (Node.IsLight('')) {return;}if (Node.IsCamera('')) {return;}if (!Node.ConExists(Node.FirstSelected(), 'ObjMatrix')) {return;}
Let me know if you are okay with the changes so that we are in sync with the Update 4.
It's up to you if you want to include the materials or not.
New toolbar.PNG
New toolbar.PNG (33.52 KiB) Viewed 4926 times
New libraries.PNG
New libraries.PNG (58.58 KiB) Viewed 4926 times
Also not included. I have a better RenderObject Zoom 2 Object, if interested.
Edit: Removed due to update
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: 06 Jul 2018, 05:32 Nice work on all of the changes Clinton!
I tried RC-1, I did not see any problem with the installer.
Except for the access file error with or without the libraries opened. Always have to select the Install button twice.
I did see a problem with a couple of lights though.
I think it was the infinite or Point default aspect color picker, I forget now.
But the Directional Color aspect image color picker was missing the code.
I have updated your installer with the lights, new toolbar buttons, and libraries.
Changes:
Added a Render to File icon.
Added more commands to some of the toolbar buttons
Iconized the Material library
Light's Edge opacity lowered to 0.100
Added an error check if string is empty to the IES Spot Generate IES Preview button
Camera has been fixed and updated
Added Status message to the Reset Defaults and Save Settings.
Added the following line to the YafarayScripts/RenderObject.

Code: Select all

if (Node.FirstSelected() == "") {return;}if (Node.IsLight('')) {return;}if (Node.IsCamera('')) {return;}if (!Node.ConExists(Node.FirstSelected(), 'ObjMatrix')) {return;}
Let me know if you are okay with the changes so that we are in sync with the Update 4.
It's up to you if you want to include the materials or not.
...
Also not included. I have a better RenderObject Zoom 2 Object, if interested.
Installer was based on old versions so had to pick and choose and add to the latest which has all the bug fixes.
"Except for the access file error with or without the libraries opened. Always have to select the Install button twice." - don't know this one
"Camera has been fixed and updated" - don't know what was broken. I think I added it to the new installer but not sure
Camera button was not working - fixed it
Removed all texture based materials - only valid in tS761 not tS761Std
Texture Bump Transparency didn't work at all here. You should fix this one and add them all to the UnOfficial Update for tS761(not Std unless you recreate for it)
Changed IES light to have a preview again and provided more robust error messages
Replaced the out of date Map node used for texturing materials

Render Object changes not included. Do another based on this latest if you want to have it in there. Your stuff was based on an old version and it was getting tricky to separate the old from the new.

changed the way the "Save Settings" button works. Before it would destroy the old and replace with new. Problem was an old version could completely replace a newer version. Now the values are copied and then the node is saved.

RC-4 is attached with most of the changes from rc-2 and RC-2 included.
Attachments
YafaRay4tSv090-rc-4.zip
(4.89 MiB) Downloaded 252 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 »

Not sure if you understood what the YafaRay4tS toolbar.RsObj in the Yafaray Setup library is for. It's purpose is to reopen the toolbar incase a user closes it. The one you included in your last installer loaded an old prototype toolbar node in the scene.

The YafaRay4tS.RsScn and light setup in your last installer had the old lights and camera. Using your scene light's location and values, I updated them with the new lights. There is a big difference with the amount of light in the scene with the new lights. It is darker. I am pretty sure it has to do with the Attenuation changes.

I updated your installer with your Reset Toobar scripts.
Also uploading the YafaraySscripts.RsObj that you can try. There is notes inside. Still does not work very well in Camera View.
Edit: Removed due to update
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 »

RenderToFilePanelBad.jpg
Image of popup panel and yafaray4ts render to file aspect

Bug: The Render to File popup will update values but not display the updated values. May have to give up on the popup panel idea. :(
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 »

Found solution for Render to File popup dialog :)

inside YafaRay4tS/open panel node
changed
Node.Value(r2f, "RootNode") = r2f;
to
Node.Value(r2f, "RootNode") = System.ThisOwner();
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: 07 Jul 2018, 02:46 ...
Also uploading the YafaraySscripts.RsObj that you can try. There is notes inside. Still does not work very well in Camera View.
Your YafarayScripts is old. If the change is an improvement add it to the attached scripts.
Attachments
YafarayScripts3ad7.RsObj
(50.49 KiB) Downloaded 269 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 »

Bug: TIF files will render but cannot be displayed inside trueSpace

YafaRay4tS/DoFrameRender added lines to check for and alert:

Code: Select all

var useInternal = Node.Value(owner, "Yaf_UseInternalViewer");
if(useInternal && fileExt.toLowerCase() == "tif") {
    Errors.Add("Warning: TIF files will not display inside trueSpace" )
}
YafaRay4tS/RenderAnim2 added lines to alert the user

Code: Select all

var fs = new ActiveXObject("Scripting.FileSystemObject");
var fileExt = fs.GetExtensionName(oldFN);
var useInternal = Node.Value(owner, "Yaf_UseInternalViewer");
if(useInternal && fileExt.toLowerCase() == "tif") {
    System.Alert("Warning: TIF files will not display inside trueSpace" );
}
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 Jul 2018, 06:02
trueBlue wrote: 07 Jul 2018, 02:46 ...
Also uploading the YafaraySscripts.RsObj that you can try. There is notes inside. Still does not work very well in Camera View.
Your YafarayScripts is old. If the change is an improvement add it to the attached scripts.
Here it is, still does not work as expected in Camera View. (Does not Zoom in like the View does)
You will need to add a button to the Render to File to save the image.
As it is now it renders the scene.
From what I can tell it looks like you need to save the Convert Format bitmap in case the OptDetector Viewer is being used?

Found solution for Render to File popup dialog

inside YafaRay4tS/open panel node
changed
Node.Value(r2f, "RootNode") = r2f;
to
Node.Value(r2f, "RootNode") = System.ThisOwner();
Probably need to do the same to the Open Render Passes too.
I have added the RenderPassList.txt to both tS761B84 and tS761B8Std4
Using your code to open YafaRay4tS Help you could add it to the RenderPass panel

Code: Select all

WshShell = new ActiveXObject("WScript.Shell");
help = 'file:///' + System.GetMainDir() + '\/RenderPassList.txt';
//change all \ to /
var re;
re = /\\/g;
help2 = help.replace(re,"\/");
WshShell.Run(help2);
Also including the SupportFiles folder to tS761B8Std4 for the IES Spot light.
Edit: Removed due to update
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 »

Changed Blend Material Collection - was using old materials, red numbers where only on the first 2 materials, changed default to a shiny diffuse material

bug - reset default settings not working - fixed the bug and moved the code to a command node YafaRay4tS/ResetToDefaults

Code: Select all

function Execute(params)
{
	var CONFLG_IN = 4
	var CONFLG_HIDDEN = 32

	var utilitydata = System.CreateDO("Clintons3D Package/Utility functions");

	var yafNode = Space.CurrentScene() + "/YafaRay4tS";
	var thedata = utilitydata.GetConnectorData(yafNode );
	var 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))
			Node.ConReset(yafNode, connector[0])
	}
	Activity.Run(yafNode + "/Watch Dog Event");
}
bug - procedural type material textures were giving a false error - MaterialsFnSet about line 118

Code: Select all

if (data.ShaderAspect == 0) {
    if(Errors.AddIfImageExtensionBad(data.FileName)) {
        System.Trace("Texture file error for " + data.FileName);
    }
    File.WriteLine('\t<type sval="image"/>');
    if (data.textureType != "bump")
        File.WriteLine('\t<gamma fval="' + data.gamma + '"/>');
    File.WriteLine(' \t<filename sval="' + data.FileName.replace(/\\/g, '/') + '"/>');
    if (data.textureType == "bump" && data.isnormalmap)
        File.WriteLine('\t<normalmap bval="true"/>');
}
bug - BlendMaterial preview had old code for fixing the procedural texture direction - not needed anymore and incorrect now, so removed negative U processing
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 »

Sample scenes are done. Including a blend material demo.

http://clintons3d.com/plugins/truespace ... faray.html

Some have slightly older versions of lights and materials.
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 »

Fixed bug in renderpass floating panel
Thanks for the heads up.

Code: Select all

function Execute(params)
{
	WindowsManager.CloseWindow("Project/Windows Manager Space/RP_PanelFrame")
	var rpf = Space.CurrentScene() + "/YafaRay4tS/RP_PanelFrame";

	if (Node.Exists(rpf))
	{
		//Node.Value(rpf, "RootNode") = rpf;
		Node.Value(rpf, "RootNode") = System.ThisOwner();
		Node.Value(rpf + "/Panel Node", "PanelEditorNode") = Space.CurrentScene() + "/YafaRay4tS/RenderPasses";
		Node.Copy(rpf, "/Project/Windows Manager Space");
		WindowsManager.Activate();
		WindowsManager.UpdateWindowsStructure();
	}
}
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 »

Render to object has strange behavior.
First several times a tried it I got error messages then the render to file panel opens, now it renders the file then shows the render to file panel.
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 »

Strange how that works! I have been using this for several weeks now with no errors.
I did mention that the Render to file does not work with this version.
Oh well, I tried. :cry:
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 »

plainObjectMode.jpg
new object render mode - left full image, right object only

Added Object Render Mode, which gives choice between "view zoom and render" and "no camera change with render selected item only". May add some other options later.
YafaRay4tS/ExportXMLFnSet around line 46:

Code: Select all

//plain object render = 4, tB object render = 2, object flag = 1, scene flag = 0
if (Node.IsRenderable(CurrentNode) && objectRenderMode == 5 && selectedNode == CurrentNode) {
    MeshFn.ExportMesh(CurrentNode);
    return false;
}

if (Node.IsRenderable(CurrentNode) && objectRenderMode == 3) {
    MeshFn.ExportMesh(CurrentNode);
    return false;
}

if (Node.IsRenderable(CurrentNode) && (objectRenderMode & 1) == 0) {
    MeshFn.ExportMesh(CurrentNode);
    return false;
}
YafarayScripts/RenderObject where RenderObjectOnly(params) is just a copy of the RenderScene node. This still needs to validate the selection.

Code: Select all

	//update render flag to object mode
	var objectRenderMode = Node.Value(Space.CurrentScene()+"/YafaRay4tS", "objectRenderMode");
	objectRenderMode = objectRenderMode | 1;
	Node.Value(Space.CurrentScene()+"/YafaRay4tS", "objectRenderMode") = objectRenderMode;

	if(objectRenderMode == 5) {
		RenderObjectOnly(params);
		return;
	}
	//if objectRenderMode is 3 then tB approach
YafarayScripts/RenderScene, YafarayScripts/RenderArea, YafarayScripts/RenderAnimation all start with:

Code: Select all

	//update render flag to scene mode
	var objectRenderMode = Node.Value(Space.CurrentScene()+"/YafaRay4tS", "objectRenderMode");
	objectRenderMode = objectRenderMode & 6;
	Node.Value(Space.CurrentScene()+"/YafaRay4tS", "objectRenderMode") = objectRenderMode;
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 »

Great! I knew you could come up with something 100 times better. By all means remove what I did. Do not like the window switching at all!

Could you please send all of the updates so I can try it out?

Does it work with the Render to File?
R2F.PNG
R2F.PNG (10.45 KiB) Viewed 5023 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 »

RC-6 installer attached below
trueBlue wrote: 08 Jul 2018, 13:04 Great! I knew you could come up with something 100 times better. By all means remove what I did. Do not like the window switching at all!

Could you please send all of the updates so I can try it out?

Does it work with the Render to File?

...
It works with the Render to File, no extra button
Did not remove the zoom and render yet
object render mode shows as 2 unlabeled radio buttons on the default tab. the value is an integer but user can only set 2 meaningful states: 4=object only, 2=zoom and render


TODO:
make sure valid object selection for object render
maybe make a default for yafaray installed inside the truespace folders - current defaults are for Program Files, Blender 2.79 and BForArtists 1.0 and is hard coded for yafaray v3.x
more object modes? - has hooks in place for expansion
Attachments
YafaRay4tSv090-rc-6.zip
(6.69 MiB) Downloaded 228 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 »

Very nice!
clintonman wrote: 08 Jul 2018, 14:48 RC-6 installer attached below
It works with the Render to File, no extra button
Did not remove the zoom and render yet
object render mode shows as 2 unlabeled radio buttons on the default tab. the value is an integer but user can only set 2 meaningful states: 4=object only, 2=zoom and render
Do you notice that Radio buttons do not show as active after you set either or and use it?
Radio buttons.PNG
Radio buttons.PNG (2.15 KiB) Viewed 5011 times
clintonman wrote: 08 Jul 2018, 14:48 TODO:
make sure valid object selection for object render
Don't you already have this in place?
If you notice I added the following...
RenderObject script:

Code: Select all

if (Node.FirstSelected() == "") {return;}if (Node.IsLight('')) {return;}if (Node.IsCamera('')) {return;}if (!Node.ConExists(Node.FirstSelected(), 'ObjMatrix')) {return;}
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 »

I know I am repeating myself but this is a recurring problem for me every time!
For whatever reason this installer produces this error and I have to run it twice.
Does not matter if the libraries is opened or not.
YafaRay4tS Setup folder error.PNG
YafaRay4tS Setup folder error.PNG (9.96 KiB) Viewed 5016 times
After this error, I can see that the YafaRay4tS Setup library is deleted in the Library Stack.
Run the Install again and it is successful without error.
It seems to be only the YafaRay4tS Setup library that causes the error.

I have modified the installer (Only the YafaRay4tS Setup library portion) with this and it has worked without an error several times today.

Code: Select all

try {
if (fso.FolderExists(tS + 'Rs Main Libraries\\YafaRay4tS Setup'))
	fso.DeleteFolder(tS + 'Rs Main Libraries\\YafaRay4tS Setup')
	fso.CopyFolder(YafaRay4tSv075 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
	} catch(err) {
	fso.DeleteFolder(tS + 'Rs Main Libraries\\YafaRay4tS Setup')
	fso.CopyFolder(YafaRay4tSv075 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
}
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 Jul 2018, 16:43 ...
Do you notice that Radio buttons do not show as active after you set either or and use it?
Radio buttons.PNG
That's by design. User sets the initial value then the value is controlled by Yaf4tS depending on what button is pressed. Value is 4 or 2. When rendering it changes to 5 or 3 if object render then back to 4 and 2 for scene render.

trueBlue wrote: 08 Jul 2018, 16:43 ...
Don't you already have this in place?
If you notice I added the following...
RenderObject script:

Code: Select all

if (Node.FirstSelected() == "") {return;}if (Node.IsLight('')) {return;}if (Node.IsCamera('')) {return;}if (!Node.ConExists(Node.FirstSelected(), 'ObjMatrix')) {return;}
Saw it, need to change it a little to give user feedback. That line above is in the "zoom and render" portion so I didn't touch it at all.
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 Jul 2018, 17:36 I know I am repeating myself but this is a recurring problem for me every time!
For whatever reason this installer produces this error and I have to run it twice.
Does not matter if the libraries is opened or not.
YafaRay4tS Setup folder error.PNG
After this error, I can see that the YafaRay4tS Setup library is deleted in the Library Stack.
Run the Install again and it is successful without error.
It seems to be only the YafaRay4tS Setup library that causes the error.

I have modified the installer (Only the YafaRay4tS Setup library portion) with this and it has worked without an error several times today.

Code: Select all

try {
if (fso.FolderExists(tS + 'Rs Main Libraries\\YafaRay4tS Setup'))
	fso.DeleteFolder(tS + 'Rs Main Libraries\\YafaRay4tS Setup')
	fso.CopyFolder(YafaRay4tSv075 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
	} catch(err) {
	fso.DeleteFolder(tS + 'Rs Main Libraries\\YafaRay4tS Setup')
	fso.CopyFolder(YafaRay4tSv075 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
}
I very much prefer that you do repeat yourself. In this case either: You mentioned it so I thought you fixed it or I didn't know what you were talking about the first time or It was changed but the change got lost in the exchanges between us etc. etc.
I'll try to find the reason for the error and failing that will add the changes as shown above. I want to find the reason for the potential case where someone has to run it 3 or 4 times to avoid the error.
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 good because I was not understanding if I get the error certainly somebody would as well.
I made the change mentioned in the installer as well as changed the format of the Alerts.
Also been wanting to change the Background attributes as shown
Backround.PNG
Backround.PNG (2.5 KiB) Viewed 4462 times
Changed the Default and Setup aspect, mostly with the Output Render File, adding the View and Camera.
Would also like to make the Output Render File area the same through out.
Setup.PNG
Default.PNG
The new Render Object works good. You can also use tS's Zoom to Selection widget before using it.

Here also is:
tS7.61B8.4_YafaRay4tS9_RC_1.exe 33.3 MB
New Yafaray Folder and YafarayScripts RC-7 - 7/8/2018 with the above changes.
New tS and Yafaray lights with color picker
New YafaRay4tS toolbar and Libraries
Added Yafaray scene images to Texture folder
Add RenderPassList.txt to tS folder
Addded yaf_test.jpg, yaf_test.png, and yaf_test.tga tS/Image Folder

Also have tS761B8Std4 ready with the above additions.
Including adding the SupportFiles folder for the IES Spot light
Removed due to update
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 Jul 2018, 19:18 ...
Also been wanting to change the Background attributes as shown
Backround.PNG
Changed the Default and Setup aspect, mostly with the Output Render File, adding the View and Camera.
Would also like to make the Output Render File area the same through out.
...
Looks good.

The background attributes won't work like that since transparent and transparent material refraction are related. They have to be grouped or on the same line to have meaning. In the images below it's difficult to see the difference between enabled and disabled (poor color choice by the Blender guys).
TranspBGdisabled.jpg
transparency off and material refraction disabled
-
-
TranspBGenabled.jpg
transparency on and material refraction enabled
-
-
Don't know why you didn't just make the render section the same, cause I don't see any issues, it looks real good to me.
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 »

My TODO list

object selected check for object render
investigate yafaray install inside ts for one of the defaults
convert the modelspace virtualight cautics scene
"fake reflections" - may not do this at all, uses camera to make cube map and simulate reflections, maybe a lot of work will see
easier blend material collection selection process?
TB post 18 May 18:07 title investigate
TB post 14 Jun 3:23 shrink play range - maybe a separate button, for object render only look at object keyframes
check the material converter
TB post 14 Jul 8 10:36 - installation error - investigate
after object render switch back to scene render so yaf4ts render buttons are predictable

to expand on the shrink play range - I see it as a separate button because of the possibility of animations based on scripts without keyframes or running animations in modelspace but rendered in yafaray workspace
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 »

Is this better?
Background2.PNG
Background2.PNG (5.25 KiB) Viewed 4467 times
Went ahead and made all of the Output Render File the same through out.
You do not have to use it but found that I was always switching back and forthlooking for the
Render View or Camera View. It's like where is that again?
Edit: Removed due to update
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 Jul 2018, 00:53 Is this better?
Background2.PNG
Went ahead and made all of the Output Render File the same through out.
You do not have to use it but found that I was always switching back and forthlooking for the
Render View or Camera View. It's like where is that again?
Yep, looks good.

Yeah, me too, should be more convenient now.

Looks like the Direct Lighting tab has Camera/View selection messed up - looks like both options are view
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 Crap!
Thanks!
Fixed on my end.
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 »

object render valid check

top of YafarayScripts/RenderObject

Code: Select all

if(invalidSelection()) {
    System.Alert("No valid object is currently selected. Render Aborted.")
    return;
}
near top YafarayScripts/RenderObject - set flag back to scene mode
code change did not work and maybe just as well, because possible to render animation of single object

bottom of YafarayScripts/RenderObject

Code: Select all

function invalidSelection()
{
    var firstSel = Node.FirstSelected();
    if(firstSel == "")
        return true;

    if(!Node.IsRenderable(firstSel))
        return true;

    if(Node.IsCamera(firstSel) || Node.IsLight(firstSel))
        return true;

    return false;
}
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 »

First default for YafaRay program is now inside the truespace folder c:\trueSpace761\tS or c:\\trueSpace761Std
full path will be something like "c:\trueSpace761\tS\xxxYafarayzzz\bin\yafaray-xml.exe" where xxx and zzz can be any pre or post fix to a case insensitive "yafaray" folder.
if not found it will try looking inside BforArtists, Blender and Program Files for Yafaray v3 specifically.

YafaRay4tS/Render - function is called during reset of the connector

Code: Select all

function GetYafPath()
{
	var fso = new ActiveXObject("Scripting.FileSystemObject");

	var yafpath = tSYafPath();

	if(fso.FileExists(yafpath))
		return yafpath;

	if(fso.FileExists("C:\\Program Files\\Bforartists 1.0.0\\2.79\\scripts\\addons\\yafaray_v3\\bin\\yafaray-xml.exe"))
		yafpath = "C:\\Program Files\\Bforartists 1.0.0\\2.79\\scripts\\addons\\yafaray_v3\\bin\\yafaray-xml.exe";
	else if(fso.FileExists("C:\\Program Files\\Blender Foundation\\Blender\\2.79\\scripts\\addons\\yafaray_v3\\bin\\yafaray-xml.exe"))
		yafpath = "C:\\Program Files\\Blender Foundation\\Blender\\2.79\\scripts\\addons\\yafaray_v3\\bin\\yafaray-xml.exe";
	else if(fso.FileExists("C:\\Program Files\\yafaray_v3\\bin\\yafaray-xml.exe"))
		yafpath = "C:\\Program Files\\yafaray_v3\\bin\\yafaray-xml.exe";

	return yafpath;
}
function tSYafPath()
{
	var fso = new ActiveXObject("Scripting.FileSystemObject");

	var temppath, yafpath = "yafaray-xml.exe";
	var tspath = System.GetMainDir();

	var folder = fso.GetFolder(tspath); 
	var folderEnum = new Enumerator(folder.SubFolders); 
 
	var regexp = /YafaRay/i

	for(;!folderEnum.atEnd(); folderEnum.moveNext()) {
		var cur = folderEnum.item();
		var curArray = (cur+"").split("\\");
		var s = "" + curArray[curArray.length-1];
		if(s.match(regexp)) {
			temppath = fso.BuildPath(cur,"bin");
			temppath = fso.BuildPath(temppath,"yafaray-xml.exe");
			if(fso.FileExists(temppath)) {
				yafpath = temppath;
				break;
			}
		}
	}
	return yafpath;
}
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 »

RednerToFile2butts.jpg
Changed the Set Timeline Range button behavior. It was changing the animation preference values and it should only be changing the rendering parameters. So split into 2 buttons

Set from Timeline button - sets the render frame range from the animation time - behaves like D3D Render to File dialog reset button

Code: Select all

Node.Value("%THIS_NAME%" , "Start_Frame") = Node.Value("AnimMng", "AnimStart");
Node.Value("%THIS_NAME%", "Number_Start") = Node.Value("AnimMng", "AnimStart");
Node.Value("%THIS_NAME%", "End_Frame") = Node.Value("AnimMng", "AnimEnd");


Set from Keyframes button - sets the render range from the scene min and max keyframe times
code moved from button into a command node
if object render will try to read range from the selected objects animation clip
otherwise it tries to read keyframe range for the whole scene

YafaRay4tS/SetFromKeyframes

Code: Select all

// Execute 
// Called to execute the command 
function Execute(params)
{
	var owner = System.ThisOwner();
	var objectRenderMode = Node.Value(owner, 'objectRenderMode');
	var selectedNode = Node.FirstSelected();

	//save playrange
	var playRangeStart = RsAnimPref.PlayRangeStart;
	var playRangeEnd = RsAnimPref.PlayRangeEnd;

	//scene mode not object mode
	if ((objectRenderMode & 1) == 0) {
		selectedNode = "";
	}

	if(selectedNode != "" && Node.Exists(selectedNode + "/AnimClip")) {
		animStart = Node.Value(selectedNode + "/AnimClip", "ClipStart");
		animEnd = Node.Value(selectedNode + "/AnimClip", "ClipEnd");
	} else {
		//alters the play range anim pref values"
		try {
			animStart = RsTime.EvalAnimStart('')
			animEnd = RsTime.EvalAnimEnd('')
		} catch(e) {
			animStart = 0;
			animEnd = 0;
		}
	}

	Node.Value(owner, "Start_Frame") = animStart;
	Node.Value(owner, "Number_Start") = animStart;
	Node.Value(owner, "End_Frame") = animEnd;

	//restore anim pref values
	RsAnimPref.PlayRangeStart = playRangeStart;
	RsAnimPref.PlayRangeEnd = playRangeEnd;

	//NOTE
	//RsTime.EvalAnimStart and RsTime.EvalAnimEnd seem to ignore all arguments
	// and only operate on the entire scene animation
}
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 »

Great! Looks like you got it sorted out.

I am trying to update the YafaRay4tS Installer's ReadMe.txt
Please verify that this is correct and if you have any other suggestions.
Add to the Developer's notes?
Is the Blender instructions correct?

YafaRay4tSv090 was created to work in trueSpace7.61 'Workspace'
It does not work in trueSpace7.61 'Model'
Tested with YafaRay v3.3.0

YafaRay Installation

1.) Install the YafaRay v3.3.0 render engine from one of these sites:
https://github.com/YafaRay/Blender-Exporter/releases
https://github.com/YafaRay/Core/releases

Unzip the file and copy the 'yafaray_v3' folder to Program Files
Example: C:\Program Files\yafaray_v3

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

YafaRay4tS Installation

Next if you have previously installed YafaRay4tS before, Uninstall YafaRay4tS from the Add & Remove program in the Windows Control Panel first!

2.) Extract All the files from the YafaRay4tSv090.zip. into a folder named YafaRay4tSv090
Example: C:\trueSpace761\YafaRay4tSv090

3.) Open trueSpace7.61 and from the Workspace's File menu, Load the YafaRay4tS_Installer.RsObj from where you extracted the files.
WARNING: Do not Drag and Drop, use the File menu!

4.) From the YafaRay4tS Installer panel select the 'Install' button.

You should see a tS761 Question message asking:
"Your existing YafaRay4tS Libraries will be deleted and replaced with updated versions."
"Would you like to continue?"

If not select your keyboard keys Alt + Tab to bring the message forward. Selecting "Yes" will start the installation and selecting "No" will Cancel the installation.

WARNING: If you have any content saved in any of these three libraries, they will be deleted, so save anything you want into a different library.

5.) From Workspace in the Stack/Panel - YafaRay4tS/Setup aspect
Set the 'YafaRay Installation Path' to the yafaray-xml.exe file where you have installed YafaRay v3.3.0.
Example: C:\Program Files\yafaray_v3\bin\yafaray-xml.exe

6.) Set the 'Output - Render File' to where you want to render an image or images.
Example: C:\Temp\yaf_test.png

7.) Select the 'Save Settings' button to save your directories into the default YafaRay4tS object.

8.) Position the YafaRay4tS toolbar and save your Layout.

9.) From Workspace in the Package Manager, Install and Load the Clintons3dPlugin, and Reboot trueSpace7.61.

Congratulations you've finished your YafaRay4tS setup!

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

YafaRay4tS Uninstall

1.) Open trueSpace7.61 and from the Workspace's File menu, Load the YafaRay4tS_Installer.RsObj from where you extracted the YafaRay4tSv090 files

2.) Select the 'Uninstall' button.
You should see a tS761 Question message asking:
"Your existing YafaRay4tS Libraries will be deleted."
"Would you like to continue?"

If not Select your keyboard keys Alt + Tab to bring the message forward. Selecting "Yes" will Uninstall the installation and selecting "No" will Cancel the installation.

WARNING: If you have any content saved in any of these three libraries, they will be deleted, so save anything you want into a different library.


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Developer notes:

If you Reset the Default Context in trueSpace761 you will have to install YafaRay4tS again.

The 'Update YafaRay Render Node' script found in the 'YafaRay4tS Setup' library can be used to update an existing scene. It will not update the materials.

YafaRay scenes for trueSpace7.61
http://clintons3d.com/plugins/truespace ... faray.html

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

YafaRay4tSv080
partial save timer - save file while rendering to see progress
Tile rendering options - linear or random for bucket style renders

custom text for the Draw Params option

New material options are at the bottom of the materials
Pass ID is used with the render passes
Visibility can be set to normal, shadow only, no shadows, invisible
Receive Shadows uncheck so material does not get shadows

threads default to -1

Render Passes
Check "enable" to turn on render passes
Use the dropdown to select render passes
RenderPassList.txt contains a list of all possible passes that can be typed into any slot. The channel isn't limited to the dropdown list selections.

The MultiLayer option at the bottom only applies to the exr file format.

YafaRay4tSv075
TrueSpace 7.61 version required and is not backwards compatible.
Improved skeletal meshes/Actors with animation support.
Skeletal meshes and Characters, will export if you apply SDS to the mesh. The first Level of SDS is the preferred method unless the mesh is already subdivided.
Skeletal meshes will also export if you apply a morph to the character. Apply morph then right click to immediately exit the tool.
Support for multiple materials on one mesh.
Fixed mesh normals for better glass objects.
Spotlight and omni light power exports the same as Blender with a export power = power*power/2.
Area and Sphere lights have a render option to make them visible.
Area light has a new mesh so when the mesh is at (0,0,0) the resulting light is also at (0,0,0).
Adjusted light attenuation parameters to make the preview more closely match the render.
Does not lose camera selection if the scene name changes.
Glass material absorption value was not connected so value was never used.
Added a strength control to the glass material to control the D3D transparency preview(no effect on the final render).
Bumpmap preview for materials.
Changed the default render parameters to match Blender's UI values.
YafaRay4tS materials default to the corresponding Blender material default values.
Added a global input gamma that is applied to colors, lights and textures to translate them to linear color space used by YafaRay.
Gamma value does not effect the display in trueSpace 3D viewport.
Added DarkTide's sun sky background option.
Added support for rendering to the OpenEXR file format(exr).
New aspects for each Lighting Method.
YafaRay4tS Settings button shows the YafaRa4tS panel's presently used Lighting Method aspect in the Stack.
YafaRay4tS Export and Render button no longer shows the YafaRa4tS panel in the Stack with the LMB.
YafaRay4tS Export and Render button shows the YafaRa4tS panel's presently used Lighting Method aspect in the Stack with the RMB.
Diffuse Reflect Map fixed in new improved Yaf Coated Glossy and Yaf Glossy materials.
New improved YafaRay4tS Spot light with Hotspot generator.
Updated YafaRay4tS Help file.
New tS7.61 YafaRay4tS Installer script.

Yafaray 0.1.2 Beta support:

Requires Yafaray version 0.1.2 beta to be setup with YafaRay4tSv0.7.5 and the Yafaray 0.1.2 xml format - beta checkbox enabled, located in the Setup aspect. Only one version of Yafaray can be installed at one time.

New file formats hdr, jpg, png and tif.
Save Alpha located in the Lighting Method aspects. - Exports an alpha file in addition to the rgb output file.
Z - Channel option works.
New Volume Region mesh: Uniform and Height Fog work with the YafarayVolume.RsObj
Support for normalmap textures.
Rough Glass material.
Photon only and soft shadow parameters for the Spot light.
IES Light with preview.
SPPM lighting method(not working at this time for the xml renderer, YafaRay version 0.1.2-Beta2).

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

YafaRay4tSv070
Hair takes on the same Material as the base mesh it grows from.
There are 2 options for preparing an Character or a Skeletal mesh for rendering with Yafaray:
1. Apply a Morph then right click to immediately exit the tool.
2. Apply SDS to the mesh. The first SDS (Level 1) is the preferred method unless the mesh is already subdivided.
The material texture map X Scale and Y Scale only works well for odd whole number values.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Blender:

1.) To install for Blender copy the "yafaray" folder into the AddOns folder inside blender
2.) Start Blender
3.) File > User Preferences
4.) Add-ons
5.) find and activate yafaray via checkbox
6.) press the Save User Settings button
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 »

Even with using the try and catch error with the setup library, I got two errors again.
The only way I can avoid these errors is to close the libraries and reboot tS before using the installer.

I was reading a couple of sites with regards to access denied errors.
This guy used this

Code: Select all

file = fso.GetFile(FILE_PATH);
file.Delete(true);
Read Only

Code: Select all

file = fso.GetFile(tempWAVPath)
if(file.attributes & 1) {
    file.attributes = file.attributes - 1
So I adapted it and tried this:

Code: Select all

file = fso.GetFolder(tS + 'Rs Main Libraries\\YafaRay4tS Setup')
if(file.attributes & 1) {
    file.attributes = file.attributes - 1;
}
if (fso.FolderExists(file))
	fso.DeleteFolder(file)
	fso.CopyFolder(YafaRay4tSv075 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
First test was a success! Testing some more...
Well that was short lived. Never mind :oops:
Geeze I just realized this is for a file.
Can you do the same for Folders?
Attachments
New Uninstall Error.PNG
New Uninstall Error.PNG (10.35 KiB) Viewed 4658 times
New Install Error.PNG
New Install Error.PNG (10.93 KiB) Viewed 4658 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 »

I didn't find much and I have no way of testing.
My notes:

Yafaray4tS setup is the first folder that is deleted/copied, try changing the order of the files

try adding true as the second argument to the delete folder, true means to force it

try without the delete folder, by default I think copy replaces it anyway
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 seems to work.

Code: Select all

fso.CopyFolder(YafaRay4tSv075 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
fso.CopyFolder(YafaRay4tSv075 + '\\YafaRay Materials', tS + 'Rs Main Libraries\\', true)
fso.CopyFolder(YafaRay4tSv075 + '\\YafaRay Lights', tS + 'Rs Main Libraries\\', true)
I was even using the scene in the setup library while installing.
Deleting items in the setup library and then installing replaces them.
Yay!
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 »

installer check for c3d installation earlier in the process - c3d persistent install is required
YafaRay4tS_Installer/Install at top

Code: Select all

	owner = System.ThisOwner();
	mainDir = System.GetMainDir();

	var fso = new ActiveXObject("Scripting.FileSystemObject");
	if(!fso.FolderExists(mainDir + "\\Scripts\\clintonobjects\\CustomScriptsStore")) {
		System.Alert("Error: Must install c3dPersistence v2 script first!");
		return;
	}

	if(!Node.Exists("Toolbar Prototypes Encapsulator/WorkspaceNav/C3DButton") && !Node.Exists("Toolbar Prototypes Encapsulator/ClintonToolbar/C3DButton")){
		System.Alert("Error: Must install c3dPersistence v2 script first!");
		return;
	}

	if(!Node.Exists("Toolbar Prototypes Encapsulator/ClintonToolbar/")) {
		System.Alert("Error: Must install c3dPersistence v2 script first!");
		return;
	}
YafaRay4tS_Installer/Integrated Button Install - at bottom call to update the reset file for reset context survival

Code: Select all

	//Node.Delete(System.ThisOwner())
	Activity.Run(System.ThisOwner() + "/UpdateResetFile");
new nodes UpdateResetFile and PostReset - for post context reset survival

YafarayScripts/EnumPropertiesPanels - at end added code to reopen the Yafaray toolbar if needed - handy for layout changes

Code: Select all

		//
		//Open Yafaray toolbar
		//
	if(!Node.Exists(WindowsManager.GetWindowsManagerNodeName() + "/YafaRayBar")) {
		var name=WindowsManager.GetWindowsManagerNodeName();
		if(Node.Exists("Toolbar Prototypes Encapsulator/YafaRayBar"))
			WindowsManager.OpenToolbarFromPrototype("YafaRayBar",32,32,0,0);
		Node.Rename(name+"/"+Node.SubObject(name,Node.SubObjectCount(name)-1),"YafaRayBar");
		WindowsManager.SnapFrameToFrameEx(WindowsManager.GetWorkWindow(),name+"/YafaRayBar",19,10,310,-120);
		WindowsManager.SetFrameOwnerFrame(name+"/YafaRayBar",WindowsManager.GetWorkWindow());
	}
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: Render buttons in the YafaRay toolbar only work with the UnOfficial Patched version of truespace. Except for Area Render button.

animation button:

Code: Select all

if(Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){
    OfflineRender.OpenView('',0,0);
if(Node.Exists(/Scripts/Commands/RenderAnimation")){
    Activity.Run('/Scripts/Commands/RenderAnimation')
}else{
    OfflineRender.RenderAnimation('')
    }
other buttons also check for existence of their command nodes

Edit: looks like the extra stuff is for VRay so simplify to just

Code: Select all

if(Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){
    OfflineRender.OpenView('',0,0);
    OfflineRender.RenderAnimation('')
    }
Last edited by clintonman on 09 Jul 2018, 22:21, edited 2 times in total.
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 »

Here is the installer I have been working on this morning.
Changes:
Changed YafaRay4tSv075 string to YafaRay4tSv090

Changed the Install script as mentioned earlier:
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay Materials', tS + 'Rs Main Libraries\\', true)
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay Lights', tS + 'Rs Main Libraries\\', true)

Changed the Uninstall script by adding true
if (fso.FolderExists(tS + 'Rs Main Libraries\\YafaRay4tS Setup')) {
fso.DeleteFolder(tS + 'Rs Main Libraries\\YafaRay4tS Setup', true)
}
etc...
Removed due to update
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 Jul 2018, 22:16 Here is the installer I have been working on this morning.
Changes:
Changed YafaRay4tSv075 string to YafaRay4tSv090

Changed the Install script as mentioned earlier:
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay Materials', tS + 'Rs Main Libraries\\', true)
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay Lights', tS + 'Rs Main Libraries\\', true)

Changed the Uninstall script by adding true
if (fso.FolderExists(tS + 'Rs Main Libraries\\YafaRay4tS Setup')) {
fso.DeleteFolder(tS + 'Rs Main Libraries\\YafaRay4tS Setup', true)
}
etc...
Roger, I'll add my changes now.
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 Jul 2018, 22:11 Bug: Render buttons in the YafaRay toolbar only work with the UnOfficial Patched version of truespace. Except for Area Render button.

Code: Select all

//Yaf toolbar Render Scene
if (Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){OfflineRender.OpenView('',0,0);Activity.Run('/Scripts/Commands/RenderScene')};
//tS Render Scene
OfflineRender.OpenView('',0,0);Activity.Run('/Scripts/Commands/RenderScene');
//Yaf toolbar Render Object
if (Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){OfflineRender.OpenView('',0,0);Activity.Run('/Scripts/Commands/RenderObject')};
//tS Render Object
OfflineRender.OpenView('',0,0);Activity.Run('/Scripts/Commands/RenderObject');
//Yaf toolbar Render Animation
if (Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){OfflineRender.OpenView('',0,0);Activity.Run('/Scripts/Commands/RenderAnimation')};
//tS Render Animation
OfflineRender.OpenView('',0,0);Activity.Run('/Scripts/Commands/RenderAnimation');
Why would the first part of the Yaf button command
if (Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){
be a problem?
If I am following your last edit correctly, that is the same way they are presently.
Did you have a YafaRay4tS.RsObj in the scene when you tried them?
I guess it really isn't needed, as I remember I included that command in case a user did not have YafaRay4tS.
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 Jul 2018, 22:16 Here is the installer I have been working on this morning.
Changes:
Changed YafaRay4tSv075 string to YafaRay4tSv090

Changed the Install script as mentioned earlier:
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay4tS Setup', tS + 'Rs Main Libraries\\', true)
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay Materials', tS + 'Rs Main Libraries\\', true)
fso.CopyFolder(YafaRay4tSv090 + '\\YafaRay Lights', tS + 'Rs Main Libraries\\', true)

Changed the Uninstall script by adding true
if (fso.FolderExists(tS + 'Rs Main Libraries\\YafaRay4tS Setup')) {
fso.DeleteFolder(tS + 'Rs Main Libraries\\YafaRay4tS Setup', true)
}
etc...
Got everything merged except for one problem:
What is the proper name for the toolbar?
YafaRay Toolbar Frame?
YafaRayBar?
I need the prottype encapsulator name and the windows manager space name

Edit:

Never mind got it sorted out. My post reset code must have been based on some older version of the installer.
Last edited by clintonman on 09 Jul 2018, 23:05, edited 1 time in total.
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 names did not change.
The prototype is the YafaRayBar
And the YafaRay Toolbar Frame is for the Windows Manager Space

From the Install script:

Code: Select all

Node.Copy(System.ThisOwner() + "/YafaRay Toolbar Frame", "/Project/Windows Manager Space")
Node.Copy("/Toolbar Prototypes Encapsulator/YafaRayBar", "/Project/Windows Manager Space/YafaRay Toolbar Frame")
WindowsManager.Activate()
WindowsManager.UpdateWindowsStructure()
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 »

Thanks, got it.
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 »

Interesting development.
I got this error:
No 3D View opened.PNG
No 3D View opened.PNG (4.83 KiB) Viewed 4496 times
I browse to the tS/Image Folder and the Yaf_test.png is zero bytes.
The yaf_temp.xml is there as well.
Image changed to 0 bytes.PNG
I replace it, and from the Output Render File, select it again, then render.
I get the error again and the Yaf_test.png is zero bytes again.
Repeated three times.
When this started I rendered with no 3D View opened.
I have mentioned this before but I suspect this has to do with using ActiveX doing some weird things with files.
Remember I had the invisible image and RsObj awhile back?

The above incident was to again bring up this error when trying to render with no 3D View opened.
No 3D Window.PNG
No 3D Window.PNG (2.7 KiB) Viewed 4492 times
No 3D Window error.PNG
Could it be that if you get an error when writing to the xml file that it could become corrupted and cause the above problem. Spent several minutes looking for that No 3D View alert to no avail, wondering why, after the alert it was not being returned to sender. ;)
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 »

When you uninstall YafaRay4tS, the YafarayScripts and the Offline renderers/Yafaray node are still present.
Not sure if you should delete them or add the following to the YafarayScripts/render scripts.

Code: Select all

if(!Node.Exists("/Yafaray Folder")){
return;
}
So they will not through an error.
If Yaf is uninstalled.PNG
If Yaf is uninstalled.PNG (10.95 KiB) Viewed 4490 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: 10 Jul 2018, 01:44 When you uninstall YafaRay4tS, the YafarayScripts and the Offline renderers/Yafaray node are still present.
Not sure if you should delete them or add the following to the YafarayScripts/render scripts.

Code: Select all

if(!Node.Exists("/Yafaray Folder")){
return;
}
So they will not through an error.
If Yaf is uninstalled.PNG
Already fixed. Issue is it was trying to use a value before reading 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 »

latest here now
RC 9
fixed no 3d view problem
YafarayScripts/...moved code to top of each

Code: Select all

	if (Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){
	} else {
		if(Node.Exists("/Yafaray Folder")){
			Node.Copy("/Yafaray Folder/YafaRay4tS", Space.CurrentScene());
		}
	};
persistent install complete - when opening render options panel the toolbar will open if it is closed, also altered the reset.js file custom commands used for context reset, change ScriptObject.Execute to Activity.Run because when a script deletes itself it stops all other potential scripts

fixed - render buttons did not work for unpatched tS
Attachments
YafaRay4tSv090-rc-9.zip
(6.69 MiB) Downloaded 195 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 »

Just notice a mistake with the Uninstall script.
Save toolbars should be below all of these lines.

All the resetting toolbars from the uninstaller seems like a waste! It's only for the way old Yaf(a)Ray4tS v 0.6.0 toolbar.
Attachments
Uninstall.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: 10 Jul 2018, 01:44 When you uninstall YafaRay4tS, the YafarayScripts and the Offline renderers/Yafaray node are still present.
Not sure if you should delete them or add the following to the YafarayScripts/render scripts.

Code: Select all

if(!Node.Exists("/Yafaray Folder")){
return;
}
So they will not through an error.
If Yaf is uninstalled.PNG
Uninstaller should delete them and it needs to be removed the YafarayScripts file from the ...\Scripts\clintonobjects\CustomScriptsStore folder
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 »

Notes for docs:

YafaRay4tSv090 was created to work in trueSpace7.61 'Workspace'
It does not work in trueSpace7.61 'Model'
Tested with YafaRay v3.3.0

YafaRay Installation

1.) Download the YafaRay v3.3.0 render engine from one of these sites:
https://github.com/YafaRay/Blender-Exporter/releases
https://github.com/YafaRay/Core/releases

Unzip the file and copy the 'yafaray_v3' folder to trueSpace folder
Example: C:\trueSpace761\tS\yafaray_v3
Example: C:\trueSpace761Std\yafaray_v3

or Program Files
Example: C:\Program Files\yafaray_v3
or see Blender instructions below

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Prerequisites:
Clinton3dPlugin.rxs plugin installed
C3DPersistent installed


YafaRay4tS Installation

Next if you have previously installed YafaRay4tS before, Uninstall YafaRay4tS from the Add & Remove program in the Windows Control Panel first!

2.) Extract All the files from the YafaRay4tSv090.zip. into a folder named YafaRay4tSv090
Example: C:\trueSpace761\YafaRay4tSv090 I would recommend unzipping anywhere else since it is an installer and not a part of trueSpace

3.) Open trueSpace7.61 and from the Workspace's File menu, Load the YafaRay4tS_Installer.RsObj from where you extracted the files.
WARNING: Do not Drag and Drop, use the File menu!

4.) From the YafaRay4tS Installer panel select the 'Install' button.

You should see a tS761 Question message asking:
"Your existing YafaRay4tS Libraries will be deleted and replaced with updated versions."
"Would you like to continue?"

If not select your keyboard keys Alt + Tab to bring the message forward. Selecting "Yes" will start the installation and selecting "No" will Cancel the installation.

WARNING: If you have any content saved in any of these three libraries, they will be deleted, so save anything you want into a different library.

5.) From Workspace in the Stack/Panel - YafaRay4tS/Setup aspect
Set the 'YafaRay Installation Path' to the yafaray-xml.exe file where you have installed YafaRay v3.3.0.
Example: C:\Program Files\yafaray_v3\bin\yafaray-xml.exe
If copied to the example link above it will be found automatically. Also automatic if copied to the trueSpace folder C:\trueSpace761\tS\yafaray_v3 or C:\trueSpace761Std\yafaray_v3 or Blender 2.79 addons or BforArtists 1.0 addons folders. If copied to the truespace folder any folder with “yafaray” in the name will be found so it’s not limited to “yafaray_v3” specifically.

6.) Set the 'Output - Render File' to where you want to render an image or images.
Example: C:\Temp\yaf_test.png

7.) Select the 'Save Settings' button to save your directories into the default YafaRay4tS object.

8.) Position the YafaRay4tS toolbar and save your Layout.

9.) From Workspace in the Package Manager, Install and Load the Clintons3dPlugin, and Reboot trueSpace7.61.

Congratulations you've finished your YafaRay4tS setup!

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

YafaRay4tS Uninstall

1.) Open trueSpace7.61 and from the Workspace's File menu, Load the YafaRay4tS_Installer.RsObj from where you extracted the YafaRay4tSv090 files

2.) Select the 'Uninstall' button.
You should see a tS761 Question message asking:
"Your existing YafaRay4tS Libraries will be deleted."
"Would you like to continue?"

If not Select your keyboard keys Alt + Tab to bring the message forward. Selecting "Yes" will Uninstall the installation and selecting "No" will Cancel the installation.

WARNING: If you have any content saved in any of these three libraries, they will be deleted, so save anything you want into a different library.


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Developer notes:

If you Reset the Default Context in trueSpace761 you will not have to install YafaRay4tS again.

The 'Update YafaRay Render Node' script found in the 'YafaRay4tS Setup' library can be used to update an existing scene. It will not update the materials.

YafaRay sample scenes for trueSpace7.61
http://clintons3d.com/plugins/truespace ... faray.html

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

YafaRay4tSv090
uses YafaRay v3.3.0
updated D3D preview to more closely match the rendered result
new integrated render buttons
updated materials with texture maps for all compatible attributes
added blend values for texture maps
updated draw parameters
new blend material
new procedural texture maps - clouds, marble,voronoi and wood
new yafaray camera
updated ies lights
new works with standard tS lights
enhanced light color picker
new toolbar buttons for yafaray camera, smoothing, volume primitive
sphere light exports scale instead of the size attributes
constant default color matches tS default background color
new support for resizable optdisplay window not limited by resolution or image aspect ratio
new animation preview system
new option to turn off caustic photons and diffuse photons for each light source.
new background cast shadows option and background sun shadow option.
New smart blur value for image based lighting
new photon map saving and loading
Additional rays on materials
Russian roulette for path tracing
new denoise option


YafaRay4tSv080
partial save timer - save file while rendering to see progress
Tile rendering options - linear or random for bucket style renders

custom text for the Draw Params option

New material options are at the bottom of the materials
Pass ID is used with the render passes
Visibility can be set to normal, shadow only, no shadows, invisible
Receive Shadows uncheck so material does not get shadows

threads default to -1

Render Passes
Check "enable" to turn on render passes
Use the dropdown to select render passes
RenderPassList.txt contains a list of all possible passes that can be typed into any slot. The channel isn't limited to the dropdown list selections.

The MultiLayer option at the bottom only applies to the exr file format.

YafaRay4tSv075
TrueSpace 7.61 version required and is not backwards compatible.
Improved skeletal meshes/Actors with animation support.
Skeletal meshes and Characters, will export if you apply SDS to the mesh. The first Level of SDS is the preferred method unless the mesh is already subdivided.
Skeletal meshes will also export if you apply a morph to the character. Apply morph then right click to immediately exit the tool.
Support for multiple materials on one mesh.
Fixed mesh normals for better glass objects.
Spotlight and omni light power exports the same as Blender with a export power = power*power/2.
Area and Sphere lights have a render option to make them visible.
Area light has a new mesh so when the mesh is at (0,0,0) the resulting light is also at (0,0,0).
Adjusted light attenuation parameters to make the preview more closely match the render.
Does not lose camera selection if the scene name changes.
Glass material absorption value was not connected so value was never used.
Added a strength control to the glass material to control the D3D transparency preview(no effect on the final render).
Bumpmap preview for materials.
Changed the default render parameters to match Blender's UI values.
YafaRay4tS materials default to the corresponding Blender material default values.
Added a global input gamma that is applied to colors, lights and textures to translate them to linear color space used by YafaRay.
Gamma value does not effect the display in trueSpace 3D viewport.
Added DarkTide's sun sky background option.
Added support for rendering to the OpenEXR file format(exr).
New aspects for each Lighting Method.
YafaRay4tS Settings button shows the YafaRa4tS panel's presently used Lighting Method aspect in the Stack.
YafaRay4tS Export and Render button no longer shows the YafaRa4tS panel in the Stack with the LMB.
YafaRay4tS Export and Render button shows the YafaRa4tS panel's presently used Lighting Method aspect in the Stack with the RMB.
Diffuse Reflect Map fixed in new improved Yaf Coated Glossy and Yaf Glossy materials.
New improved YafaRay4tS Spot light with Hotspot generator.
Updated YafaRay4tS Help file.
New tS7.61 YafaRay4tS Installer script.

Yafaray 0.1.2 Beta support:

Requires Yafaray version 0.1.2 beta to be setup with YafaRay4tSv0.7.5 and the Yafaray 0.1.2 xml format - beta checkbox enabled, located in the Setup aspect. Only one version of Yafaray can be installed at one time.

New file formats hdr, jpg, png and tif.
Save Alpha located in the Lighting Method aspects. - Exports an alpha file in addition to the rgb output file.
Z - Channel option works.
New Volume Region mesh: Uniform and Height Fog work with the YafarayVolume.RsObj
Support for normalmap textures.
Rough Glass material.
Photon only and soft shadow parameters for the Spot light.
IES Light with preview.
SPPM lighting method(not working at this time for the xml renderer, YafaRay version 0.1.2-Beta2).

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

YafaRay4tSv070
Hair takes on the same Material as the base mesh it grows from.
There are 2 options for preparing an Character or a Skeletal mesh for rendering with Yafaray:
1. Apply a Morph then right click to immediately exit the tool.
2. Apply SDS to the mesh. The first SDS (Level 1) is the preferred method unless the mesh is already subdivided.
The material texture map X Scale and Y Scale only works well for odd whole number values.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Blender:

1.) To install for Blender copy the "yafaray" folder into the AddOns folder inside blender
2.) Start Blender
3.) File > User Preferences
4.) Add-ons
5.) find and activate yafaray via checkbox
6.) press the Save User Settings button

The official pages say YafaRay is no longer compatible with WindowsXP, but it does work in trueSpace. They must be referring to running with Blender on WindowsXP.

OptDisplay:
download http://rs.siprogs.sk/p/iOptDetectorsPage
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 »

Cool Thanks!
Error with RC-9
How about we share the same reset.js file, include it with your installer, and copy it to the Scripts folder?
Also the C3DReset script is already loading the Offline renderers.RsObj
Rc9 error.PNG
Rc9 error.PNG (11.03 KiB) Viewed 4502 times
Also notice an yaf_temp.xml in the preobjects folder dated 7/8/2018 8:12 PM
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 Jul 2018, 03:39 Cool Thanks!
Error with RC-9
How about we share the same reset.js file, include it with your installer, and copy it to the Scripts folder?
Also the C3DReset script is already loading the Offline renderers.RsObj
Rc9 error.PNG

Also notice an yaf_temp.xml in the preobjects folder dated 7/8/2018 8:12 PM
Noted error, typo in line 28 of YafaRay4tS_Installer/UpdateResetFile change fsoFileExists to fso.FileExists
No yaf_temp.xml in my preobjects.
There isn't much to share as far as the reset.js file, only 4 lines of code.

Code: Select all

RsFileIO.LoadObject( rosDir + '\\scripts\\preObjects\\C3DReset.RsObj', scene);
Activity.Run("Project/Space 3D/C3DReset");
RsFileIO.LoadObject( rosDir + '\\scripts\\preObjects\\PostReset.RsObj', '/');
Activity.Run("/PostReset");
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 Jul 2018, 07:05 RednerToFile2butts.jpg
Changed the Set Timeline Range button behavior. It was changing the animation preference values and it should only be changing the rendering parameters. So split into 2 buttons

Set from Timeline button - sets the render frame range from the animation time - behaves like D3D Render to File dialog reset button

Code: Select all

Node.Value("%THIS_NAME%" , "Start_Frame") = Node.Value("AnimMng", "AnimStart");
Node.Value("%THIS_NAME%", "Number_Start") = Node.Value("AnimMng", "AnimStart");
Node.Value("%THIS_NAME%", "End_Frame") = Node.Value("AnimMng", "AnimEnd");


Set from Keyframes button - sets the render range from the scene min and max keyframe times
code moved from button into a command node
if object render will try to read range from the selected objects animation clip
otherwise it tries to read keyframe range for the whole scene

YafaRay4tS/SetFromKeyframes

Code: Select all

// Execute 
// Called to execute the command 
function Execute(params)
{
	var owner = System.ThisOwner();
	var objectRenderMode = Node.Value(owner, 'objectRenderMode');
	var selectedNode = Node.FirstSelected();

	//save playrange
	var playRangeStart = RsAnimPref.PlayRangeStart;
	var playRangeEnd = RsAnimPref.PlayRangeEnd;

	//scene mode not object mode
	if ((objectRenderMode & 1) == 0) {
		selectedNode = "";
	}

	if(selectedNode != "" && Node.Exists(selectedNode + "/AnimClip")) {
		animStart = Node.Value(selectedNode + "/AnimClip", "ClipStart");
		animEnd = Node.Value(selectedNode + "/AnimClip", "ClipEnd");
	} else {
		//alters the play range anim pref values"
		try {
			animStart = RsTime.EvalAnimStart('')
			animEnd = RsTime.EvalAnimEnd('')
		} catch(e) {
			animStart = 0;
			animEnd = 0;
		}
	}

	Node.Value(owner, "Start_Frame") = animStart;
	Node.Value(owner, "Number_Start") = animStart;
	Node.Value(owner, "End_Frame") = animEnd;

	//restore anim pref values
	RsAnimPref.PlayRangeStart = playRangeStart;
	RsAnimPref.PlayRangeEnd = playRangeEnd;

	//NOTE
	//RsTime.EvalAnimStart and RsTime.EvalAnimEnd seem to ignore all arguments
	// and only operate on the entire scene animation
}
Hummm, you do know a user can rename the Track and AnimClip, right?
Rename AnimClip and Track.PNG
Rename AnimClip and Track.PNG (4.7 KiB) Viewed 4474 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: 10 Jul 2018, 13:58
clintonman wrote: 09 Jul 2018, 07:05 RednerToFile2butts.jpg
Changed the Set Timeline Range button behavior. It was changing the animation preference values and it should only be changing the rendering parameters. So split into 2 buttons

Set from Timeline button - sets the render frame range from the animation time - behaves like D3D Render to File dialog reset button

Code: Select all

Node.Value("%THIS_NAME%" , "Start_Frame") = Node.Value("AnimMng", "AnimStart");
Node.Value("%THIS_NAME%", "Number_Start") = Node.Value("AnimMng", "AnimStart");
Node.Value("%THIS_NAME%", "End_Frame") = Node.Value("AnimMng", "AnimEnd");


Set from Keyframes button - sets the render range from the scene min and max keyframe times
code moved from button into a command node
if object render will try to read range from the selected objects animation clip
otherwise it tries to read keyframe range for the whole scene

YafaRay4tS/SetFromKeyframes

Code: Select all

// Execute 
// Called to execute the command 
function Execute(params)
{
	var owner = System.ThisOwner();
	var objectRenderMode = Node.Value(owner, 'objectRenderMode');
	var selectedNode = Node.FirstSelected();

	//save playrange
	var playRangeStart = RsAnimPref.PlayRangeStart;
	var playRangeEnd = RsAnimPref.PlayRangeEnd;

	//scene mode not object mode
	if ((objectRenderMode & 1) == 0) {
		selectedNode = "";
	}

	if(selectedNode != "" && Node.Exists(selectedNode + "/AnimClip")) {
		animStart = Node.Value(selectedNode + "/AnimClip", "ClipStart");
		animEnd = Node.Value(selectedNode + "/AnimClip", "ClipEnd");
	} else {
		//alters the play range anim pref values"
		try {
			animStart = RsTime.EvalAnimStart('')
			animEnd = RsTime.EvalAnimEnd('')
		} catch(e) {
			animStart = 0;
			animEnd = 0;
		}
	}

	Node.Value(owner, "Start_Frame") = animStart;
	Node.Value(owner, "Number_Start") = animStart;
	Node.Value(owner, "End_Frame") = animEnd;

	//restore anim pref values
	RsAnimPref.PlayRangeStart = playRangeStart;
	RsAnimPref.PlayRangeEnd = playRangeEnd;

	//NOTE
	//RsTime.EvalAnimStart and RsTime.EvalAnimEnd seem to ignore all arguments
	// and only operate on the entire scene animation
}
Hummm, you do know a user can rename the Track and AnimClip, right?
Rename AnimClip and Track.PNG
Yep, I was being lazy.
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 »

Assuming that you fixed the YafaRay4tS toolbar's Render icons in RC 9, I think that we should make all of the LMB commands for the YafaRay toolbar's Render icons the same as the tS Render icons.
Render Scene:

Code: Select all

OfflineRender.OpenView('',0,0);Activity.Run('/Scripts/Commands/RenderScene')
I know, my bad for putting the if YafaRay4tS exist in there, but I did some more testing and I (Think) it is not needed.
I did not test this without the Update 4 like you did and I did not test this with Vray either.
As a test, try the YafaRay4tS toolbar's Render icons in there present RC 9 state verses the tS Render icons, with your plugin Loaded and Unloaded. Don't forget to reboot tS after Loading/Unloading your plugin.
My only goal for adding these render icons was to make it easier to open the YafaRay4tS aspects with the RMB commands.


Reading your new scripts ( I have not tested these yet) it looks like you are running two scripts at one time during a Reset. Also some of the code is duplicated in the C3DReset. This does not seem like a very good idea! Since you are making YafaRay4tS a persistent install, why can't the two scripts be combined into one C3DReset script? :idea: DRY
Also in IMMHO I strongly suggest that the trueSpace Reset to Default Context resets trueSpace, they way it originally does. No 3rd party toolbars opening after a reset. Vray does not do this. I think we should respect that a user may or may not want to install any 3rd party toolbars or plugins.
If you insist on wanting these to open after a reset, it is very easy to make that happen.
After a reset the default_layout.rsl is loaded. You simply open/place whatever toolbars you want, make any other changes, and save that layout to C:\trueSpace761\tS\default_layout.rsl.
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 Jul 2018, 14:57 Assuming that you fixed the YafaRay4tS toolbar's Render icons in RC 9, I think that we should make all of the LMB commands for the YafaRay toolbar's Render icons the same as the tS Render icons.
Render Scene:

Code: Select all

OfflineRender.OpenView('',0,0);Activity.Run('/Scripts/Commands/RenderScene')
I know, my bad for putting the if YafaRay4tS exist in there, but I did some more testing and I (Think) it is not needed.
I did not test this without the Update 4 like you did and I did not test this with Vray either.
...
So does that mean you're ok with the buttons running vray as well?
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 Jul 2018, 14:57 ...

Reading your new scripts ( I have not tested these yet) it looks like you are running two scripts at one time during a Reset. Also some of the code is duplicated in the C3DReset. This does not seem like a very good idea! Since you are making YafaRay4tS a persistent install, why can't the two scripts be combined into one C3DReset script? :idea: DRY
Also in IMMHO I strongly suggest that the trueSpace Reset to Default Context resets trueSpace, they way it originally does. No 3rd party toolbars opening after a reset. Vray does not do this. I think we should respect that a user may or may not want to install any 3rd party toolbars or plugins.
If you insist on wanting these to open after a reset, it is very easy to make that happen.
After a reset the default_layout.rsl is loaded. You simply open/place whatever toolbars you want, make any other changes, and save that layout to C:\trueSpace761\tS\default_layout.rsl.
read more closely, "if(false)" prevents that part from running, there is no toolbar opening.
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 good! As said I have not tested that yet.

I just installed Vray and it seems to work as expected with both Renderers with the YafaRay4tS toolbar's Render icon's LMB being the same as tS Render icons. As said I did not test without the Update 4, so I do not know what was wrong there. Also could not tell what your change was. It looked the same to me.
I did notice though when both Vray and Clintons3D Package are not Loaded, the YafaRay4tS Render and Export icon shows the Display, opens the Offline renderers with Yafaray loaded, even though it is disabled. And the Render Scene icon displays the trueSpace Warning that no renderer is installed. So that is misleading.
No Plugins Loaded.PNG
Since you have adopted using tS Offline Render icons, I suggest that you remove the Render and Export icon.
Seems the easiest solution unless you have a better idea.
So to be clear:
1.) LMB commands is the same as tS
2.) Remove the Render and Export

3.) Yafaray Settings icon's LMB and RMB commands, you could add if the Offline renderers = Vray photo render -> return
So that you could stop the YafaRay4tS node from loading into the scene.
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 »

Clinton,
I have been working on the installer (I found a few problems with the PostReset script) and I have everything done except a button command.
How would you create a button command that checks to see if
Node.Value("/Offline renderers", "Renderer") = Vray photo renderer
return


I so hate ComboCtrls !!! :evil:
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 Jul 2018, 22:30 Clinton,
I have been working on the installer (I found a few problems with the PostReset script) and I have everything done except a button command.
How would you create a button command that checks to see if
Node.Value("/Offline renderers", "Renderer") = Vray photo renderer
return


I so hate ComboCtrls !!! :evil:
Good timing, just last night I started gathering code snippets for tS scripting. TryCatch is needed for when the connector is in an unstable state.

Code: Select all

	var strEnum = System.CreateDO("Common Data Package/String Enum Data");
	try {
		strEnum = Node.Value("/Offline renderers", "Renderer");
	} catch(e) {
		strEnum.Clear();
	}
	var selString = strEnum.GetSelectedString();
	System.Alert(selString);
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 »

Snippets? Bet you have a awesome collection! How much do you want that tSBible?
I did not want clear it though. I was wanting a script that does nothing (return) if the Vray photo render is selected in that ComboCtrl.
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 Jul 2018, 00:23 Snippets? Bet you have a awesome collection! How much do you want that tSBible?
I did not want clear it though. I was wanting a script that does nothing (return) if the Vray photo render is selected in that ComboCtrl.
It just clears invalid value in the script. If you don't want the clear write it the way you like. Just don't try to read the value if it goes to the catch portion.
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 »

because somebody who will remain nameless decided to call me out on my laziness. :P
full check of selected objects keyframe range

YafaRay4tS/SetFromKeyframes

Code: Select all

// Execute 
// Called to execute the command 
function Execute(params)
{
	var owner = System.ThisOwner();
	var objectRenderMode = Node.Value(owner, 'objectRenderMode');
	var selectedNode = Node.FirstSelected();

	//save playrange
	var playRangeStart = RsAnimPref.PlayRangeStart;
	var playRangeEnd = RsAnimPref.PlayRangeEnd;

	//scene mode not object mode
	if ((objectRenderMode & 1) == 0) {
		selectedNode = "";
	}

	var animClip = FindAnimClip(selectedNode)

	if(animClip.length > 0) {
		animStart = animClip[0];
		animEnd = animClip[1];
	} else {
		//alters the play range anim pref values"
		try {
			animStart = RsTime.EvalAnimStart('');
			animEnd = RsTime.EvalAnimEnd('');
		} catch(e) {
			animStart = 0;
			animEnd = 0;
		}
	}

	Node.Value(owner, "Start_Frame") = animStart;
	Node.Value(owner, "Number_Start") = animStart;
	Node.Value(owner, "End_Frame") = animEnd;

	//restore anim pref values
	RsAnimPref.PlayRangeStart = playRangeStart;
	RsAnimPref.PlayRangeEnd = playRangeEnd;

	//NOTE
	//RsTime.EvalAnimStart and RsTime.EvalAnimEnd seem to ignore all arguments
	// and only operate on the entire scene animation
}

function FindAnimClip(selectedNode)
{
	var clipstart=99999, clipend=-99999;
	if(selectedNode == "" || !Node.Exists(selectedNode))
		return [];

	var numChildren = Node.SubObjectCount(selectedNode);
	for(var i=0;i<numChildren;i++) {
		var childNode = selectedNode + "/" + Node.SubObject(selectedNode, i);
		if(Node.ConExists(childNode, "AnimData") && Node.ConExists(childNode, "AnimTrack")) {

			if(Node.Value(childNode, "ClipDisabled"))
				continue;

			if(clipstart > Node.Value(childNode, "ClipStart"))
				clipstart = Node.Value(childNode, "ClipStart");

			if(clipend < Node.Value(childNode, "ClipEnd"))
				clipend = Node.Value(childNode, "ClipEnd");

		}
	}

	if(clipstart==99999 && clipend ==-99999)
		return [];

	return [clipstart, clipend];
}
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 »

Was NOT me, but Yay!
I am getting closer, it works from a script but not a button. OMG

Code: Select all

var strEnum = System.CreateDO("Common Data Package/String Enum Data");try {strEnum = Node.Value("/Offline renderers", "Renderer");} catch(e) {}var selString = strEnum.GetSelectedString();if(selString == "Vray photo renderer")  {return;}if (Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){} else {if(Node.Exists("/Yafaray Folder")){Node.Copy("/Yafaray Folder/YafaRay4tS", Space.CurrentScene());}};Activity.Run(Space.CurrentScene() + "/YafaRay4tS/Lighting Method Switch");Activity.Run("/Yafaray Folder/YafaRay4tS/Switch2Yafaray");OfflineRender.OpenPreferencesPanel()
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 Jul 2018, 18:28 ...
I did notice though when both Vray and Clintons3D Package are not Loaded, the YafaRay4tS Render and Export icon shows the Display, opens the Offline renderers with Yafaray loaded, even though it is disabled. And the Render Scene icon displays the trueSpace Warning that no renderer is installed. So that is misleading.
...
Having a hard time following the flow here, but I think you have to restart truespace to really unload a plugin. Also both Yafaray and vray show in the list of offline renderers after both Vray and Clintons3D Package are unloaded, so that's just the way it behaves I guess.
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: 11 Jul 2018, 01:03 Was NOT me, but Yay!
I am getting closer, it works from a script but not a button. OMG

Code: Select all

var strEnum = System.CreateDO("Common Data Package/String Enum Data");try {strEnum = Node.Value("/Offline renderers", "Renderer");} catch(e) {}var selString = strEnum.GetSelectedString();if(selString == "Vray photo renderer")  {return;}if (Node.Exists(Space.CurrentScene()+"/YafaRay4tS")){} else {if(Node.Exists("/Yafaray Folder")){Node.Copy("/Yafaray Folder/YafaRay4tS", Space.CurrentScene());}};Activity.Run(Space.CurrentScene() + "/YafaRay4tS/Lighting Method Switch");Activity.Run("/Yafaray Folder/YafaRay4tS/Switch2Yafaray");OfflineRender.OpenPreferencesPanel()
You could always just call command nodes instead of stuffing it all into the buttons.
Possible problem with the code

Code: Select all

var strEnum = System.CreateDO("Common Data Package/String Enum Data");try {strEnum = Node.Value("/Offline renderers", "Renderer");} catch(e) {}var selString = strEnum.GetSelectedString();...
Possible problem with the code, when you read the string it may be invalid and cause an error. For safety I would put a return inside the catch block instead of leaving it empty.
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: 11 Jul 2018, 01:17
trueBlue wrote: 10 Jul 2018, 18:28 ...
I did notice though when both Vray and Clintons3D Package are not Loaded, the YafaRay4tS Render and Export icon shows the Display, opens the Offline renderers with Yafaray loaded, even though it is disabled. And the Render Scene icon displays the trueSpace Warning that no renderer is installed. So that is misleading.
...
Having a hard time following the flow here, but I think you have to restart truespace to really unload a plugin. Also both Yafaray and vray show in the list of offline renderers after both Vray and Clintons3D Package are unloaded, so that's just the way it behaves I guess.
Yep always reboot tS after making changes in the Package Manager.
Even though they are listed they are disabled. Look inside and you will see that they are red.
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 »

Camera aspect
Set Camera button

Code: Select all

Path = Node.Selected(0);

if (Node.isCamera(Path)) {
  scene = Space.CurrentScene();
  scenelen = scene.length;
  relpath = Path.substring(scenelen)
  Node.Value("%THIS_NAME%" + "/Cam Name", "CamPath") = relpath;
  Activity.Run("%THIS_NAME%" + "/Cam Name")
  Node.Value("%THIS_NAME%", "Yaf_CamChoice") = "1"
}
else
  System.Alert("The current selected object is not a camera.  Please select a camera.");
if (!Node.isCamera(Path)) {
  Node.Value("%THIS_NAME%", "Yaf_CamChoice") = "0"
}
Nothing selected error
Attachments
Select Camera error when nothing selected.PNG
Select Camera error when nothing selected.PNG (9.09 KiB) Viewed 4106 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: 11 Jul 2018, 15:38 Camera aspect
Set Camera button

Code: Select all

Path = Node.Selected(0);

if (Node.isCamera(Path)) {
  scene = Space.CurrentScene();
  scenelen = scene.length;
  relpath = Path.substring(scenelen)
  Node.Value("%THIS_NAME%" + "/Cam Name", "CamPath") = relpath;
  Activity.Run("%THIS_NAME%" + "/Cam Name")
  Node.Value("%THIS_NAME%", "Yaf_CamChoice") = "1"
}
else
  System.Alert("The current selected object is not a camera.  Please select a camera.");
if (!Node.isCamera(Path)) {
  Node.Value("%THIS_NAME%", "Yaf_CamChoice") = "0"
}
Nothing selected error
Check for existence of a selection Path && ...

Code: Select all

Path = Node.FirstSelected();

if (Path && Node.isCamera(Path)) {
  scene = Space.CurrentScene();
  scenelen = scene.length;
  relpath = Path.substring(scenelen)
  Node.Value("%THIS_NAME%" + "/Cam Name", "CamPath") = relpath;
  Activity.Run("%THIS_NAME%" + "/Cam Name")
  Node.Value("%THIS_NAME%", "Yaf_CamChoice") = "1"
}
else
  System.Alert("The current selected object is not a camera.  Please select a camera.");
if (!Node.isCamera(Path)) {
  Node.Value("%THIS_NAME%", "Yaf_CamChoice") = "0"
}
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 »

Almost finished with the installer.
I have incorporated your last two updates.
What needs to be done with the Anim aspect?
Buttons?
Anim aspect.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 Jul 2018, 17:52 Almost finished with the installer.
I have incorporated your last two updates.
What needs to be done with the Anim aspect?
Buttons?
Anim aspect.PNG
Yep, I guess so. I don't see the sequence player, is it being dropped?
Clinton Reese

http://clintons3d.com

Return to “Rendering”