Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Making Boxes by Scripting

Create and set a new Maya project named "Box_Project".

Write a MEL script that does the following:

Starting from a negative X position (e.g., -15), increment X by a small amount (e.g., 3), until X is its positive value (e.g., 15); for each X:

1. make a polyCube with a sequentially-numbered name (e.g., "box1")

2. add the name to an array of names; e.g., if the array is $boxes, then $boxes[i] = $name, where i is 0 for the first box, 1 for the second box, etc., and $name is the next sequentially-numbered box name. So, $boxes[0] is set to "box1", $boxes[1] is set to "box2", etc.

3. move the polyCube to the current X position (MEL command is move -x xValue)

4. scale the polyCube to a random height of between 1 and 5 units:

MEL function rand(m, n) generates a random float between m and n

MEL command scale -y ySize resizes selected object to the ySize on the Y axis (i.e., height)

Use a text editor like Notepad (or, even better, Notepad++) to type your script. Then, save the script as a .mel file in your project's scripts folder.

In Maya's Script Editor, use the Source Script... button () to load and run your script. Once it is working correctly, you should see a row of randomly-sized boxes along the X-axis.

Make a copy of your script file. Then, modify one of the copies so that the boxes are randomly colored:

Using the MEL function rand(1), which generates a random float between 0 and 1, get 3 random values for red ($red), green ($green) and blue ($blue) intensities. Then, randomly color the polyCube using the MEL command

polyColorPerVertex -r $red -g $green -b $blue -a 1 -cdo;

Once you are done, submit your final script (.mel) file, below.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92063314

Have any Question?


Related Questions in Computer Engineering

Python programmingplease i would like some help in checking

Python programming Please I would like some help in checking if my source code for is susceptible to short-circuit evaluation.I don't need answers, I just need corrections. The source code is to check the integer parts o ...

You are running a memory-intensive multimedia application

You are running a memory-intensive multimedia application on your computer, which has 1 GB RAM installed. You observe that the computer momentarily stops responding when you switch between two multimedia applications. 1. ...

Requirementswrite a java program that reads a set of

Requirements: Write a java program that reads a set of integer lattice points, prints out the ones on the boundry of the convex hull sorted left to right (ie by x-coordinate), and then accepts additional points and deter ...

Question suppose you had to design a wired ethernet network

Question : Suppose you had to design a wired Ethernet network for a 4-story office building containing 20 users per floor. Each floor is 90 meters in length and 5 meters in height. Draw a network topology of your propose ...

We say that a binary tree t is perfectly balanced if for

We say that a binary tree T is perfectly balanced if, for each node n in T , the number of keys in the left and right subtrees of n differ at most by 1. Write an algorithm called Is-Perfectly-Balanced that, given a binar ...

Solve the following one 1 self-check problems on paper and

Solve the following one (1) Self-Check problems on paper and bring your sheet of paper to your section on Thursday: Write a function called grades that takes a list of tuples as a parameter. Each tuple in this list conta ...

Question critical infrastructures -1discuss cybersecurity

Question: Critical Infrastructures - 1. Discuss cybersecurity policy issues affecting SCADA and ICS systems for Critical Infrastructure services for the public, and compare those issues to the policy issues that affect t ...

It is required to design an iterative combinational circuit

It is required to design an iterative combinational circuit that computes the equation Z=2*X-Y, where X and Y are n-bit unsigned numbers. (i) Determine the number of inputs and outputs needed for your 1-bit cell. (ii) De ...

What are the overall cost leadership differentiation and

What are the overall cost leadership, differentiation, and focus strategies?

Display the manager of the employee with the oldest project

Display the manager of the employee with the oldest project start date (start_date). (This query requires 3 nested queries, start by finding the min start_date from project, then find the emp_id from project where start_ ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As