Visualizing AutoCAD Plant 3D models Using Autodesk 3ds …help.autodesk.com.s3.amazonaws.com/sfdcarticles/kA230000000tgulC… · Visualizing AutoCAD® Plant 3D models Using Autodesk®

  • Upload
    tranthu

  • View
    252

  • Download
    0

Embed Size (px)

Citation preview

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    David Tyner The Shaw Group, Inc.

    PD4241- In this class, we will cover a few techniques that will enable you to raise the quality of your visualizations without raising your budget. We will explain how to import AutoCAD Plant 3D software models into Autodesk 3ds Max. You will learn about an easy-to-use lighting system that produces great results. We will use animation constraints to simulate construction procedures. If at any point you find you have questions, feel free to email me [email protected] Also check the 3DS Max help file, it's very...helpful.

    LearningObjectivesAt the end of this class, you will be able to:

    Import Plant 3D (DWG) models into 3ds Max

    Create a quick and easy lighting solution that looks great

    Use animation constraints to simulate construction procedures

    AbouttheSpeakerI was going to write my own bio. However, my friend Ben Wang (Autodesk) sent me this. I liked it better, so were going with this.

    Dave Tyner is a unique, cutting edge thinker (and doer) who is helping to shape and transform the industrial engineering world. In his day job, he works at Shaw (www.shawgrp.com), one of the worlds largest engineering firms serving the energy, chemicals, environmental, and infrastructure industries. There he is pushing the boundaries of engineering visualization, applying new technologies to the stodgy practice of engineering in heavy industry. The best way to describe what he is achieving is that he is establishing a technological mash-up of engineering and media/entertainment technology in the professional world of industrial design, engineering, and construction. See just one example at http://youtu.be/zO0fPtgEdWk. By night (as a personal hobby I guess), he has established one of the worlds largest online industrial design software communities (www.davetyner.com/forum). The forum has enabled thousands of engineers around the globe to use social networking to communicate and collaborate and to solve problems of their everyday jobs. What Facebook has done for the average Joe, is what Dave is doing for the typically old, stale, and opaque world of heavy-industry engineering. He is truly bringing together and empowering the design and engineering community, enabling them to find and share better solutions, faster. Benjamin Wang, Autodesk

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    2

    Section1:ExportingandImportingPlant3DModels

    Part1ExportfromAutodeskPlant3D1. Open Autodesk Plant 3D (I am using the 2013 version)

    2. Change the project to SampleProject. Project.xml located here: C:\Program Files\Autodesk\AutoCAD Plant 3D 2013 - English\UserDataCache\SampleProjects\SampleProject

    3. Open the 1-PE-001 drawing located in the Area_1 folder and remove all of the external references

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    3

    4. If everything went OK, you should see this

    5. You may have to set your structural members to display as mesh objects. To do this, simply click on the Structure tab and change the Line Model to Shaped Model. You will need to do this in order to export the structural objects as meshes.

    6. Click anywhere in the drawing and type "EXPORTTOAUTOCAD" (without the quotes). Select Yes at the dialog asking you to save the drawing first.

    7. Select a folder outside of the project folder to save the new drawing. Name the file 1-PE-001_ex. Click Save.

    8. Export 1-ST-001 as well. Be sure to follow steps 3-7

    9. Close Autodesk Plant 3D

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    4

    Section 2: Import DWG to Autodesk 3DS Max Design

    Makingsuretheunitsareaccuratewillensureanaccuratephysicallightingsolution.

    1. Open Autodesk 3DS Max (I am using the 2013 version)

    2. To ensure your imported scene is scaled correctly, set your units to match the incoming file's unit scale.

    a. Select Customize > Units from the main toolbar

    b. Select System Unit Setup

    c. Set your System Unit Scale to Inches and check Respect System Units in Files

    d. Back in the Units Setup dialog box, set your Unit Scale to US Standard > Feet w/Fractional Inches > Inches

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    5

    Section 2: Import DWG to Autodesk 3DS Max Design

    ImportingtheDWG

    1. Select the "M" button at the upper left corner of the screen

    2. Select Import from the list. Shortcut: alt+f then press i

    3. Browse to 1-PE-001_ex.dwg. Select Open

    4. You will see the DWG Import Options dialog

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    6

    Import DWG to Autodesk 3DS Max Design

    ImportingtheDWG(cont.)

    5. I make sure the Auto-smooth adjacent faces is on. A smooth angle of 15 is usually sufficient. Feel free to change that value to suit your needs. You can smooth or unsmooth later if the object doesn't import quite right.

    6. Click OK

    7. Follow steps 1-6 when importing 1-ST-001_ex.dwg

    8. You should have a not too pretty scene that looks like this. There is much cleanup to do but lets write a little MAXScript to do the heavy lifting for us.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    7

    Section 3: Cleaning the drawing

    ImproveviewportperformancebydeletingthegarbagewithMAXScript

    1. DWG's import into 3DS Max with quite a bit of 'stuff' we don't want or need. There is a manual process for deleting all of it. However that takes up valuable project time, especially if you have to do it more than once. running this simple script will quickly take care of all of it.

    a. Click MAXScript > MAXScript Editor in the toolbar

    b. In the MAXScript Editor, paste the following code

    startobjects=objects.countforoinobjectsdo(o.controller=prs()ifclassofo.parent==LinkCompositethen( o.parent=undefined)else( o.parent=undefined))foroinobjectswhereclassofo==LinkCompositedodeleteoforoinobjectswhereclassofo==splineshapedodeleteoforoinobjectswhereclassofo==NURBSCurveshapedodeleteoformat"ObjectsDeleted:%\n"(startobjects(objects.count))

    .

    c. To run this code, press CTRL+E or select Tools > Evaluate All from the editor's toolbar.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    8

    Section 3: Cleaning the drawing (continued)

    ImproveviewportperformancebydeletingthegarbagewithMAXScript

    2. Do a quick render to make sure your scene looks like this

    3. Press 7 to check your viewport stats. We have improved the polycount by almost 50% You should notice a huge improvement in FPS (frames per second) performance.

    4. We are done with the import process. Now let's get a nice lighting solution in place. Onward.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    9

    Section 4: Let there be (day)light

    3DSMax2013shipswithanincrediblysimpleandstunninglyaccurateexteriorlightingengine.Placingthesunlightsystemissimplebut(likeanysystem)requiresmultipleoperationsbeforetheplacementiscomplete.Steps14outlinetheprocedure.

    1. From the main toolbar select Create > Systems > Daylight System

    2. You will see the following prompt recommending you change the exposure settings to accommodate the new light. Click Yes

    3. You will get another prompt asking if you want to create a mr Sky. We are using mental ray to render this project so select Yes. More about the Environment in the next section.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    10

    Section 4: Let there be (day)light (continued)

    Createanaccurateexteriorlightingsolutionusingthe3DSMaxDesignDaylightSystem

    4. Select where you want to place the Daylight System (you can move it around later if you wish) and Click. Move the mouse out and when the compass is the desired size, Click. Now, move your mouse again to put the sun at the desired distance from the model and Click. That's it! You now have a physically accurate lighting solution in place. When complete, you should have something that looks like this.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    11

    Section 4: Let there be (day)light (continued)

    Inthissectionwewillmodifytheviewportsettingssowecanseechangeswemaketothelightingsetupinrealtime.

    1. Select the Compass object and rotate it so that it is pointing North according to your model.

    2. Right click on the viewport style and select Realistic

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    12

    Section 4: Let there be (day)light (continued)

    Adjusttheviewportdisplaysettings.

    3. Right click again on the viewport style and select Lighting and Shadows > Illuminate with Scene Lights, Shadows, and Ambient Occlusion

    Section 5: Materials

    Creategoodlookingmaterialsinnotime!

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    13

    Section 6: Animate Using Constraints

    Whatareconstraintsandwhyaretheyuseful

    In 3DS Max, constraints are used to force an object to inherit the position/rotation/scale of another object or objects. A combination of constraints all working together is known as a "rig". Rigs can be moderately simple or extremely complex. Hopefully we will cover enough so that you can understand the practical concepts of constraints.

    In this section, we are going to look at a few different ways to rig a crane and then animate it to pick up and place an object. We want to create a rigging system that we will be able to use on more than one mesh so that we don't have to waste time duplicating work on our next project. In 3DS Max, there is more than one way accomplish this. We are going to be using linking, position constraints, orientation constraints, look at constraints, and link constraints to create a simple crane rig. Let's jump in!

    Parenting/LinkingWhen you parent (or link) one object to another, the child in the parent/child relationship will inherit the position/rotation/scale (PRS) of its parent but still retain the ability to transform on its local axis.

    BasicExample

    1. Create 3 Teapots and space them similar to how I show below. Change their color to green, orange, and red respectively.

    2. 2. Select the red teapot and click the Select and Link button from the toolbar (highlighted in yellow above)

    3. Drag the mouse over to the desired parent, the green teapot, and release. The dashed line is your visual map back to your child object.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    14

    Section 6: Animate Using Constraints (continued)

    4. Rotate/Move/Scale the green teapot (parent) and the red teapot (child) will rotate

    with it. Magic!

    So far so good. Now let's adjust the relationship a little bit. We want the child (red) object to inherit all the transforms of its parent minus the Y axis rotation.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    15

    Section 6: Animate Using Constraints (continued)1. Select the red teapot and click on the Hierarchy tab in the create panel. Click the

    Link Info button and look at the Inherit section. Deselect the Y checkbox in the Rotate group.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    16

    Section 6: Animate Using Constraints (continued)2. Rotate the parent object again. You will see the child does not inherit the Y axis rotation

    of the parent.

    Study Example

    Lets apply this simple concept to our Crane model. We will create a fast rig by parenting our objects together. Our goal is to rig the crane like real life and animate the cargo to align to the ground target helper. We will now link them up.

    1. Open "tower_crane_thewrongway.max". I have aligned Helper (Null) objects to the pivot points of the mesh objects. I then linked the mesh objects to each appropriate Helper. In addition, each Helper object has its text label linked to it.

    2. Link the following Helpers in the order specified below. The linking is in Child > Parent order.

    a. hlp_crane_head > ctrl_rotation

    b. hlp_crane_lift_or > hlp_crane_head

    c. hlp_crane_lift_or > hlp_crane_lift

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    17

    d. hlp_target_P > hlp_crane_lift

    e. hlp_target_obj > hlp_target_P

    f. hlp_crane_counterweight > ctrl_rotation

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    18

    Section 6: Animate Using Constraints (continued)3. Switch to the Top View by pressing the T key on the keyboard.

    4. Press the Auto key button and scrub the timeline to frame 50 to begin animating the horizontal part of the crane.

    5. Rotate the ctrl_rotation (yellow) control object so that the cranes arm is aligned to the ground target.

    6. Select the Select and Move button > Change your Reference Coordinate System to Local

    7. Select hlp_crane_head and move it along its X axis out so that it is directly above the ground target object. Adjust both objects until the cargo is exactly aligned to the target. Just kidding, don't do that. You will be there forever if you do.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    19

    The challenge here was that we are trying to place the cargo in a specific location at a specific rotation. Because we rigged the crane in the same order as it would operate in real life, we saved some time on rigging but will now spend 10 times that savings on animation. We want the crane to animate mechanically accurate but we want the cargo to control its position/rotation. We can achieve this with constraints. In the Section 6, we will look at each constraint using some basic models to get the idea of what each constraint does. In Section 7, we will apply these concepts to our crane model.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    20

    Section 6: Animate Using Constraints (continued)PositionConstraint

    Position Constraints differ from "Selecting and Linking". When you Position Constrain one object to another object, the child object is no longer free to move around on its local axis. It inherits 100% of the parents position transforms and you do not have the option to disable movement along a certain axis.

    Basic Example

    1. Open "teapot basic.max"

    2. Select the red teapot. From the Animation menu, select: Constraints > Position Constraints > Select the green teapot

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    21

    3. From the motion tab, you can see that the red teapot now has a Position Constraint applied to it and that its target is now the green teapot. Check the "Keep Initial Offset" checkbox to snap the red teapot back into place.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    22

    4. Try moving the green teapot around, you will see that the red teapot moves with it exactly. Next try moving the red teapot. You cannot change its local position.

    5. Rotate the green teapot. Notice that when its rotation is changed, the red teapot maintains its original rotation.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    23

    Section 6: Animate Using Constraints (continued)Orientation Constraint

    When you constrain one objects orientation to the orientation of another object, the child object is no longer free to rotate around on its local axis. The child objects rotation will mirror the rotation of the parent. The child is still able to change its position transform.

    Basic Example

    1. Open "teapot basic.max"

    2. Select the red teapot again. From the Animation menu, select: Constraints > Orientation Constraints > Select the green teapot

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    24

    Section 6: Animate Using Constraints (continued)3. When you rotate the green teapot, the red teapot will mirror its rotation.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    25

    Section 6: Animate Using Constraints (continued)Look at Constraint

    Look at Constraints do exactly as their name implies. They "look at" their specified targets. This means that as the target object moves around, the child object will rotate so that it always facing the parent.

    1. Open "teapot basic.max"

    2. Select the red teapot again. From the Animation menu, select: Constraints > Look At Constraint > Select the green teapot. The red teapot will orient itself on its local axis to face the targets pivot point.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    26

    3. Move the green teapot and observe how the red teapot always stays facing it. Notice that when you toggle the "Keep Initial Offset" checkbox, the red teapot now maintains its original orientation but still looks at the green teapot.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    27

    Section 6: Animate Using Constraints (continued)Link Constraint

    Basic Example

    1. Open "teapot basic.max"

    2. Select the red teapot. From the toolbar select: Animation > Constraints > Link Constraint > Select Plane001. The red teapot is now link constrained to Plane001

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    28

    3. Select the green teapot > Press N to toggle Auto-Key mode > scrub the time slider to frame 100 > Move the green teapot up a decent amount. Press N again to disable Auto Key mode. Now if you scrub the time slider, you will see the green teapots animation play out.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    29

    4. Select the red teapot > Scrub the time slider to frame 25 > Select Add Link from the Link Params drop down > Select the green teapot > Scrub the time slider to frame 75 > Select Link to World from the Link Params drop down. Your scene should look similar to this.

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    30

    Section 7: Rigging the Crane

    1. Open AU_2012_Master_MAX2013_no rig.max2. Select the tower_crane_all Selection Set > Right Click > Isolate selection3. Change your Selection Filter to Helpers > Drag a window around all Helpers except both

    root helpers4. Click Select and Link > Link selection to the crane root Helper.5. Select hlp_hook_link > Link it to CRANE_CONTROL6. Select hlp_crane_lift > Link to CRANE_CONTROL7. Select all of the hlp_spreader_rope02_top* helpers > Link to spreader8. Select all of the hlp_spreader_rope02_bot* helpers > Link to hlp_hook_link 9. Select hlp_crane_motor > Link to hlp_crane_lift10. Select hlp_crane_counterweight > Link to hlp_horiz_crane_rotation11. Select hlp_crane_motor > Animation > Constraints > Look at Constraint >

    hlp_crane_horiz_root12. Select rot_ctrl_001 > Animation > Constraints > Look at Constraint > hlp_crane_motor 13. Select hlp_crane_lift_or > Animation > Constraints > Position Constraint >

    hlp_crane_lift14. Select hlp_crane_lift_or > Animation > Constraints > Orientation Constraint >

    rot_ctrl_00115. AnimateCONTROLOBJECT16. FixcranemotorZ17. LinkConstraint

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    31

    LinkedXForm

    Basic Example

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    32

    Now when you move the Helper, the vertex will move with it

    Perform the same steps for the bottom vertex

  • Visualizing AutoCAD Plant 3D models Using Autodesk 3ds Max

    33