Showing posts with label Script. Show all posts
Showing posts with label Script. Show all posts

Friday, August 9, 2013

Useful script for architectural visualization

I use some scripts to speed up my workflow and here is some scripts I like to use.
Those scripts can find at http://www.scriptspot.com/

Clear out the dead wood from the layer manager
Delete all empty layers! If you need to deal with CAD file, this is a useful script.

Material Converter v0.98b
It works Scanline, Mental Ray, Vary and Maxwell Render.

Relink Bitmaps
Re-link missing files. If you have a lot of missing files, it is a great tool. Also, it is faster than Bitmap/Photometric Path.

Randomizer
Randomize position, rotation and scale. It is useful for changing tree sizes.

Random Selector
Select vertext, edge, border, face and element randomly. It is useful for deleting some leaves from tree.

Monday, June 3, 2013

Assign Material ID for multi/sub material

I deal with a lot of multi/sub materials and material IDs on a daily basis. It is painful if there are many sub materials. I really don't like this process... So, I created a tool which allows you to change all multi/sub material IDs with one click. Also, it shows used material IDs in a scene. 

I tested multi/sub , standard or A&G material with mr sky using 3ds max 2013 mental ray. Also, it works proxy objects.

Link to Material ID tool  - Drag and drop the file in a viewport. The tool will pop up.

Sunday, October 10, 2010

Creating a material library from a scene

Sometime I need to use exact same materials from a previous work and this scrip helps that kind of situation. It creates a material library from a scene materials.

for mat in scenematerials do append currentmateriallibrary mat

After evaluate all, a temporary material library shows up in a material editor. I found this script from a cgarchitect form and a comment from Eric.

If you want to create a tool bar, just you need to add macro script for it.

Somethink like this,

macroScript Library categry:"TempMaterial"

(

for mat in scenematerials do append currentmateriallibrary mat

)

You will find it under Customize User Interface > Toolbars > Main UI, Category - TempMaterial.

Monday, April 12, 2010

Max scripts from Max Script Help - Part 2 Move Objects to a Surface

I am not a max script specialist so please do not ask me why. I cannot answer it but here I will show some useful scripts and how it works. This script comes from MAXScript Help. You just need copy and paste it.
Move Objects to a Surface
When a terrain is not flat, it is time consuming to move each object (trees, lights, vehicles, or furniture) one by one. This script is really useful for this situation.
Go to Help > MAXScript Help >How To – Practical Examples > Move Objects to a Surface. This time, I will save this script to the tool bar. Inside of MAXSCRIPT box, copy all sentence;

macroscript MoveToSurface category:"HowTo"
(
fn g_filter o = superclassof o == Geometryclass
fn find_intersection z_node node_to_z =
(
local testRay = ray node_to_z.pos [0,0,-1]
local nodeMaxZ = z_node.max.z
testRay.pos.z = nodeMaxZ + 0.0001 * abs nodeMaxZ
intersectRay z_node testRay
)
on isEnabled return selection.count > 0
on Execute do
(
target_mesh = pickObject message:"Pick Target Surface:" filter:g_filter
if isValidNode target_mesh then
(
undo "MoveToSurface" on
(
for i in selection do
(
int_point = find_intersection target_mesh i
if int_point != undefined then i.pos = int_point.pos
)--end i loop
)--end undo
)--end if
)--end execute
)--end script

Then go to MAXScript > New Script… Paste this text, then go to Tools > Evaluate All.




Next, go to Customize > Customize User Interface > Toolbars. Under the Category, drop down menu choose HowTo(1). You will see MoveToSurface(2) under the Action now. Click New…(3) and type Script(4) then click OK to exit.








A New tool bar named Script should be appeared(5). Click MoveToSurface under the Action and drag to new tool bar(6). Now, you have new tool bar. You can turn on/off this bar easily. Right click one of your tools bar (Command Panel), then choose script.

One last thing, make sure an object’s Pivot point that you want to move to surface is bottom of the object.

Max scripts from Max Script Help - Part 1 Remove all Materials

I am not a max script specialist so please do not ask me why. I cannot answer it but here I will show some useful scripts and how it works. This script comes from MAXScript Help. You just need copy and paste it.

Remove all materials

When you get models from Sketchup, sometime (depend on models) you will get many different materials in the scene. If there are only 10 materials, it is easy to organize but if there are a couple hundred materials it is not so easy anymore. For times like that I use this script to clean up all materials in the scene/material editor.

Go to Help > MAXScript Help >How To – Practical Examples > Remove All Materials. Inside of MAXSCRIPT box, copy only this sentence;

$*.material = undefined

Then go to MAXScript > MAXScript Listener . Paste the sentence in this box then hit Enter. All materials should be gone in the scene/material editor. Now, you can organize your scene/ material easily.