Hiding/unhiding parts of model

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default Hiding/unhiding parts of model

    I am trying to hide & unhide part of a model, for example one side of a box, by
    setting model[aModel].resource.front to FALSE to hide it, and back to TRUE to
    unhide it. This works, except that it loses it shader when I set it to FALSE.

    Is there another way to temporarily hide parts of a model, without losing
    shader properties? Setting blend to 0 doesn't work, because then it hides ALL
    sides of the box (I guess because all sides use the same shader).

    Wriker Guest

  2. Similar Questions and Discussions

    1. New release of Config::Model with fstab model example
      Hello I'm happy to announce the new release of the Config::Model perl module (v0.506) . This release features a Fstab example with its fstab...
    2. model showing in 3d editor but not in castmember model list
      Hi all, Ok this is a little odd... I have 3d cast member from which I'm clonefromcastmember-ing a model. One of this model's children is...
    3. Hiding parts that go over the document edges?
      Hi, I try to use Macromedia Freehand 10 with PC and I have following kind of problem: How do I remove/hide parts that go over the document...
    4. Model within model transform.position, intersection, overlapping models
      Ok, I have a large sphere, and within that sphere a sun with rays. The sun object is the parent object while each individual ray is a child object. ...
    5. Forms - unhiding database view and toolbars
      I wanted to be able to hide the database view when a database is opened. I managed to achieve this using Tools- lost the tools menu.
  3. #2

    Default Re: Hiding/unhiding parts of model

    How hard is it to create an object which...

    * uses a property to remember which shader was used on that mesh
    * hides the mesh
    Then
    * restores the mesh
    * restores the shader

    ....?
    openspark Guest

  4. #3

    Default Re: Hiding/unhiding parts of model

    Harder than you'd think. It restored not even half the shaders, for some reason.

    --hide
    pRememberShaders.addProp(aModel, gWorld.model[aModel].shaderList)

    --unhide
    gWorld.model[aModel].shaderList = pRememberShaders.getProp(aModel)

    If I output pRememberShaders to the message window, it does appear complete.

    Wriker Guest

  5. #4

    Default Re: Hiding/unhiding parts of model

    <blockquote>quote:<br><hr><i>Originally posted by: <b><b>Wriker</b></b></i>
    Harder than you'd think. It restored not even half the shaders, for some
    reason.

    --hide
    pRememberShaders.addProp(aModel, gWorld.model[aModel].shaderList)

    --unhide
    gWorld.model[aModel].shaderList = pRememberShaders.getProp(aModel)

    If I output pRememberShaders to the message window, it does appear
    complete.<hr></blockquote>


    You stored a reference to the list.
    The variable points only to the list "shaderlist". If the list entries change
    the changes will be reflected in the variable too.

    You'll need the duplicate command to store the CURRENT state of the list:
    pRememberShaders.addProp(aModel, duplicate(gWorld.model[aModel].shaderList))

    this should work. nonetheless you must be careful. as the list contains
    pointers to the different shaders. if you delete one of these shaders, the list
    item will be void afterwards. So you can't rely on all being valid shader
    objects throughout the movie.

    If it was me, defensive programmer, I'd store the NAME of the shader I am
    interested in as a string and when I try to reste it later, I first check if a
    shader with the given NAME still exists in the 3-D member object.

    That's a matter of code design. There are different approaches.

    HTH


    a?ex Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139