Love/Hate Relationship with Shape Editor
by Jordan Parsons · in Torque 3D Professional · 08/25/2009 (7:35 am) · 6 replies
I'm not sure if this would be considered a bug or not, so I'll let the Chris decide.
First off, I want to say to Chris and if there are others that have contributed to the Shape Editor: fantastic job! It's a valuable tool that has come in handy for many reasons, especially repositioning nodes...so again, great job and thanks for the hard work on it.
Now, to my hate side of Shape Editor - I can't for the life of me find a way to have mount nodes on my shape update in real-time within the World Editor after I make changes to them. Here's my scenario: I have a custom player model with a mount node in his hand and I've created a weapon whose object file also contains a mount node (not out of the ordinary). After configuring the mounts to link up, I notice that the weapon is slightly off and shooting through his palm instead of looking like it's supposed to with a normal grip. I of course try to change this by going into the Shape Editor and moving the mount point around a bit and save the mount nodes position. I go back into the World Editor and I notice there is no change at all - so I then exit the editor, get reintroduced with the Toolbox, then launch the World Editor again to finally be presented with the changes. Is this a bug, not a feature, or am I missing something?
First off, I want to say to Chris and if there are others that have contributed to the Shape Editor: fantastic job! It's a valuable tool that has come in handy for many reasons, especially repositioning nodes...so again, great job and thanks for the hard work on it.
Now, to my hate side of Shape Editor - I can't for the life of me find a way to have mount nodes on my shape update in real-time within the World Editor after I make changes to them. Here's my scenario: I have a custom player model with a mount node in his hand and I've created a weapon whose object file also contains a mount node (not out of the ordinary). After configuring the mounts to link up, I notice that the weapon is slightly off and shooting through his palm instead of looking like it's supposed to with a normal grip. I of course try to change this by going into the Shape Editor and moving the mount point around a bit and save the mount nodes position. I go back into the World Editor and I notice there is no change at all - so I then exit the editor, get reintroduced with the Toolbox, then launch the World Editor again to finally be presented with the changes. Is this a bug, not a feature, or am I missing something?
#2
Changes to the player's nodes should be reflected immediately in the World Editor.
The weapon's 'mountPoint' node transform is calculated only when the model is first loaded (it is then stored as a MatrixF in the ShapeBaseImageData datablock). So changes to this node will not be seen until the weapon model is reloaded.
You could create a console function to re-compute the mountTransform matrix (take a look at ShapeBaseImageData::preload).
08/25/2009 (7:58 pm)
@Jordan: Are you changing the player's 'mountX' node in the hand, or the weapon's 'mountPoint' node?Changes to the player's nodes should be reflected immediately in the World Editor.
The weapon's 'mountPoint' node transform is calculated only when the model is first loaded (it is then stored as a MatrixF in the ShapeBaseImageData datablock). So changes to this node will not be seen until the weapon model is reloaded.
You could create a console function to re-compute the mountTransform matrix (take a look at ShapeBaseImageData::preload).
#3
08/25/2009 (7:59 pm)
I should add - this is not anything directly to do with the Shape Editor, but rather that some objects do not expect node transforms to change, and thus only look them up once (at load time).
#4
@Michael - Thanks for the reply. I don't think would work only because it's the main player model, not a typical static shape that I could just drop into the world from the object picker. I can't remember if the editor comes with a player load object via GUI, although I could just do it with a script command. When I'm in my creative zone though, it just seemed easier to perform an exit from the editor and reload the level and get back in to editing. Maybe that's my downfall ;)
08/25/2009 (8:10 pm)
@Chris - That makes sense. As soon as I get home from work, I'll try it out. Oh, and I was changing the weapon's 'mountPoint' node. Thanks again for the assistance :)@Michael - Thanks for the reply. I don't think would work only because it's the main player model, not a typical static shape that I could just drop into the world from the object picker. I can't remember if the editor comes with a player load object via GUI, although I could just do it with a script command. When I'm in my creative zone though, it just seemed easier to perform an exit from the editor and reload the level and get back in to editing. Maybe that's my downfall ;)
#5
The problem is, when you make changes in the shape editor ... it only "saves" those changes to the objects .cs script (object.cs) ... so when you RE-LOAD the object next time (by restarting or selecting another object in editor ... then back to this one) ... THEN, it applies the changes you wanted to the nodes,etc.
You can permanently "fix" the changes in place using either of the following;
a) open the <objectname>.cs file ... and look for the ::onLoad() function the editor created. add this line to the end of it;
%this.saveShape("newShapename.dts");
... that will "save" a copy of the modified model, each time the model is opened in the editor or when its first opened by the engine.
b) from within shape editor, with the object loaded and in view ... run this in the console:
ShapeEditor.shape.saveShape("newShapename.dts");
And Chris had a good point when mounting objects ... and changing thier mount points, etc..
One way to get it to "re-read" the new mount point is to open another shape first, then go back - open the weapon and update its mountPoint and save it using above ... then re-open your shape model and re-mount the weapon again, this time with its new shape that has mountPoint adjusted.
Hope that helps ... have spent dozens of hours in this editor myself lately.
12/12/2011 (12:49 pm)
Jordan @The problem is, when you make changes in the shape editor ... it only "saves" those changes to the objects .cs script (object.cs) ... so when you RE-LOAD the object next time (by restarting or selecting another object in editor ... then back to this one) ... THEN, it applies the changes you wanted to the nodes,etc.
You can permanently "fix" the changes in place using either of the following;
a) open the <objectname>.cs file ... and look for the ::onLoad() function the editor created. add this line to the end of it;
%this.saveShape("newShapename.dts");
... that will "save" a copy of the modified model, each time the model is opened in the editor or when its first opened by the engine.
b) from within shape editor, with the object loaded and in view ... run this in the console:
ShapeEditor.shape.saveShape("newShapename.dts");
And Chris had a good point when mounting objects ... and changing thier mount points, etc..
One way to get it to "re-read" the new mount point is to open another shape first, then go back - open the weapon and update its mountPoint and save it using above ... then re-open your shape model and re-mount the weapon again, this time with its new shape that has mountPoint adjusted.
Hope that helps ... have spent dozens of hours in this editor myself lately.
#6
Not sure if thats the problem your having, but I'd check the *.cs file and make sure the node Parent is set before any Transform values so the engine knows where you want it.
P.S. I know what you mean about the ShapeEditor, lol.
12/12/2011 (7:44 pm)
One thing I've noticed is that in the corresponding *.cs file if you've changed the Parent of the node it cancels any Transform changes because the Parent is set after the Transform and forgets where you wanted the node.Not sure if thats the problem your having, but I'd check the *.cs file and make sure the node Parent is set before any Transform values so the engine knows where you want it.
P.S. I know what you mean about the ShapeEditor, lol.
Community Manager Michael Perry
ZombieShortbus
I can give you one tip, though. I do not think you have to exit the editor or application at all. I think you can just delete the model from the world, then add it back. The changes should be present once you add the model back.