Plugin info
by Jaimi McEntire · in Constructor · 05/08/2007 (8:22 am) · 3 replies
Ok - now that I've finished my first plugin (the "house shape"), I'm ready to tackle some more. I need some more information, though:
Plugin #2 will be a Face Extruder, assuming that I can get the following information (needed for the other plugins as well):
1. How do you access the currently selected face(s)?
2. How do you get the plane for a selected face?
3. How do you get the vertexes for a face?
Plugin #3 will be a "plane mover", which will let you adjust the position of a plane.
Plugin #4 will be a "face sizer", which will let you adjust a face by scaling the vertexes. (actually will adjust the faces that connect to the face).
I'm also going to expand the house shape plugin to allow you to make walls and a seperate roof for the house shape (like if you had hollowed it, but without doing a CSG subtract, so we have a nice placement of walls).
Anybody have any ideas for other plugins that you would like to see?
Plugin #2 will be a Face Extruder, assuming that I can get the following information (needed for the other plugins as well):
1. How do you access the currently selected face(s)?
2. How do you get the plane for a selected face?
3. How do you get the vertexes for a face?
Plugin #3 will be a "plane mover", which will let you adjust the position of a plane.
Plugin #4 will be a "face sizer", which will let you adjust a face by scaling the vertexes. (actually will adjust the faces that connect to the face).
I'm also going to expand the house shape plugin to allow you to make walls and a seperate roof for the house shape (like if you had hollowed it, but without doing a CSG subtract, so we have a nice placement of walls).
Anybody have any ideas for other plugins that you would like to see?
#2
fortunately there was some source that did this that I didn't see originally, so you can get the selected
faces straight from the map:
%map = scene.getCurrentMap();
%map.getSelectedFaces();
2. How do you get the plane for a selected face?
3. How do you get the vertexes for a face?
Now for the rest, a little bit of browsing the raw EXE turned up some likely functions. With that, I was able to figure out how to get the information I needed. Here is a chunk of code that takes a brush, and dumps out the faces, planes and vertexes for a brush:
05/09/2007 (8:43 pm)
1. How do you access the currently selected face(s)?fortunately there was some source that did this that I didn't see originally, so you can get the selected
faces straight from the map:
%map = scene.getCurrentMap();
%map.getSelectedFaces();
2. How do you get the plane for a selected face?
3. How do you get the vertexes for a face?
Now for the rest, a little bit of browsing the raw EXE turned up some likely functions. With that, I was able to figure out how to get the information I needed. Here is a chunk of code that takes a brush, and dumps out the faces, planes and vertexes for a brush:
%map = scene.getCurrentMap();
%brushid = %brush.getBrushid();
%facecount = %map.getNumBrushFaces(%brushid);
echo("Brush ID is " SPC %brushid);
echo("face count is " SPC %facecount);
for(%i=0; %i<%facecount; %i++)
{
%faceid = %map.getFaceID(%brushid,%i);
%faceplane = %map.getFacePlane(%brushid,%faceid);
%vertexcount = %map.getNumFaceVertices(%brushid,%faceid);
echo(" Face ID is " SPC %faceid SPC " plane " SPC %faceplane);
echo(" Face has " SPC %vertexcount SPC "Vertexes");
for (%v = 0;%v<%vertexcount; %v++)
{
%vertpos = %map.getFaceVertexPosition(%brushid,%faceid,%v);
echo(" Vertex " SPC %v SPC %vertpos);
}
}
#3
I find that when im working on complex stuff I use placeholder textures or sub par textures until the end.
I usually delete these textures from the album.
There is already a select same material button in Constructor and my method up to now has been to seek out these materials and replace them one by one.
The thing is I have to see them in the viewport to replace them, which can involve isolating one brush at a time and checking each face (hide unselected/ unhide all) which as you can imagine is real time consuming.
Selecting the same material somehow without having to find a face with the material on it would be a big help.
Maybe having it work of "current texture" rather then selected faces.
This would solve me having to hold to irrelevant textures just to please map2dif.exe
05/11/2007 (9:41 am)
Replace textures that no longer exist with a standardised texture that does.I find that when im working on complex stuff I use placeholder textures or sub par textures until the end.
I usually delete these textures from the album.
There is already a select same material button in Constructor and my method up to now has been to seek out these materials and replace them one by one.
The thing is I have to see them in the viewport to replace them, which can involve isolating one brush at a time and checking each face (hide unselected/ unhide all) which as you can imagine is real time consuming.
Selecting the same material somehow without having to find a face with the material on it would be a big help.
Maybe having it work of "current texture" rather then selected faces.
This would solve me having to hold to irrelevant textures just to please map2dif.exe
Torque Owner Bobby Leighton
Imagn' Games