Re: Jscript question, building a shader.

2016-02-25 Thread Olivier Jeannel
I'm already lurking a bit at vex in houdini, it doesn't seem far from JS.
But anyway, I'm missing the basics whatever the langage, the switch to
Houdini is not soon, my heas is exploding atm...
But that's really pleasant nonetheless when it works.

So far in xsi I have a complete set of two tools to put 1 texture per
polygon.
I have
1 python script (rray.de) to generate the uvs per poly (I also have an ice
tree that does the same job )
1 Jscript that automaticly build the shader and do the connections.

Not fully procedural, but not too bad :)))




On Thu, Feb 25, 2016 at 6:20 PM, Cristobal Infante  wrote:

> If you are really considering learning programming, I would recommend you
> learn python instead.
>
> You will be able to use it another apps like maya or houdini.
>
> On 25 February 2016 at 17:12, Olivier Jeannel 
> wrote:
>
>> That's awfully complicated :/  (for me)
>> I renamed my files with zero digit
>>
>> :)
>>
>> --
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>> with "unsubscribe" in the subject, and reply to confirm.
>>
>
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread Sandy Sutherland
+1 on Python - I did and have not looked back!

S.

On Thu, Feb 25, 2016 at 5:20 PM, Cristobal Infante  wrote:

> If you are really considering learning programming, I would recommend you
> learn python instead.
>
> You will be able to use it another apps like maya or houdini.
>
> On 25 February 2016 at 17:12, Olivier Jeannel 
> wrote:
>
>> That's awfully complicated :/  (for me)
>> I renamed my files with zero digit
>>
>> :)
>>
>> --
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>> with "unsubscribe" in the subject, and reply to confirm.
>>
>
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread Cristobal Infante
If you are really considering learning programming, I would recommend you
learn python instead.

You will be able to use it another apps like maya or houdini.

On 25 February 2016 at 17:12, Olivier Jeannel 
wrote:

> That's awfully complicated :/  (for me)
> I renamed my files with zero digit
>
> :)
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread Olivier Jeannel
That's awfully complicated :/  (for me)
I renamed my files with zero digit

:)
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread Stephen Blair
In JScript?
Maybe something like this:
http://stackoverflow.com/questions/1267283/how-can-i-create-a-zerofilled-value-using-javascript/1268377#1268377

On Thu, Feb 25, 2016 at 11:53 AM, Olivier Jeannel 
wrote:

> Hey, I have something working good ! :)
> My only problem is with the names :
>
> They are named like this : "visage_5.tga"
>
> I do :
>
> for (i=0 ; i<20 ; i++){
> SICreateImageClip("Pictures\\Visages\\Visages_"+i+".tga", null, null);
> }
>
> it works good until itteration 9
> I get :
> "visage_9.tga"
> at 10 I get
> "visage_10.tga" istead of "visage_00010.tga"
>
> Can you guys tell me if there is a syntax to have the number increment but
> keep the number of digit ?
>
> Otherwise, it's awesome :))
>
>
> On Thu, Feb 25, 2016 at 5:16 PM, Cristobal Infante 
> wrote:
>
>> i is the number (variable), but if you have inside " " it becomes a
>> string.
>>
>> the plus concatenates strings with variables
>>
>> On 25 February 2016 at 16:09, Olivier Jeannel 
>> wrote:
>>
>>> Gold !
>>> What is ["+i+"]   ?
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Feb 25, 2016 at 5:00 PM, Stephen Blair 
>>> wrote:
>>>
 i = 10
 LogMessage( "item[i]" )
 LogMessage( "item["+i+"]" )

 On Thu, Feb 25, 2016 at 10:46 AM, Olivier Jeannel <
 facialdel...@gmail.com> wrote:

> Hello there,
>
> Following my yesterday question "1 texture per polygon", I ended up
> connecting a huge TextureArraySwitch with up to 95 Textures. Did it by
> hand, took me a while.
>
> Ok no my deep desire is to do it with Jscript.
> Now, I have this :
>
> for (i=0 ; i<10 ; i++){
>
> Application.SIAddArrayElement("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values");
> }
>
> //it creates 10 entries in the node
>
> I need to populate each index value with incrementing values
>
> for (i=0 ; i<10 ; i++){
> SetValue("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values.Item[i].index",
> i, null);
> }
>
> But this gives me an error
> He doesn't like the item[i].
>
> Can someone tells me what I'm doing wrong I'm totally new to Jscript :/
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>


 --
 Softimage Mailing List.
 To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
 with "unsubscribe" in the subject, and reply to confirm.

>>>
>>>
>>> --
>>> Softimage Mailing List.
>>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>>> with "unsubscribe" in the subject, and reply to confirm.
>>>
>>
>>
>> --
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>> with "unsubscribe" in the subject, and reply to confirm.
>>
>
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread Olivier Jeannel
Hey, I have something working good ! :)
My only problem is with the names :

They are named like this : "visage_5.tga"

I do :

for (i=0 ; i<20 ; i++){
SICreateImageClip("Pictures\\Visages\\Visages_"+i+".tga", null, null);
}

it works good until itteration 9
I get :
"visage_9.tga"
at 10 I get
"visage_10.tga" istead of "visage_00010.tga"

Can you guys tell me if there is a syntax to have the number increment but
keep the number of digit ?

Otherwise, it's awesome :))


On Thu, Feb 25, 2016 at 5:16 PM, Cristobal Infante  wrote:

> i is the number (variable), but if you have inside " " it becomes a string.
>
> the plus concatenates strings with variables
>
> On 25 February 2016 at 16:09, Olivier Jeannel 
> wrote:
>
>> Gold !
>> What is ["+i+"]   ?
>>
>>
>>
>>
>>
>>
>> On Thu, Feb 25, 2016 at 5:00 PM, Stephen Blair 
>> wrote:
>>
>>> i = 10
>>> LogMessage( "item[i]" )
>>> LogMessage( "item["+i+"]" )
>>>
>>> On Thu, Feb 25, 2016 at 10:46 AM, Olivier Jeannel <
>>> facialdel...@gmail.com> wrote:
>>>
 Hello there,

 Following my yesterday question "1 texture per polygon", I ended up
 connecting a huge TextureArraySwitch with up to 95 Textures. Did it by
 hand, took me a while.

 Ok no my deep desire is to do it with Jscript.
 Now, I have this :

 for (i=0 ; i<10 ; i++){

 Application.SIAddArrayElement("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values");
 }

 //it creates 10 entries in the node

 I need to populate each index value with incrementing values

 for (i=0 ; i<10 ; i++){
 SetValue("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values.Item[i].index",
 i, null);
 }

 But this gives me an error
 He doesn't like the item[i].

 Can someone tells me what I'm doing wrong I'm totally new to Jscript :/

 --
 Softimage Mailing List.
 To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
 with "unsubscribe" in the subject, and reply to confirm.

>>>
>>>
>>> --
>>> Softimage Mailing List.
>>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>>> with "unsubscribe" in the subject, and reply to confirm.
>>>
>>
>>
>> --
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>> with "unsubscribe" in the subject, and reply to confirm.
>>
>
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread Cristobal Infante
i is the number (variable), but if you have inside " " it becomes a string.

the plus concatenates strings with variables

On 25 February 2016 at 16:09, Olivier Jeannel 
wrote:

> Gold !
> What is ["+i+"]   ?
>
>
>
>
>
>
> On Thu, Feb 25, 2016 at 5:00 PM, Stephen Blair 
> wrote:
>
>> i = 10
>> LogMessage( "item[i]" )
>> LogMessage( "item["+i+"]" )
>>
>> On Thu, Feb 25, 2016 at 10:46 AM, Olivier Jeannel > > wrote:
>>
>>> Hello there,
>>>
>>> Following my yesterday question "1 texture per polygon", I ended up
>>> connecting a huge TextureArraySwitch with up to 95 Textures. Did it by
>>> hand, took me a while.
>>>
>>> Ok no my deep desire is to do it with Jscript.
>>> Now, I have this :
>>>
>>> for (i=0 ; i<10 ; i++){
>>>
>>> Application.SIAddArrayElement("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values");
>>> }
>>>
>>> //it creates 10 entries in the node
>>>
>>> I need to populate each index value with incrementing values
>>>
>>> for (i=0 ; i<10 ; i++){
>>> SetValue("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values.Item[i].index",
>>> i, null);
>>> }
>>>
>>> But this gives me an error
>>> He doesn't like the item[i].
>>>
>>> Can someone tells me what I'm doing wrong I'm totally new to Jscript :/
>>>
>>> --
>>> Softimage Mailing List.
>>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>>> with "unsubscribe" in the subject, and reply to confirm.
>>>
>>
>>
>> --
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>> with "unsubscribe" in the subject, and reply to confirm.
>>
>
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread Olivier Jeannel
Gold !
What is ["+i+"]   ?






On Thu, Feb 25, 2016 at 5:00 PM, Stephen Blair 
wrote:

> i = 10
> LogMessage( "item[i]" )
> LogMessage( "item["+i+"]" )
>
> On Thu, Feb 25, 2016 at 10:46 AM, Olivier Jeannel 
> wrote:
>
>> Hello there,
>>
>> Following my yesterday question "1 texture per polygon", I ended up
>> connecting a huge TextureArraySwitch with up to 95 Textures. Did it by
>> hand, took me a while.
>>
>> Ok no my deep desire is to do it with Jscript.
>> Now, I have this :
>>
>> for (i=0 ; i<10 ; i++){
>>
>> Application.SIAddArrayElement("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values");
>> }
>>
>> //it creates 10 entries in the node
>>
>> I need to populate each index value with incrementing values
>>
>> for (i=0 ; i<10 ; i++){
>> SetValue("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values.Item[i].index",
>> i, null);
>> }
>>
>> But this gives me an error
>> He doesn't like the item[i].
>>
>> Can someone tells me what I'm doing wrong I'm totally new to Jscript :/
>>
>> --
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
>> with "unsubscribe" in the subject, and reply to confirm.
>>
>
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread Stephen Blair
i = 10
LogMessage( "item[i]" )
LogMessage( "item["+i+"]" )

On Thu, Feb 25, 2016 at 10:46 AM, Olivier Jeannel 
wrote:

> Hello there,
>
> Following my yesterday question "1 texture per polygon", I ended up
> connecting a huge TextureArraySwitch with up to 95 Textures. Did it by
> hand, took me a while.
>
> Ok no my deep desire is to do it with Jscript.
> Now, I have this :
>
> for (i=0 ; i<10 ; i++){
>
> Application.SIAddArrayElement("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values");
> }
>
> //it creates 10 entries in the node
>
> I need to populate each index value with incrementing values
>
> for (i=0 ; i<10 ; i++){
> SetValue("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values.Item[i].index",
> i, null);
> }
>
> But this gives me an error
> He doesn't like the item[i].
>
> Can someone tells me what I'm doing wrong I'm totally new to Jscript :/
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Re: Jscript question, building a shader.

2016-02-25 Thread patrick nethercoat
it's been a while, but my rusty jscript says you have to split this:

SetValue("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values.Item[i].index",
i, null);
}

like this:

SetValue("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values.Item["
+ i + "].index", i, null);
}

because i is your variable.


On 25 February 2016 at 15:46, Olivier Jeannel 
wrote:

> Hello there,
>
> Following my yesterday question "1 texture per polygon", I ended up
> connecting a huge TextureArraySwitch with up to 95 Textures. Did it by
> hand, took me a while.
>
> Ok no my deep desire is to do it with Jscript.
> Now, I have this :
>
> for (i=0 ; i<10 ; i++){
>
> Application.SIAddArrayElement("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values");
> }
>
> //it creates 10 entries in the node
>
> I need to populate each index value with incrementing values
>
> for (i=0 ; i<10 ; i++){
> SetValue("Sources.Materials.DefaultLib.Material.Texture_Array_Switch.values.Item[i].index",
> i, null);
> }
>
> But this gives me an error
> He doesn't like the item[i].
>
> Can someone tells me what I'm doing wrong I'm totally new to Jscript :/
>
> --
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com
> with "unsubscribe" in the subject, and reply to confirm.
>



-- 
Brandt Animation
www.brandtanim.co.uk
020 7734 0196
--
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.