Final trueSpace 7.61 Beta 8 Unofficial Update

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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.
Attachments
FlattenVertices.RsObj
(5.6 KiB) Downloaded 48 times
Clinton Reese

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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:
Attachments
UVFlatten.RsObj
(35.26 KiB) Downloaded 53 times
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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;
Clinton Reese

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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
Attachments
UUCommands.RsObj
(221.06 KiB) Downloaded 50 times
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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();
Attachments
UUFunctionSet.RsObj
(35.74 KiB) Downloaded 54 times
Clinton Reese

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

Thanks, seems to be working now! :bananathumb:
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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?
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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.
Clinton Reese

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post 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
Post Reply