>>>>>tTexture=newBox.newtexture("brick",#fromCastmember,member("brick 4")) I thought I just created an object? tTexture.quality=#high --apply the texture to a shader tShader=newBox.newShader("boxShader",#standard) tShader.textureMode=#wrapPlanar --assign shader to box model tModel=newBox.model[1] tModel.shader=tShader end Any help is really appreciated, I'm stuck! .. The preceding example was from FED book D8.5Studio, modified a little bit off course, so i can learm. -- markinoregon Website under construction as always! [url]www.markthesteelhead.com[/url] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => markinoregon [ip] => mark.r.stevens@ [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> Texture error on model? - Macromedia Director 3D

Texture error on model? - Macromedia Director 3D

hey folks! I'm getting the usual NOOB error object expected. I'm creating a simple box and applying a texture to it: The specific line i get the error at is outlined below in my code: global newBox on prepareMovie member("newBox").resetWorld() mr1 = member("newBox").newModelResource("myBox", #box, #front) mr1.length = 50 mr1.width = 75 mr1.height = 100 md1 = member("newbox").newModel("myBoxModel") md1.resource = member("newBox").modelResource("myBox") getRendererServices().textureRenderFormat = #rgba5551 --create texture object,assign it to brick4 member Here's my error line..... ------>>>>>>tTexture=newBox.newtexture("brick",#fromCast member,member("brick 4")) I thought I just created an object? tTexture.quality=#high --apply the texture to a shader tShader=newBox.newShader("boxShader",#standard) tShader.textureMode=#wrapPlanar --assign shader to box model tModel=newBox.model[1] tModel.shader=tShader ...

  1. #1

    Default Texture error on model?

    hey folks!
    I'm getting the usual NOOB error object expected.
    I'm creating a simple box and applying a texture to it:
    The specific line i get the error at is outlined below in my code:
    global newBox

    on prepareMovie

    member("newBox").resetWorld()

    mr1 = member("newBox").newModelResource("myBox", #box, #front)

    mr1.length = 50

    mr1.width = 75

    mr1.height = 100

    md1 = member("newbox").newModel("myBoxModel")

    md1.resource = member("newBox").modelResource("myBox")

    getRendererServices().textureRenderFormat = #rgba5551

    --create texture object,assign it to brick4 member

    Here's my error line.....

    ------>>>>>>tTexture=newBox.newtexture("brick",#fromCast member,member("brick
    4"))

    I thought I just created an object?

    tTexture.quality=#high

    --apply the texture to a shader

    tShader=newBox.newShader("boxShader",#standard)


    tShader.textureMode=#wrapPlanar

    --assign shader to box model

    tModel=newBox.model[1]

    tModel.shader=tShader


    end

    Any help is really appreciated, I'm stuck!
    ..
    The preceding example was from FED book D8.5Studio, modified a little bit
    off course, so i can learm.

    --
    markinoregon

    Website under construction as always!
    [url]www.markthesteelhead.com[/url]


    markinoregon Guest

  2. #2

    Default Re: Texture error on model?

    >>tTexture=newBox.newtexture("brick",#fromCastmemb er,member("brick4"))

    You need to change newBox to member("newBox")

    You'll have the same problem below too - or set a reference to newBox like:
    newBox = member("newBox")

    Also these two lines:

    md1 = member("newbox").newModel("myBoxModel")

    md1.resource = member("newBox").modelResource("myBox")


    can be put into one: md1 = member("newBox").newModel("myBoxModel", mr1)




    --


    Dave
    [url]http://www.blurredistinction.com/director[/url]


    Dave Mennenoh Guest

  3. #3

    Default Re: Texture error on model?

    Thanks for the reply Dave!

    I did as you suggested and don't get any more script errors,
    but,, my simple box still shows the default texture/shading for the box
    when I run my movie,,,,,

    GRRRRR!!!!
    I'm frustrated!! going back to square one i guess....

    --
    markinoregon

    Website under construction as always!
    [url]www.markthesteelhead.com[/url]
    "Dave Mennenoh" <dmennenohwi.rr.com> wrote in message
    news:bore6s$cpe$1forums.macromedia.com...
    > >>tTexture=newBox.newtexture("brick",#fromCastmemb er,member("brick4"))
    >
    > You need to change newBox to member("newBox")
    >
    > You'll have the same problem below too - or set a reference to newBox
    like:
    > newBox = member("newBox")
    >
    > Also these two lines:
    >
    > md1 = member("newbox").newModel("myBoxModel")
    >
    > md1.resource = member("newBox").modelResource("myBox")
    >
    >
    > can be put into one: md1 = member("newBox").newModel("myBoxModel", mr1)
    >
    >
    >
    >
    > --
    >
    >
    > Dave
    > [url]http://www.blurredistinction.com/director[/url]
    >
    >

    markinoregon Guest

  4. #4

    Default Re: Texture error on model?

    I don't see where in your code that your actually assigning the texture to
    the shader. You might try this...

    On your last line you have:

    tModel.shader=tShader

    After this add:

    tModel.shader.texture = tTexture

    Also - you already had a model reference in md1 there's no reason to get it
    again with tModel...

    --


    Dave
    [url]http://www.blurredistinction.com/director[/url]


    Dave Mennenoh Guest

  5. #5

    Default Re: Texture error on model?

    Thanks for the help David!

    kinda weird, i was able to change the texture/shader in the PI for the
    member,
    and it works as expected.
    Is that common practice once you have a texture/shader defined, to assign
    them to your objects in the PI?
    also, if that's true, you could define a bunch of textures/shaders in lingo,
    then assign them to different 3D objects
    in your movie through the PI?

    hmmmmm......

    --
    markinoregon

    Website under construction as always!
    [url]www.markthesteelhead.com[/url]
    "Dave Mennenoh" <dmennenohwi.rr.com> wrote in message
    news:both0i$4km$1forums.macromedia.com...
    > I don't see where in your code that your actually assigning the texture to
    > the shader. You might try this...
    >
    > On your last line you have:
    >
    > tModel.shader=tShader
    >
    > After this add:
    >
    > tModel.shader.texture = tTexture
    >
    > Also - you already had a model reference in md1 there's no reason to get
    it
    > again with tModel...
    >
    > --
    >
    >
    > Dave
    > [url]http://www.blurredistinction.com/director[/url]
    >
    >

    markinoregon Guest

  6. #6

    Default Re: Texture error on model?

    Dunno - I've never used the Property Inspector to assign a shader or texture
    to a model. Now the 3DPI is another story..

    --


    Dave
    [url]http://www.blurredistinction.com/director[/url]


    Dave Mennenoh Guest

Similar Threads

  1. Scaling a model not it's texture?
    By George Webb in forum Macromedia Director 3D
    Replies: 3
    Last Post: August 23rd, 08:25 AM
  2. Changing the texture on part of a 3D model
    By Portablefolio in forum Macromedia Director 3D
    Replies: 1
    Last Post: September 20th, 09:12 AM
  3. How to change texture on a 3d cad model
    By vitopod webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 1
    Last Post: November 25th, 12:31 PM
  4. Quick Time movie (MOV) or AVI as a texture on 3d model
    By chouhdry webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 1
    Last Post: September 18th, 11:01 AM
  5. texture and model
    By visu webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 0
    Last Post: September 3rd, 01:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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