Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Repeating Bitmap material load
  RSS 2.0 ATOM  

Repeating Bitmap material load
Rate this thread
 
60673
 
Permlink of this thread  
avatar
  • Hippo42
  • Posted: 05 October 2011 05:30 AM
  • Total Posts: 9
  • Joined: 05 October 2011 05:26 AM

I’m working on frames from a video, I have all the planes set up to attach bitmaps to. I have no problem doing this one by one, but with many hundreds of frames this could take me weeks! Can 3DS MAX order these planes, and allocate a different bitmap file to them automatically? I’m hoping to end up with all frames in order each on their own plane.

Or if there are any other suggestions of better ways to do this please let me know!

Many thanks.



Replies: 0
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

That should be pretty easy to script. I have to ask why you need every single frame of a movie on a separate Plane though.



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 0
avatar
  • hathMirx
  • Posted: 05 October 2011 07:21 AM

I’ll venture that something like this old saw will do the trick:

(

Plane length:20.2507 width:19.9407 pos:[-49.8407,49.8412,0] isSelected:on
Plane length:19.5674 width:20.2711 pos:[-19.8422,49.9262,0] isSelected:on
Plane length:20.0285 width:20.0329 pos:[10.366,49.9,0] isSelected:on
Plane length:20.1717 width:20.1763 pos:[40.1642,49.6892,0] isSelected:on
Plane length:20.1668 width:19.9045 pos:[-50.0325,20.228,0] isSelected:on
Plane length:19.8364 width:19.8364 pos:[-19.7949,19.9503,0] isSelected:on
Plane length:19.4671 width:20.1719 pos:[10.3317,20.1045,0] isSelected:on
Plane length:19.8985 width:20.3039 pos:[40.0574,19.6065,0] isSelected:on
Plane length:19.5287 width:19.9724 pos:[-49.9567,-10.2203,0] isSelected:on
Plane length:19.6783 width:20.4686 pos:[-19.8954,-9.91057,0] isSelected:on
Plane length:20.1685 width:19.868 pos:[9.7024,-10.3158,0] isSelected:on
Plane length:19.3473 width:20.0562 pos:[40.3576,-9.91939,0] isSelected:on
Plane length:19.9134 width:20.2867 pos:[-49.9582,-40.1267,0] isSelected:on
Plane length:20.1527 width:20.6029 pos:[-20.0312,-40.1457,0] isSelected:on
Plane length:20.3061 width:19.7784 pos:[10.0299,-39.9672,0] isSelected:on
Plane length:19.6282 width:19.9381 pos:[40.1938,-40.1933,0] isSelected:on

max select
select #($Plane01, $Plane02, $Plane03, $Plane15, $Plane05, $Plane06, $Plane07, $Plane08, $Plane09, $Plane10, $Plane11, $Plane12, $Plane14, $Plane16, $Plane04, $Plane13)
max move
select #($Plane17, $Plane18, $Plane19, $Plane20, $Plane21, $Plane22, $Plane23, $Plane24, $Plane25, $Plane26, $Plane27, $Plane28, $Plane29, $Plane30, $Plane31, $Plane32)
select $Plane30
select $Plane17
select #($Plane33, $Plane34)

c = 34
f = openFile “c:\users\administrator\desktop\fau_files.txt”—list of 34 images found in that directory to be serialized as input for material editor slots (basic singles)

if f != undefined then
(
g = 1
while (not eof f) do
(
ss = readLine f as stringStream
n = readDelimitedString ss “ “
i = readValue ss
meditMaterials[g].DirectX_Manger.enabled = off
meditMaterials[g].diffuseMap = Bitmaptexture filename: ([edit] should be a square-bracketted i here [end edit])
execute “$meditMaterials[g][#Maps][#Diffuse_Color__Map__” + g as string + “__” + i as string + “].alphaSource = 2”
execute “$Plane” + g as string + “.material = meditMaterials[” + g as string + “]”
g = g + 1
)
close f
)
)



Replies: 1
/img/forum/dark/default_avatar.png

Wow OK! Never used scripts before so this should be interesting, Thank you very much!

@steve : I’m actually doing every 10 frames, but that still comes out as many hundred images. I’m generating a model of peoples movements.

Author: Hippo42

Replied: 08 October 2011 12:40 AM  
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

As this is now a Maxscript thread, I’ll move it to the Maxscript Forum - better there as it’s not really a material specific question (any more).

If you can post the Plane object Names (not all, just enough that we know the sequence), likewise the image file names and the total number to deal with, this should be pretty easy. Also, what renderer, which material type you’re using - any details which might be relevent, especially your Max version. If there’s a numeric correlation between the Plane names and the Image filenames then that makes it a whole lot easier.

And just a note for hathMirx:- Hippo42 already stated that he/she has already created all the plane objects, so half your script is not necessary. Even if they weren’t there are much more concise ways to create them than “manually” doing them one at a time. When answering questions it pays to read the whole question carefully. Oh, and always enclose code inside CODE tags - that will prevent the problems with the brackets.



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 0