ScriptSpot

Script

Decal Script Object

By Apple_Hardcore · Credited author: Nolan Cunningham · 2009-12-05

Version
00.4beta
Version requirement
tested in 3Ds Max 2009
Date updated
2009-12-06
Votes
10
Description

Additional Info

this script hasn't been tested to thoroughly so post any issues you might have. tool should end up in helper objects under GameDevTools after being executed fixed an issue resulting in bad UVs when target object had transforms on it.
Videos
Attachments

Tags: decals

Comments (19)

UV Bug

Westmark · 2022-03-07

Found the bug in the uv generation

Sone values wasn't set correctly

On line 292:
--UVMod.length = -1
--UVMod.Height=1

Change to:
UVMod.length = -1
UVMod.width = 1
UVMod.height = 1

Unsure if the capital "H" was an issue, but just to be safe ;)

Hope someone can help

Myth65 · 2020-10-22

Hi,

The preview for the decal is perfect but the UVs for the plane that it creates is messed up. Ideally I would like the UVs to automatically cover the entire 0-1 UV space. See attached images.

I was hoping if anyone can take a look at this script and give me some insight on how it may be adjusted to achieve the correct result. The script is over 10 years at this point but I think can be extremely handy if the UV's were correct.

Attachments

ShiroEd · 2009-12-22

Im having the same problem. UVs are not correct to display the texture. We need the 'created' mesh's UV's to be scaled to fit into normal UV 0,1 space if you know what I mean?

Currently the UVs are coming out really small for me within UV space 0,1.

Max 2010 x64

Apple_Hardcore · 2009-12-23

Ok I think I got it. although I;m not sure. I got the same results when I tried one of the functions on a preexisting object because the UV modifier wasn't set to 1x1. when I apply my UV in the script it automatically goes to 1x1. I'm not sure if it's different for you but it might fix it.

Apple_Hardcore · 2009-12-20

ok re-uploaded...
thanks for testing the script BTW hope I can get it to work for you.

Apple_Hardcore · 2009-12-20

I'm using max 32 but I can't imagine that would make a difference, I haven't had any experience with the different skews though. I'm having a hard time figuring out what could cause such totaly different out comes.

I'm curious if anyone else is having any problems..

I'll re-upload the latest script to make sure I haven't botched up on that end.

Ankebut · 2009-12-20

yes I am using max 2009 x64...but with 3ds clean mod...maybe ill try it without...

Apple_Hardcore · 2009-12-20

we might just end up needing some more people to test this script to find out where the issue is.

Ankebut · 2009-12-20

here you have the max scene...tried it again with real world scaling etc...same error...cut off meshes + weird uv

look file attached

Attachments

Apple_Hardcore · 2009-12-20

are you using max 2009?

also couldn't reproduce the error with it not working in the startup scripts directory..it works for me. not sure how to proceed with that.

just tested out your scene as well... and it worked for me... must be your version of max or perhaps it's mine. but I'm not having any issues. also try to redownload the script to make sure you have the latest one.

Ankebut · 2009-12-20

Hi

its me again.

Here I have a screenshot for you:

http://img5.imagebanana.com/view/y8vg953u/123.jpg

As you can see the generated UV Map is huge...I assigned a checker map with huge tiling but if assigned to generated object, the checker map is extremely oversized...maybe you can take a look at it.

Another problem ist the decal object,...as you see the generated mesh is not complete (deleted triangles).

and a small wish: Although I extraced the script to scripts/startup, it does not start with max...maybe you could make a installer or code it so, so that it starts with max if extracted to startup folder.

thanks.

Apple_Hardcore · 2009-12-20

is the checker pattern using real-world scale? because that would cause it to unwrap wierd. also I cull any back faceing faces so that might be the issue you'r having. but I'll take a look...can you send me the max scene.. i don't know i you can attactch files on here?

Ankebut · 2009-12-16

Very cool script...but i miss features like setting x/y size for decal object...

+ the material button does not work very vell (cant copy materials from/to material editor or drag materials)

Also this generated decal object has bad UV...if I assign material, the mat is not visible because of the UV...have to re unwrap it...maybe you could fix it too?

Could you add these 2 features? Would be very nice!

THX

Apple_Hardcore · 2009-12-16

I don't understand what you mean by decal object has bad UVs, can you give me the steps to reproduce this bug? I'll get the other features in soon.

also make sure you have the latest script since i fixed an issue last week which resulted in bad UVs

Apple_Hardcore · 2009-12-17

you can now assign a material to the preview object and it should apply it to the finnal object that way you can use the material editor to assign materials to it. I don't want to do much more then that because I would have to rewrite the script from a geometry rather then a helper object... at least I think, unless you know can find a way to get the material editor to recognise helpers as valid targets.

also added the numeric size in. it doesn't play nice with the preview but just turn it on and off and should work. othwise just scale the tool.

Admin · 2009-12-10

FYI while you're welcome to post your script using code tags you'll find it's easier to update your script and easier for people to use it if you just attach it as a file. Typically people use the code tags to post short code snippets in the forums...

To attach a file to your post just expand the "File Attachment" area at the bottom of new post or when you're editing an existing post...

Thank you for your contribution to ScriptSpot!

Christopher Grant
ScriptSpot.com

Apple_Hardcore · 2009-12-08

Ooops it was a last minute thing to put the functions inside the Tool it self. also added the "delete back faces" feature.

Hopefully it all works now.

Anubis · 2009-12-05

Sound interesting... I see some custom function (FindNormal4me) that not exist in the script at this line:

DecalRay = FindNormal4me $.assobj

Maybe after including will work?

IKS2k · 2009-12-05

not working ... :(

max immediately closed