Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: Texturing Scripts  (Read 3214 times)

Jdez

  • Full Member
  • ***
  • Posts: 105
    • View Profile
    • Tech Blog
Texturing Scripts
« on: September 19, 2009, 08:36:18 am »

I was wondering if anyone has written any material scripts that also use textures?
Logged
Having fun with ASL!
Tech blog: http://jaydez-tech.blogspot.com

Kubajzz

  • Flying Platypus
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 548
  • Little doggie ate my avatar...
    • View Profile
Re: Texturing Scripts
« Reply #1 on: September 20, 2009, 08:50:12 am »

Hello Jdez,

I'm not sure if there are any material scripts that use textures... Anyway, I wrote a very simple one for you:

Code: [Select]
#command("object");

material $m;
texture $t;

/* Create a new material */
$m = project.NewMaterial("MyMaterial");

/* Create a new texture */
$t = project.NewTexture("MyTexture");
$t.SetFileName("c:\\Anim8or\\Example.jpg"); /* Enter your file path here */

/* Attach the texture to the newly created material */
$m.SetTexture(TEXTURE_DIFFUSE, $t);

/* Adjust the material settings */
$m.alpha = 0.5;
$m.diffuse = (0, 1, 0.5);
$m.Kd = 1;
$m.Ks = 0;
$m.SetBlendMode(TEXTURE_DIFFUSE, BLEND_MODE_LIGHTEN);
.... (more material settings)


The file path can be absolute or relative. If it is relative, then it starts from the "Project" folder that can be configured in the "File>Configure" dialog box.

I hope it helped ;)
Logged

Jdez

  • Full Member
  • ***
  • Posts: 105
    • View Profile
    • Tech Blog
Re: Texturing Scripts
« Reply #2 on: September 23, 2009, 11:16:05 am »

Thanks very much!
Logged
Having fun with ASL!
Tech blog: http://jaydez-tech.blogspot.com

BOB_I_Ts

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • Anim8rOrg
Re: Texturing Scripts
« Reply #3 on: October 21, 2009, 01:49:48 pm »

i made one using cube maps for a toon ink output
material_ink.zip extract all into your script folder then use script>run script
Logged