Materials Adding
I'm trying to add to my rollout an option for the user to add a material of there choice to the selected object.
Whenever i try to do it, it wont convert the image so it will work on the box.
My code is:
button openbox "Add Material"
on openbox pressed do
(
myMap = getOpenFileName \
caption:"Open A Test File:" \
filename:"c:"
myMap = uvwMap mapType:4
addmodifier selection myMap
m = myMap
selection.material = m
)
Comments
The error is that you have
The error is that you have ")" where it should not be:
You don't need of the ")"
Use this:
Tools and Scripts for Autodesk 3dsMax
This works:
Tools and Scripts for Autodesk 3dsMax
I tried it work and it works
Thanks it seems to be working!! Legend!
You can check this thread. In
You can check this thread. In the code that I provided you can see how to get bitmap from the HDD and how to assign bitmaptexture to the diffuse slot of standard material.
Tools and Scripts for Autodesk 3dsMax
I can't exactly understand
I can't exactly understand what you want to acheive, but...
first you assign to myMap a filepath(file, which is not a material), then you assign to myMap a uvwMap modifier(which is not a material). Then m = myMap, so the m is uvwMap modifier, and finaly you assign, as material, to the selection of objects a modifier. Modifiers are not materials. Where is the material?
Tools and Scripts for Autodesk 3dsMax
The thing i'm trying to
The thing i'm trying to achieve is that I want the user to be able to select a bitmap from their computer and then be able to apply it to the selected object as a texture.
The code above was my way of trying to achieve that so it might be totally wrong. If you have any ideas on how i would code the thing im trying to achieve that would be amazing!!??
...
I also not understand , u can not assigne texture to object but you can assigne material with that texture in some slot to the objects
Maybe this tool u can use for your concept http://www.scriptspot.com/3ds-max/scripts/mapdroper
bga
I might of been explaining it
I might of been explaining it wrong.
Im trying to allow the user to select a bitmap image from thier computer and then apply that image as a material to the selected object?
...
Yup. Script that I suggested does that in similar way.
bga
That map droper is not really
That map droper is not really what i want but i tried this piece of code instead
button openbox "Add Material"
on openbox pressed do
(
usersimage = getOpenFileName caption: "Select Your Image" filename: maxFilepath types: "Images (*.bmp;)|*.bmp"
)
button applyMat "Apply Material"
on applyMat pressed do
(
m = standardmaterial()
material = m
m.diffusemap = Bitmaptexture fileName:usersimage
)
Although when i run it i come up with an error any ideas??