COB Export for Workspace

free scripts, plugins, models, textures
Post Reply
User avatar
clintonman
Captain
Posts: 5594
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

COB Export for Workspace

Post by clintonman »

The COB exporter will export simple meshes to the modelspace cob ascii format.
It sees most materials, exports motion and morph animation. Includes Workspace Dimensions if the mesh has some assigned and it will export NURBS patches and curves.

The main reason this was created was to work out the COB file format so it can be used with the upcoming Cloth Conversion script update.


https://clintons3d.com/plugins/truespac ... xport.html
Clinton Reese

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

Re: COB Export for Workspace

Post by clintonman »

Bug fix Nov 11

The U offset value for materials UV needed to be negated.

I also found that the bridge is not negating the value. The temporary fix: in modelspace sample the material and multiply the texture "U Offset" by -1.0 then reapply the material to the mesh. If U Offset is zero there is no need to change anything. After the "fix" workspace U offset will be wrong.
Clinton Reese

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

Re: COB Export for Workspace

Post by trueBlue »

Not sure what it is, but the Exported Cube as COB name is odd
Seems like there is invisible space at the end of the name (note the differences of the size of the title bars)
Picture shows the Imported Cube on the Left and I added another Model - Cube shown on the Right
Note: In the Model's Object panel, they both show as Cube
In the Link Editor, I cannot enter inside the Cube on the Left
Export COB.png
User avatar
clintonman
Captain
Posts: 5594
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: COB Export for Workspace

Post by clintonman »

trueBlue wrote: 12 Nov 2024, 16:57 Not sure what it is, but the Exported Cube as COB name is odd
Seems like there is invisible space at the end of the name (note the differences of the size of the title bars)
Picture shows the Imported Cube on the Left and I added another Model - Cube shown on the Right
Note: In the Model's Object panel, they both show as Cube
In the Link Editor, I cannot enter inside the Cube on the Left
Export COB.png
I see it. Really weird. You can manually fix it by going into the Name, press backspace then enter. The backspace seems to remove some invisible character.

Found it. The export ends each line with a carriage return and line feed. The file saved from modelspace has only a line feed.
Clinton Reese

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

Re: COB Export for Workspace

Post by trueBlue »

Observations:
Workspace Default material and Model Default material
DEFAULT DiffuseStrength
Workspace = 1.000
Model = 0.900
DEFAULT SpecularStrength
Workspace = 0.000
Model = 0.100

Exporting a COB from tS761 Standalone using Workspaces's Default material
Importing the above COB into tS751 full version
The imported material is more shinny than the exported Workspaces's Default material

Looks like you are setting these two values in your script:

Code: Select all

ShBxArr.push("diffuse factor: float 0.9");
ShBxArr.push("specular factor: float 0.4");//0.4 seems match workspace
User avatar
clintonman
Captain
Posts: 5594
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: COB Export for Workspace

Post by clintonman »

trueBlue wrote: 12 Nov 2024, 18:08 Observations:
Workspace Default material and Model Default material
DEFAULT DiffuseStrength
Workspace = 1.000
Model = 0.900
DEFAULT SpecularStrength
Workspace = 0.000
Model = 0.100

Exporting a COB from tS761 Standalone using Workspaces's Default material
Importing the above COB into tS751 full version
The imported material is more shinny than the exported Workspaces's Default material

Looks like you are setting these two values in your script:

Code: Select all

ShBxArr.push("diffuse factor: float 0.9");
ShBxArr.push("specular factor: float 0.4");//0.4 seems match workspace
No known way to match material properties workspace to modelspace. It can be any value you like and I'm ok with changing it because no one value will work for all materials.
Clinton Reese

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

Re: COB Export for Workspace

Post by trueBlue »

clintonman wrote: 12 Nov 2024, 18:24
trueBlue wrote: 12 Nov 2024, 18:08 Observations:
Workspace Default material and Model Default material
DEFAULT DiffuseStrength
Workspace = 1.000
Model = 0.900
DEFAULT SpecularStrength
Workspace = 0.000
Model = 0.100

Exporting a COB from tS761 Standalone using Workspaces's Default material
Importing the above COB into tS751 full version
The imported material is more shinny than the exported Workspaces's Default material

Looks like you are setting these two values in your script:

Code: Select all

ShBxArr.push("diffuse factor: float 0.9");
ShBxArr.push("specular factor: float 0.4");//0.4 seems match workspace
No known way to match material properties workspace to modelspace. It can be any value you like and I'm ok with changing it because no one value will work for all materials.
Since it is a model object, maybe setting it closer to Model's Default material would be better verses Workspace Default material
//ShBxArr.push("specular factor: float 0.4");//0.4 seems match workspace
ShBxArr.push("specular factor: float 0.1");//0.1 seems match model
Or maybe 0.000
User avatar
clintonman
Captain
Posts: 5594
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: COB Export for Workspace

Post by clintonman »

trueBlue wrote: 12 Nov 2024, 18:39
clintonman wrote: 12 Nov 2024, 18:24
trueBlue wrote: 12 Nov 2024, 18:08 Observations:
Workspace Default material and Model Default material
DEFAULT DiffuseStrength
Workspace = 1.000
Model = 0.900
DEFAULT SpecularStrength
Workspace = 0.000
Model = 0.100

Exporting a COB from tS761 Standalone using Workspaces's Default material
Importing the above COB into tS751 full version
The imported material is more shinny than the exported Workspaces's Default material

Looks like you are setting these two values in your script:

Code: Select all

ShBxArr.push("diffuse factor: float 0.9");
ShBxArr.push("specular factor: float 0.4");//0.4 seems match workspace
No known way to match material properties workspace to modelspace. It can be any value you like and I'm ok with changing it because no one value will work for all materials.
Since it is a model object, maybe setting it closer to Model's Default material would be better verses Workspace Default material
//ShBxArr.push("specular factor: float 0.4");//0.4 seems match workspace
ShBxArr.push("specular factor: float 0.1");//0.1 seems match model
Or maybe 0.000
0.1 or 0.0
Which one?
Clinton Reese

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

Re: COB Export for Workspace

Post by trueBlue »

clintonman wrote: 12 Nov 2024, 19:12
trueBlue wrote: 12 Nov 2024, 18:39
clintonman wrote: 12 Nov 2024, 18:24

No known way to match material properties workspace to modelspace. It can be any value you like and I'm ok with changing it because no one value will work for all materials.
Since it is a model object, maybe setting it closer to Model's Default material would be better verses Workspace Default material
//ShBxArr.push("specular factor: float 0.4");//0.4 seems match workspace
ShBxArr.push("specular factor: float 0.1");//0.1 seems match model
Or maybe 0.000
0.1 or 0.0
Which one?
Model plain solid and texture map including LW Model looks like it is set to 0.100
User avatar
clintonman
Captain
Posts: 5594
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: COB Export for Workspace

Post by clintonman »

Nov 12 2024
Bug fix

COB export was creating object names that ended with a CR causing issues in the workspace node.
Reduced the shininess value of the material.
Clinton Reese

http://clintons3d.com
Post Reply