Page 148 of 184

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 00:12
by clintonman
trueBlue wrote: 14 Aug 2022, 23:41 Thanks!
It's final resting place:
UUFS = Node.AccessFnSet("Scripts/UUCommands/UUFunctionSet");UUFS.UVFlatten();

I tried it on several Characters from the library
Can tell if it is working and not seeing the modal error
I see. It's looking at the skeleton and seeing that it's made of triangles.
Fixed to skip skeletons and added error for cameras and lights.
I also made the function name more explicit since you're adding it to a function set. "CheckDescendants" was too generic to be in the same script as other functions.

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 13:16
by trueBlue
In my previous post, I said: "Can tell if it is working and not seeing the modal error"
I meant to say, "I can NOT tell if it is working and not seeing the modal error

Still not sure if this is working
I do not see any activity when I run Flatten UVs in the Command History
I do see activity when I run the other UV Editor tools
.
Flatten UVs.png
.
Additionally, if you run the toolbar LMB command from a jScript, it gives an error:
ERR Source object: /Project/Space 3D/jScript command Error: Microsoft JScript runtime error Description: 'null' is null or not an object Error code: 0x800a138f - (null) Line: 326, Char: 3 Script text: IMPORTANT - if the above mentioned command is accessing any function set, the error line above may refer to the function set code, instead of command code!
Edit: When I run this from the UV Editor, I see this in the Rosetta.log:

Code: Select all

WARN  Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 318, Char: 2 Script text:    0x80020101 
Line 318 in the UUFunctionSet:
themesh = Node.Value(thenode, "Mesh");

Here is the toolbar button:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 14:00
by clintonman
trueBlue wrote: 15 Aug 2022, 13:16 In my previous post, I said: "Can tell if it is working and not seeing the modal error"
I meant to say, "I can NOT tell if it is working and not seeing the modal error

Still not sure if this is working
I do not see any activity when I run Flatten UVs in the Command History
I do see activity when I run the other UV Editor tools
.
Flatten UVs.png
.
Additionally, if you run the toolbar LMB command from a jScript, it gives an error:
ERR Source object: /Project/Space 3D/jScript command Error: Microsoft JScript runtime error Description: 'null' is null or not an object Error code: 0x800a138f - (null) Line: 326, Char: 3 Script text: IMPORTANT - if the above mentioned command is accessing any function set, the error line above may refer to the function set code, instead of command code!
Edit: When I run this from the UV Editor, I see this in the Rosetta.log:

Code: Select all

WARN  Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 318, Char: 2 Script text:    0x80020101 
Line 318 in the UUFunctionSet:
themesh = Node.Value(thenode, "Mesh");

Here is the toolbar button:
I can't test without your UUFunctionSet.

Edit: was able to create error when load head from library and apply hair from library. Everything else is working.

Edit:
You can add this to the top of CheckUVMeshDescendants, to stop hair errors.

Code: Select all

function CheckUVMeshDescendants(thenode)
{
	if(Node.ConExists(thenode, "Hair data")) return;

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 14:17
by trueBlue
Here is the current UUCommands
UVFlatten is at the bottom

Can you look at the function ResetContext()
I was wanting to use the:
var globalFS = Node.AccessFnSet("Scripts/UUCommands/Global Function Set");
for the Question
Not sure how to write the new Question
Maybe add "Default Context" for the title and NOT urgent

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 14:28
by trueBlue
I tried the original UV Flatten command and it worked but you would have to rearrange the UVs
Original UV Flatten command.png
Compare the previous pic with this one

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 15:37
by clintonman
Changes to use the global function set, changed question title and fixed hair for flatten uv.

button commands, RunScriptBuffer is needed to use one function set inside another when called from a toolbar button:

Code: Select all

//flatten button
cmd='GFS=Node.AccessFnSet("Scripts/UUCommands/Global Function Set");UUFS=Node.AccessFnSet("Scripts/UUCommands/UUFunctionSet");UUFS.GlobalFS=GFS;UUFS.UVFlatten();';RsApp.RunScriptBuffer(cmd);
//reset context button
cmd='GFS=Node.AccessFnSet("Scripts/UUCommands/Global Function Set");UUFS=Node.AccessFnSet("Scripts/UUCommands/UUFunctionSet");UUFS.GlobalFS=GFS;UUFS.ResetContext();';RsApp.RunScriptBuffer(cmd);
reference human readable version of uvflatten

Code: Select all

//readable
GFS=Node.AccessFnSet("Scripts/UUCommands/Global Function Set");
UUFS=Node.AccessFnSet("Scripts/UUCommands/UUFunctionSet");
UUFS.GlobalFS=GFS;
UUFS.UVFlatten();

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 16:29
by trueBlue
Thanks, seems to be working now! :bananathumb:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 16:42
by trueBlue
BTW... this was my first test to incorporate additional toolbar commands from the Scripts/Commands into the UUFunctionSet
Now that you have seen the UUFunctionSet, what are your thoughts?
Should I continue with the rest of the Scripts/Commands scripts?

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 17:02
by clintonman
trueBlue wrote: 15 Aug 2022, 16:42 BTW... this was my first test to incorporate additional toolbar commands from the Scripts/Commands into the UUFunctionSet
Now that you have seen the UUFunctionSet, what are your thoughts?
Should I continue with the rest of the Scripts/Commands scripts?
If you've done close to half of all of them then it should be split into 2 function sets, if you've already done most then maybe they'll all fit well into 1 function set. If it gets too long I'll help break it up.

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Posted: 15 Aug 2022, 17:32
by trueBlue
The scripts below the Camera toolbar will go into a new Function Set
All of the scripts to the left (13) are the remaining scripts needing attention
Most are pretty lengthy (100 lines or more)
Some use: RsApp.RunScriptBuffer(cmd); (1 Undo)
Not even sure if you can use these in a Function Set
Remaining scripts.png