### Shape Editor

There are no stupid questions, just stupid answers.
• 1
• 2

#### Shape Editor

Bloodknight
Posts: 138
Joined: Tue Feb 03, 2015 8:58 pm
OK, so first time playing with shape editor in any real way since I've never really needed to before now.

Now, all appears to work perfectly well

Exhibit 1

Exhibit 2

exhibit 3

saving the result outputs the following file

Code: Select all

singleton TSShapeConstructor(DiceCubeDts) { baseShape = "./DiceCube.dts"; }; function DiceCubeDts::onLoad(%this) { %this.setDetailLevelSize("0", "999"); %this.addMesh("DiceCube 2", "DiceCube2.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "400"); %this.addMesh("200", "DiceCube3.dts", "DiceCube 0"); }
adding a 4th LOD (also edited the upper size so that the main dts pops in easier)
exhibit 4

Code: Select all

singleton TSShapeConstructor(DiceCubeDts) { baseShape = "./DiceCube.dts"; }; function DiceCubeDts::onLoad(%this) { %this.setDetailLevelSize("0", "800"); %this.addMesh("DiceCube 2", "DiceCube2.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "400"); %this.addMesh("200", "DiceCube3.dts", "DiceCube 0"); %this.addMesh("DiceCube 2", "DiceCube4.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "100"); }
BUT.....

exiting the mission and reentering the mission results in console errors
exhibit 5

editing the file to add full paths to the files results in asserts
exhibit 6

And this is as far as I have gotten so far this evening, some obvious issues are the writing of the file is inconsistent

Code: Select all

 %this.addMesh("DiceCube 2", "DiceCube2.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "400");
vs

Code: Select all

 %this.addMesh("200", "DiceCube3.dts", "DiceCube 0");
for what is effectively the same operation

manually editing the file seems to have either no effect (more console errors) or similar asserts as exhibit 6.

#### Re: Shape Editor

Jason Campbell
Posts: 253
Joined: Fri Feb 13, 2015 2:51 am

Hey Bloodknight,

I don't know why your having these errors. I have been working with the LOD details in this same exact manner. I do know that, each time you alter the levels, you will need to add the full path again.

I went in to shape editor and added all the levels of detail to your dice model and then saved and then added the paths. I then went out of the mission and back in. Everything worked with no errors to console.

Here's what it looked like. Are you adding the full paths correctly?

Code: Select all

singleton TSShapeConstructor(DiceCubeDts) { baseShape = "./DiceCube.dts"; }; function DiceCubeDts::onLoad(%this) { %this.addMesh("DiceCube 2", "art/shapes/dice/DiceCube2.dts", "DiceCube 0"); %this.setDetailLevelSize("0", "600"); %this.setDetailLevelSize("2", "400"); %this.addMesh("DiceCube 2", "art/shapes/dice/DiceCube3.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "200"); %this.addMesh("DiceCube 2", "art/shapes/dice/DiceCube4.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "100"); }

#### Re: Shape Editor

Duion
Posts: 966
Joined: Sun Feb 08, 2015 1:51 am

@
Jason Campbell

Why would you add LOD levels as separate files? I mean this is more work then just letting them in the same file, since you build the LOD levels as derivatives of the original model, which means you need the original file and exporting them into separate files just makes more work in the building process, in the export process and in the import process and later in the maintenance process of the whole project, so why you do that?

#### Re: Shape Editor

Jason Campbell
Posts: 253
Joined: Fri Feb 13, 2015 2:51 am

I'm addressing what he is trying to do. Is this not what he's attempting?

#### Re: Shape Editor

Duion
Posts: 966
Joined: Sun Feb 08, 2015 1:51 am

Oh it sounded like you were doing LOD levels like this as well, but seems like you tried to replicated it.
My point is that I cannot think of a scenario where something like this would make sense, so we are fixing a potential useless feature here.
Now I see it was probably just the path names, since it is missing the ./ to make it a relative path or absolutes would work as well.

#### Re: Shape Editor

Bloodknight
Posts: 138
Joined: Tue Feb 03, 2015 8:58 pm
@
Jason Campbell

Firstly thanks for taking the time to look at this, I used your file and it works fine, which means I at least have a working reference while finding and posting and possibly fixing the other issues around this particular problem.

Secondly, ignore Duion, he has been attacking me for days over this issue because his path is the one true path of righteousness and everybody who does it different is wrong.

The point being there is still an error in the process well maybe 3 potentially
1) The fact that the file that was written is malfunctioning, this is a bug and needs to be fixed.
2) The fact that it works when according to what I understand from the documentation as written it shouldn't (all but 1 detail level is the same in the script unless the level is just an irrelevant label)
3) The fact that the file writing is inconsistently ordered

Despite Duions continuing mission to dump on everything I do; this issue is relevant because the process is identical regardless of whether the meshes are in one file or multiple files and resetting or tweaking LOD distances and values vis script is far more efficient than just sending the files back to the artist for trivial non-art based changes.

#### Re: Shape Editor

Jason Campbell
Posts: 253
Joined: Fri Feb 13, 2015 2:51 am

No problem, Bloodknight,

I agree that this is a bug. We should be able to alter these settings in the Shape Editor and know that they will be saved correctly.

What I've found is that regardless of how inefficient it may seem, sometimes this method is needed, anyway. For instance, my art pipeline, for structures is pretty dicey and Blender fights me every step of the way. I ended up having to import the lower LOD into Blender as an .obj. Well I messed around with getting the details setup and everything was great. I get it into the game and the axis are all messed up. Spent another night trying to get it fixed. Long story short, I gave up and just added a second shape and it works fine now. Also third party assets sometimes are just easier to add as separate shape. Performance seems fine.

#### Re: Shape Editor

Bloodknight
Posts: 138
Joined: Tue Feb 03, 2015 8:58 pm
ok, so, the problem was caused in part by an older guide from the GG forums which no longer works as specified in the thread there This thread in case anybody is interested.

Another issue was the slight inconsistency in how the editor itself works, in that it has used both of the 'working' methods for writing to the file, this should probably be looked at at the same time as addressing the path writing bug.

#### Re: Shape Editor

Bloodknight
Posts: 138
Joined: Tue Feb 03, 2015 8:58 pm

Code: Select all

singleton TSShapeConstructor(DiceCubeDts) { baseShape = "./DiceCube.dts"; }; function DiceCubeDts::onLoad(%this) { // Sets the size of the baseshape %this.setDetailLevelSize("0", "600"); // This works /* %this.addMesh("DiceCube 2", "art/shapes/dice/DiceCube2.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "500"); %this.addMesh("Dicecube 2", "art/shapes/dice/DiceCube3.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "400"); %this.addMesh("Dicecube 2", "art/shapes/dice/DiceCube4.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "300"); %this.addMesh("Dicecube 2", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "200"); %this.addMesh("Dicecube 2", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "100"); */ // This also works /* %this.addMesh("DiceCube2", "art/shapes/dice/DiceCube2.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "500"); %this.addMesh("Dicecube2", "art/shapes/dice/DiceCube3.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "400"); %this.addMesh("Dicecube2", "art/shapes/dice/DiceCube4.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "300"); %this.addMesh("Dicecube2", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "200"); %this.addMesh("Dicecube2", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); %this.setDetailLevelSize("2", "100"); */ /** * the above two methods create the name+detail using the addMesh() * it then replaces the +detail part using setDetailLevelSize(old, new) * * They essentially create the following methods * It appears that names are arbitrarily irrelevent, but there must be a name. */ // This works too //%this.addMesh("DiceCube 500", "art/shapes/dice/DiceCube2.dts", "DiceCube 0"); //%this.addMesh("Dicecube 400", "art/shapes/dice/DiceCube3.dts", "DiceCube 0"); //%this.addMesh("Dicecube 300", "art/shapes/dice/DiceCube4.dts", "DiceCube 0"); //%this.addMesh("Dicecube 200", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); //%this.addMesh("Dicecube 100", "art/shapes/dice/DiceCube6.dts", "DiceCube 0"); // This works too //%this.addMesh("DiceCube500", "art/shapes/dice/DiceCube2.dts", "DiceCube 0"); //%this.addMesh("Dicecube400", "art/shapes/dice/DiceCube3.dts", "DiceCube 0"); //%this.addMesh("Dicecube300", "art/shapes/dice/DiceCube4.dts", "DiceCube 0"); //%this.addMesh("Dicecube200", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); //%this.addMesh("Dicecube100", "art/shapes/dice/DiceCube6.dts", "DiceCube 0"); // This works too // I think this method best reflects the actuality of whats going on %this.addMesh("detail500", "art/shapes/dice/DiceCube2.dts", "DiceCube 0"); %this.addMesh("detail400", "art/shapes/dice/DiceCube3.dts", "DiceCube 0"); %this.addMesh("detail300", "art/shapes/dice/DiceCube4.dts", "DiceCube 0"); %this.addMesh("detail200", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); %this.addMesh("detail100", "art/shapes/dice/DiceCube6.dts", "DiceCube 0"); // This Crashes (waahhhhh) /* %this.addMesh("500", "art/shapes/dice/DiceCube2.dts", "DiceCube 0"); %this.addMesh("400", "art/shapes/dice/DiceCube3.dts", "DiceCube 0"); %this.addMesh("300", "art/shapes/dice/DiceCube4.dts", "DiceCube 0"); %this.addMesh("200", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); %this.addMesh("100", "art/shapes/dice/DiceCube5.dts", "DiceCube 0"); */ } 

#### Re: Shape Editor

Bloodknight
Posts: 138
Joined: Tue Feb 03, 2015 8:58 pm
I came, I saw, I failed...

Code: Select all

function DiceCubeDts::onLoad(%this) { %this.setDetailLevelSize("0", "600"); %this.addMesh("detail500", "./DiceCube2.dts", "DiceCube 0"); %this.addMesh("detail400", "./DiceCube3.dts", "DiceCube 0"); %this.addMesh("detail300", "./DiceCube4.dts", "DiceCube 0"); %this.addMesh("detail200", "./DiceCube5.dts", "DiceCube 0"); %this.addMesh("detail100", "./DiceCube6.dts", "DiceCube 0"); %this.setMeshSize("Detail 100", "105"); %this.setMeshSize("Detail 105", "110"); %this.setDetailLevelSize("110", "100"); %this.setMeshSize("Detail 100", "150"); %this.setMeshSize("Detail 150", "160"); %this.setMeshSize("Detail 160", "170"); %this.setMeshSize("Detail 170", "180"); }
I'm not entirely sure what the shape editor uses to write the shapefile, I found this function DefineTSShapeConstructorMethod( writeChangeSet but trying to trace its contents and the details proved difficult, it appears to read in the current file and add a set of changed data to the end of the file. I have yet to track the source of this data, and I suspect changing this behaviour to something sensible is probably going to be even more complicated.
• 1
• 2

#### Who is online

Users browsing this forum: No registered users and 1 guest