I had an old script looping a folder's files so I added it to the previous
script I had sent.
Maybe it helps:

https://www.4shared.com/download/J4lYVJkg/mCreatePicGrid.js

What it does:
Open a ppg where you input your folder with pics.
Create an imageclip from every file in that folder
Creates a grid with the image clip name, applies a Lambert Material and
connects the imageclip to the material.
Resize the grid V size to match the image clip aspect ratio. It doesn't use
scale, but the primitive settings.
This for all the files in that folder.

What it doesn't do:
Basically doesn't check anything.
Doesn't check if he file is a valid picture or not.
Doesn't check if you already had those pictures or grids in your scene.
Doesn't freeze the TProjection.

Hope it helps.

And if you want to resize the object to match it's current image aspect
ratio you could do something like this:

//--------------------------------
//JScript
var sel = SIFilter(selection, siPolyMeshFilter)
for ( var i=0; i < sel.count; i++ ) {
var obj = sel(i)
var Mat = obj.Material
var Img = Mat.CurrentImageClip
var xres = Img.source.xres.value
var yres = Img.source.yres.value
obj.sclz = (yres / xres) * obj.sclx.value
}
//--------------------------------

It resizes Z Scale to match it's current image clip aspect ratio in all
selected polygon meshes.

M.Yara



On Sun, May 12, 2013 at 4:26 AM, olivier jeannel <[email protected]>wrote:

>  Paul, thank's for the long answer :)
> I understand better, I believe the various pictures sizes is the only
> thing that might not be treated directly out of the box.
> I get your point now, thank you ;)
>
> Olivier
>
>
> Le 11/05/2013 20:37, Paul Griswold a écrit :
>
>  Well, IMHO there are times when Softimage is too robust for it's own
> good.  In this case, being able to quickly set up a huge number of image
> planes without having to create a material, UVs, or even a grid, is great.
>
>  I'm a far cry from a TD, so I look at a huge pile of randomly sized
> images from my client that I have to use in a motion graphics piece and the
> only solution I have in my mind is to create a grid, apply a
> material/sprite node, attach an image, create UVs, and then repeat the
> process over and over until I have them all built.
>
>  With ImagePlane3D in Fusion you feed it an image, it generates a grid,
> creates UVs and assigns a surface automatically.  If you switch the image,
> it changes the grid to match the aspect ratio of the new image.
>
>  It's not that I'm enthusiastic about it, I'm just lazy and wanted a
> faster way to get things set up. ;-)
>
>  But it did get me thinking about Particle Illusion and how it does
> things & how cool it would be if ICE could do something similar.  PI is a
> particle system that fakes a lot of stuff by using images or image
> sequences.  Imagine if you could load an image / image sequence directly
> into ICE and change the Emit Shape to "Image" and instead of a point,
> sphere, etc., you emitted images.
>
>  -Paul
>
>
>
> On Sat, May 11, 2013 at 2:17 PM, olivier jeannel 
> <[email protected]>wrote:
>
>>  I'm not working this week end (no Softimage), but I don't really get
>> what is this image plane you're so enthousiast about.
>> Feel free to throw a screen grab (if you've got time).
>>
>> Take care,
>>
>> Olivier
>>
>> Le 11/05/2013 19:46, Paul Griswold a écrit :
>>
>>  Wow that's awesome!
>>
>>  Yeah, in Fusion the ImagePlane3D is used to set up matte shots.  You
>> can feed it an image and it'll just give you a grid that's exactly the
>> correct size/aspect to match the image & it also uses the alpha properly.
>>  It's great for quickly setting up an environment - you just load up trees,
>> bushes, a treeline, etc.
>>
>>  I was thinking about it, and what would be really cool is if there was
>> a way for ICE to read a bunch of images, create an array and then apply
>> them to the ICE rectangle particle shapes individually.  Basically the way
>> you'd normally pick a group of objects for your instance shapes, but just
>> with images.
>>
>>  Thanks!
>>
>>  Paul
>>
>>
>>
>>
>> On Sat, May 11, 2013 at 5:34 AM, Martin <[email protected]> wrote:
>>
>>>  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
>>>>
>>>>
>>>
>>
>>
>
>

Reply via email to