My mistake, it was xres and yres.
And now that I have opened SI, I wrote something.
If I haven't misunderstand what you need, you could do something like this:
//-------------------
//JScript
// Load Texture
var ImgFilePath = "Pictures\\TEST.tga";
var newImg = SICreateImageClip(ImgFilePath)(0);
xres = newImg.Source.xres.value;
yres = newImg.Source.yres.value;
// Create Grid
var r = ActiveSceneRoot;
var imgName = ImgFilePath.substring(ImgFilePath.lastIndexOf("\\")+1,
ImgFilePath.lastIndexOf("."));
var grid = r.AddGeometry("grid", "MeshSurface", imgName);
grid.vlength = (yres / xres) * grid.ulength.value;
// Apply Material
ApplyShader("$XSI_DSPRESETS\\Shaders\\Material\\Lambert.Preset", grid,
null, "", siLetLocalMaterialsOverlap);
var Shader = grid.Material.shaders("Lambert");
SIConnectShaderToCnxPoint(newImg, Shader.diffuse, false);
var TP = CreateProjection(grid, siTxtPlanarXZ, siTxtDefaultPlanarXZ, null,
"Texture_Projection", null, null, null)(1);
SetInstanceDataValue(null, Shader+".Image.tspace_id", TP);
grid.Material.name = imgName + "_Mat";
//-------------------
It will create a grid, keep the grid U value and change its Y value to
match the texture aspect ratio.
Make a loop with FSO and your folder with your textures and do your 100
grids in seconds.
regards,
M.Yara
On Sat, May 11, 2013 at 12:03 PM, Martin <[email protected]> wrote:
> I haven't used Fusion so I don't know exactly what is ImagePlane3D but if
> you want to create a grid, put a texture and match the aspect ratio to
> texture, I don't think there is something like that out of the box but that
> should be easily scriptable by reading the imageclip's source resx and
> resy. (I'm not in front of a PC but I think it was something like that
> imageclip.source.resx)
>
> cheers
>
> Martin
>
> On 2013/05/11, at 3:31, Paul Griswold <
> [email protected]> wrote:
>
> Softimage doesn't happen to have anything like Fusion's ImagePlane3D, does
> it?
>
> It's nothing more than a simple grid with an image mapped to it. But the
> nice thing is, there's no need to create UVs or a material and the grid is
> automatically sized to match the aspect ratio of the image you're feeding
> it.
>
> I have a project where I need to create probably 100+ of these simple
> image planes, so it'd be fantastic of Soft had something like that.
>
> -Paul
>
>