Change textures in a 3dscene

Hi,
I have a 3dscene with a material called body.
I have uploaded in the scene properties at the 3d resource panel, 3 textures.
texture1.jpg   texture2.jpg   texture3.jpg
They look as embedded at the resource panel window.
Now I want to create 3 buttons so the textures of the  material body can be changed.
I have tried this code  for the first button but it is not working:
C3D = getAnnots3D(0)[0].context3D;
material = C3D.scene.materials.getByName("body");
material.diffuseTexture.image = new Image( new Resource( "pdf://texture1.jpg" ) );
Any help please,
thanks in advance

Because of the way the 3D AAPI works, the Resource constructor has to be called in the context of the 3D API (i.e. the operator "new" has to be run in that context). If you try to construct the Resource in the document API it will return as if it exists, but the contents will be invalid.
Simplest thing is to attach a JS file to the 3D annotation with a function defined, and call that function from your buttons:
In the 3D script:
function changeMat( texName, matName ) {
  var _matl = scene.materials.getByName ( matName );
  _matl.diffuseTexture.image = new Image( new Resource( "pdf://" + texName ) );
then your page-level button can call something like:
getAnnots3D( pageNum )[0].context3D.changeMat( "texture1.jpg", "body" );

Similar Messages

  • How can I have users change textures in acrobat 3d and Reader question tia sal2

    I'm trying to have users in Acrobat reader change textures of a box which I made in acrobat 3d
    how can I do this?
    Example
    I made three textures for a box and I would like the user to have the ability to change the textures if they choose. How can I do this? Any examples?
    Can I have a user select the textures or the layers from a photoshop file in Acrobat 3d?
    Tia sal2

    Yo ratboy,
    You can do this. In order to map the images, they must be attached as a 3D resource. (There is a free plugin for this; search the forum for "Attach3DResource.api"). Once the images are attached, you can use the 3D Javascript API to map them to the meshes you desire.
    For one doc, I attached 25 images in this manner. I then used the script below to create a bunch of empty meshes, and then apply the images to said meshes.
    Hope this helps!
    //3D javascript ========================================
    //create 25 procedural meshes ======
    var leftEdge = -180;
    var horizontalOffset = leftEdge;
    var verticalOffset = 0;
    var myMesh = new Array();
    var myVector = new Array();
    for ( i=0; i<25; i++ ) { myMesh[i] = scene.createSquareMesh(64, 48, "myMesh" + i); myVector[i] = new Vector3( horizontalOffset, verticalOffset, 0 ); myMesh[i].transform.translateInPlace(myVector[i]); horizontalOffset += 74; if ( horizontalOffset > 180 )
    horizontalOffset = leftEdge;
    verticalOffset += 58;
    //create image array and resource objs ============
    var myImageResources = new Array();
    var myImageFiles = new Array("8d91.jpg",
    "ad2e.jpg",
    "barnpond.jpg",
    "Beach01.jpg",
    "Beach04.jpg",
    "Beach05.jpg",
    "Beach06.jpg",
    "Beach13.jpg",
    "bike trailer.jpg",
    "cobra.jpg",
    "cr80xr200.jpg",
    "craigs_place.jpg",
    "Dandrea.jpg",
    "dirtbike.jpg",
    "e027.jpg",
    "f5b5.jpg",
    "f613.jpg",
    "halfdome.jpg",
    "Iceberg.jpg",
    "island.jpg",
    "kx100_gb.jpg",
    "maui_horanhero.jpg",
    "norcal_ocean.jpg",
    "sierraLake.jpg",
    "Smokey Light.jpg",
    "test.txt");
    //create resource objs
    for ( i=0; i<25; i++ ) { myImageResources[i] = new Resource("pdf://" + myImageFiles[i]); }
    //load images on meshes with handler ============
    var myImageObjs = new Array();
    var myImageMats = new Array();
    myRenderer = new RenderEventHandler();
    myRenderer.onEvent = function(renderEvent)
    for ( i=0; i<25; i++ ) { //create image from resource myImageObjs[i] = new Image(myImageResources[i]); console.println("Image = " + i);
    //add image to model
    myImageMats[i] = myMesh[i].material;
    myImageMats[i].diffuseTexture.setImage(myImageObjs[i]);
    //remove handler
    runtime.removeEventHandler(myRenderer);
    runtime.addEventHandler(myRenderer);
    //cause a recalculation of the scenegraph.
    scene.update();
    console.println("Call scene.update()");
    console.println("Created 25 Square meshes: (64, 48, 'myMeshN')");

  • How to change texture backgrounds in Keynote text box

    I want to know if its possible to change the texture background image of a text box, keeping the background textured but in a different color.
    Sequence:
    Create a text box
    Add text
    In the inspector select "image fill"
    The result is a textured background in a particular color.
    Thinking I might be able to replace the image with another textured image but of a different color I click on "Choose" and a dialog opens that is located at the "pictures" folder in the home folder.
    This makes sense but I wonder if there is a group of textured images somewhere to use as backgrounds?
    And if so where are they located?
    I've searched around and can't find same.
    Perhaps the textured background is unique to the theme.
    Thanks

    Most of the textures are unique to the theme BUT try this:
    1. Put a chart on your slide
    2. Click on the Chart Colors button in the Chart Inspector
    3. See if any of the chart options match what you're looking for and hit Apply All in the chart colors window
    4. Click once on one of the bars in the chart to select it
    5. Choose Copy Style from the format menu
    6. Click on your text box and choose Paste Style from the format menu
    7. Go to the Graphic Inspector and change the fill type from Image Fill to Tinted Image fill
    8. Play around with the color/transparency settings for the Tinted image function by clicking on the box that looks like it's sliced in half diagonally.
    no idea if that's what you're looking for, but you can come up with some fun fills I think.

  • How to change Textures in Diagramms?

    cant believe it. i tried to change my diagramm texture into realistic wood-grain, but cant find out how to do it?!

    As far as I know, there is no way to specify a "texture" for a chart element in Keynote 3 (this seems like a bizarre oversight to me). That doesn't mean you can't do what you want, just that you can't replace the "texture". Instead, what you will need to do is click on the element of the chart you want to change, and in the Inspector, under the Graphic palette, go the Fill dropdown menu and select "Image Fill". Use this to fill the object with whatever pattern you like, and either Tile or Stretch it as appropriate.
    If you want to use the wood-grain images that Steve Jobs showed off in his presentation, they are in the Black theme that comes with Keynote. To get to these images requires a bit of a trick.
    The Keynote application is actually a "package" of multiple files all wrapped up to look like a single file, and some of those files are the default themes. What you need to do to get to those files is to hold down the Control key and click on the Keynote application -- this will bring up the contextual menu. Choose "Show Package Contents". This should open up a new window that shows you the internal structure of the Keynote package. You need to navigate through this contents to get to where the Themes are stored -- open the Contents folder, then the Resources folder, and in that you should find the Themes folder. In the Themes folder are all the default themes that come with Keynote 3.
    The wood-grain images come with the Black theme. Now, themes are also packages and not single files, so you again need to hold down the Control key and click on one of the Black themes. This will open a new window that will show a number of files, and included there will be various files whose names start with "wood_finegrain". These are the files you want. (Note that the higher resolution themes have higher resolution versions of these images.) You can copy these images to another place on your computer where you can easily access them, and use the Image Fill as outlined above to change chart objects. Be sure that you copy the images from the theme package, and don't just move them, as that will remove them from the theme, and the theme won't work properly.
    PowerMac G5   Mac OS X (10.4.4)  

  • Buttons change texture on object  - got a script now what ?

    I'm newbie on Javascript and I'm trying to figure out this script that was posted by Michael Kreutz on this forum ;
    ---- This is the script that is used on the 3D object -----
    //##### changeDiffuseTexture #####
    function changeDiffuseTexture() {
    textureRes = new Resource("pdf://yourTexture.jpg");
    textureImg = new Image(textureRes);
    //#### if you want to call the mesh by index #####
    objectMaterial = scene.meshes.getByIndex(0).material;
    //##### if you want to call the mesh by name instead of index #####
    //objectMaterial = scene.meshes.getByName("theMeshsName").material;
    objectMaterial.diffuseTexture.setImage(textureImg);
    ---- This is the script that is used on the button ----
    getAnnots3D(0)[0].context3D.changeDiffuseTexture();
    I'm making a proof of concept to show this (future) client the possibilities of 3D pdf.
    I show a 3D object and besides the 3D object are several buttons that change the texture of the 3D object.
    This 3D object has 2 materials ; one is just diffuse color and the other one has a UVmap on the diffuse map.
    So when one clicks on a button the script should load up the correct UVdiffusemap-image.
    I use this plugin to attach the resource images for the UVmap
    http://www.graysonlang.com/Attach3DResource.api
    Now for the question part :)
    ** When I apply the "getbyindex" version and click a button it replaces the diffusecolor part of the object with the image, instead of the UVmap part - how can I tell javascript to look for my UVmap .. in other words where can I see what the index of this material is -> I've tried changing the numbers in both scripts but that didn't do it !
    The "getbyname" didn't do anything -> where can I see the name of the UVmap part ?
    ** How can I apply the different images to the different buttons ? Or should I do this in the .js-file that is attached to the 3D object ?
    ** Is there a way to make the change of texture realtime - without first having to click on the 3D-window ? That is what happens now when the texture of the diffusecolor part changes !
    Any hint is welcome -
    K.

    I'm newbie on Javascript and I'm trying to figure out this script that was posted by Michael Kreutz on this forum ;
    ---- This is the script that is used on the 3D object -----
    //##### changeDiffuseTexture #####
    function changeDiffuseTexture() {
    textureRes = new Resource("pdf://yourTexture.jpg");
    textureImg = new Image(textureRes);
    //#### if you want to call the mesh by index #####
    objectMaterial = scene.meshes.getByIndex(0).material;
    //##### if you want to call the mesh by name instead of index #####
    //objectMaterial = scene.meshes.getByName("theMeshsName").material;
    objectMaterial.diffuseTexture.setImage(textureImg);
    ---- This is the script that is used on the button ----
    getAnnots3D(0)[0].context3D.changeDiffuseTexture();
    I'm making a proof of concept to show this (future) client the possibilities of 3D pdf.
    I show a 3D object and besides the 3D object are several buttons that change the texture of the 3D object.
    This 3D object has 2 materials ; one is just diffuse color and the other one has a UVmap on the diffuse map.
    So when one clicks on a button the script should load up the correct UVdiffusemap-image.
    I use this plugin to attach the resource images for the UVmap
    http://www.graysonlang.com/Attach3DResource.api
    Now for the question part :)
    ** When I apply the "getbyindex" version and click a button it replaces the diffusecolor part of the object with the image, instead of the UVmap part - how can I tell javascript to look for my UVmap .. in other words where can I see what the index of this material is -> I've tried changing the numbers in both scripts but that didn't do it !
    The "getbyname" didn't do anything -> where can I see the name of the UVmap part ?
    ** How can I apply the different images to the different buttons ? Or should I do this in the .js-file that is attached to the 3D object ?
    ** Is there a way to make the change of texture realtime - without first having to click on the 3D-window ? That is what happens now when the texture of the diffusecolor part changes !
    Any hint is welcome -
    K.

  • Dynamic 3d textures

    hey there w3d maniacs,
    My first problem is that... I am having trouble converting a
    director file with .w3d files and have them display on an html
    document correctly. When it gets to part where the frame loops on
    the w3d file, it gives me an error.
    Q: Does that mean that I don't have the proper plugin to
    display the shockwave file, or that i did not include the correct
    plugin along with the conversion?
    My second question was concerning 3d manipulation in
    director.
    Q: Is it possible to change textures on a w3d file? (A good
    tutorial or helpful advice can help.)
    Thanks a bundle,
    Mong Vang

    To change the image of an existing texture:
    myTexture.image = <image object>
    or
    myTexture.member = <member with an image property>
    To swap one existing texture for another in an existing
    shader:
    myShader.texture = myTexture
    or
    myShader.textureList[<index>] = myTexture
    You can find a movie for testing texture and shader
    properties at
    http://nonlinear.openspark.com/tips/3D/shaders/.
    You can find a very simple movie for swapping textures at
    http://nonlinear.openspark.com/tips/3D/texture/

  • CS4 Illustrator file size

    I'm trying to create a beading pattern on Illustrator but in creating a "sequin" brush with a rasterised jpeg graphic, I have created what appears to be a "monster-sized" file which cannot now be edited, even to change the view. I have tried saving the file without pdf, compression on and even saved as CS3 format but still cannot now edit it at all. I think I have a CS5 suite to upgrade but don't want to lose my previous files or bother to upgrade if the problem of file size will still be there after the upgrade. Any clues? Thanks

    Mac running OSX
    Background image "placed" into new document
    Brush created with an image file of a sequin to make texture layers in order to create a beading pattern.
    Don't know how to answer your last comment, only in terms of what I want it to do, which is to create an editable file that the layers can be changed, textures altered or added to the basic image background.
    Shane Davis
    [email protected]

  • After Effects CS6 going nuts!

    I have After Effects CS6, no updates or add ons. It has worked fine all along, but then today it went nuts. The problems: I was making a deep space scene, placing tow planets in the scene and moving them about. Usually I make a planet by importing a texture, then using CC Sphere to make it round, as most people do. Well, this worked fine. Then I usually use scale and size with key frames to move it about. Today however, I couldn't get the 'planet' to move, and when I tried to play it back, it gave me about 1 second of very quickly changing textures (wow, didn't understand that) and the 'planet' dissappeared. When I move the cursor back to the start, it reappears. Then I noticed that the actual 'track' on the timeline is tiny, no where near as long as the composition settings.
    As this has worked well for a while, I have not added computer info, which I have not changed since installing AF.
    I figured it was a fluke, as I've done this before, but now I can't get it to work at all. So what to do? I can't find anything in the Preferences that look wrong. Should I try reinstalling?? Any advice?  Thanks!!

    Yea, guess you are right. Just doesn't seem to be system related. It's a PC, Asus P5N7A motherboard with an Intel Core2 Quad, with 3 gigs of memory (yea, I know I need more memory), Windows 7 build 7601. It will slow down now and then, but has always worked well with Adobe stuff.  All my textures are simple .jpg files (which all worked in the past).
    Indeed, I have just now discovered that AE no longer works right with any still image!  Here's a shot of my screen when it stops working correctly. [I get the feeling there is something I'm forgetting to do].
    You may also notice that the timeline appears to be marked in....frames?? I don't remember that either!

  • SaveEPSOptions CS3/CS4/CS5 file size

    I have a script which saves multiple files as EPS format, and everything works well under CS3 and CS5, but when run in CS4, the file size is about 3X the size of the other versions. (1.3M in CS4; 300-400k in CS3/CS5). Is this a known issue in CS4, or is there some way I can work around this (other than checking the application version and disallowing saving in CS4)? Below are the saveEPSOptions I am using:
    var saveEPSOptions = new EPSSaveOptions
    saveEPSOptions.cmykPostScript = true
    saveEPSOptions.compatibility = Compatibility.ILLUSTRATOR12
    saveEPSOptions.embedAllFonts = true
    saveEPSOptions.includeDocumentThumbnails = true
    saveEPSOptions.preview = EPSPreview.TRANSPARENTCOLORTIFF
    saveEPSOptions.saveMultipleArtboards = false // Added for CS4/CS5

    Mac running OSX
    Background image "placed" into new document
    Brush created with an image file of a sequin to make texture layers in order to create a beading pattern.
    Don't know how to answer your last comment, only in terms of what I want it to do, which is to create an editable file that the layers can be changed, textures altered or added to the basic image background.
    Shane Davis
    [email protected]

  • Title Bar Graphics Disappear

    Sometimes at random, elements of the title bar (the portion of the application window where the title is along with the minimize, maximize buttons are) will disappear. You are unable to view them until you roll over them and even the background turns white... like the graphics are getting corrupt. I see it a lot with the System Preferences panel.

    i've got a similar issue i think, what happens is for some reason, at some point, the dock changes 'texture' and becomes transparent, as in the white surface of it turns black reflecting the icons on it more brightly and the icon title becomes corrupt, worse still, my stacks show only the contour of the files and the titles are unreadable, although noting else seems to be affected, this is annoying.

  • Gfx object properties: picture and structure

    For some objects, e.g. in 3D-pie-diagrams attributes like color, picture, colored picture and a "structure" can be applied (don't now the correct english description as I use a localized version).
    How can I change the "structure" (e.g. wood, marble...)? I did not find any possibility to change them so far, except applying another theme - which changes all of them. Is there any possibility to change it directly on the object? Or do I need to setup my own theme? How can I do this - the manual was not helpful there.
    Where are keynotes standard pictures and structures stored, so I can select them?
    Thank you,
    Frank

    Frank, how to change textures in chart objects is discussed in this thread. (The only bit I would add to these instructions is the tip that, in addition to using the "Choose..." button to navigate to the desired texture, you can also just drag an image file onto the little square image "well", and that will set the texture too.)

  • 3d model for .dds files from sims 4 help/ponder/confused

    Hello all, im just starting out with creating clothes etc for sims 4 and im wondering just what is possible within PS cc. I am able to change textures, layers channels etc of the .dds files but as it stands they are done on a flat surface, my friend has informed me of the amazing possibilities of ps when it comes to 3d modelling. Now what im wondering is can i use the skin mesh that i have managed to get hold of for sims 4 within photo shop as what can best be described as a tailors dummy to place the clothes upon within PS. If it is where do i place the mesh files within the ps folders and how do i get ps to see that the .dds file is tobe placed upon the dummy.
    Now if considering the above is doable am i then able to alter the mesh of the clothes items but not effect the dummy as i want the dummy tobe none intractable and unchangeable and only the .dds file i am working on tobe altered. Im also wondering if this is infact possible if it is possible to create items from scratch also from within ps using the technique.
      Thanks in advance.

    There are two ways to create clothing one is to create a mesh and animate it like Brett mentioned, the other is to use the same mesh and apply a UV Mapped texture to that mesh like poser allows. The difference is one requires a body that has no protruding parts (I'll leave it like that) as they would show through, the other can have a mesh that is away from the body and have thickness to it which can handle protruding parts.
    That said creating UV mapped textures in photoshop is fairly strait forward. Where as meshes can be created in photoshop, but it is very rudimentary in how it creates the meshes. It lacks the fine details of point modeling which can help in pushing and pulling of the polygons to make sure it lays correctly. Photoshop as Brett mentioned lack the more advanced animation techniques needed to force the mesh to animate with the underlying mesh.
    What I recommend is that you look at the free app called blender you can find it through google. It can do what you need, even if it is a bit weird for a user interface. For paid programs, I recommend looking at poser (Daz has a free version {called Daz studio} that is similar to poser but lacks a few features) Poser can animate a mesh give it bones, etc. But lack modeling features that are required that blender can handle.
    Newtek's Lightwave or Luxology (now called the foundry I guess) has modo which is very similar to lightwave but is more modeling heavy than animation heavy, whereas lightwave is the opposite. Both companies were one at one time, I don't know about the split, but that's how modo came to be. Either of these two companies can and will exceed anything you need. Both are extremely fast compared to blender, poser, daz studio or photohshop when it comes to modeling, animating, rendering and some texturing. The textures in these apps have two flavors procedural (math based) and image based. Kind of like comparing photoshop to illustrator, that can do similar things, but each has their strengths and weaknesses.
    Something else to look at is UV mapper. It now costs it use to be free years ago. it will take a UV map and help arrange the map so that it is easier to create a uv texture in an image editor like photoshop.
    I decided to add a few links. Hope this helps a bit.
    The Foundry Community :: About The Foundry
    LightWave - Production Proven
    DAZ 3D | Free 3D software and content
    blender.org - Home of the Blender project - Free and Open 3D Creation Software
    UVMapper - UV Mapping Software

  • Play GuildWars2 on Mac?!

    I know I can install Parallels or VMFusion with Windows but anyone else have any suggestions on how I can play Guild Wars 2 on my MAC?  I don't want to have to buy Windows again

    Similar results to those listed above -
    Using PlayOnMac
    I was getting an average of about 14-18fps over PlayOnMac (using the latest wine 1.5.11gw2 wrapper) with most settings on High (and a few like LOD, Textures and PostProcessing on Medium) both 1440 & 1650 (fullscreen x11) settings on a 2.6 Retina. Although framerates seem low, it is certainly playable even in decent sized mob battles. Lowering res or settigns to Low didn't do much for fps increase either, still around 15-19fps. Either way, this approach is free and shouldn't stop you from enjoying a great game if you can't run via bootcamp for whatever reason. Make sure to get the latest 1.5.11gw2 wine version from PlayOnMac as it fixed some of the issues (tearing, slowdowns and color-changing textures) from the default 1.5.9raw3 version created by the installer script.
    Using Bootcamp/Win8
    Tried switching to bootcamp/win8 and right away the game runs noticably better now (or, as it should! ) -  at 1920, all settings on high, have not checked actual fps yet, but no slowdown and moves real smooth. May try some settings on ultra later, but don't see this necessary, as it looks pretty great. I am having occassional mouse tracking/clicking issues though using the BT Magic Mouse and trackpad - haven't tried a wired usb mouse yet. Hope this helps. will check back in.

  • I would like to change the colour of bars in a chart without losing the underlying default texture associated with my chosen theme. None of the 3D textured fills offered in "Chart Colors" match the textured fill of the theme. Any suggestions?

    I would like to change the colour of bars in a chart without losing the underlying default texture associated with my chosen theme. None of the 3D textured fills offered in "Chart Colors" match the textured fill of the theme. Any suggestions?

    Thanks Gary, but no, that does not work. First of all, I can't select each bar individually. When I click on one bar, all three bars are selected.
    When I use "inspector > graphic" I have 5 fill options: none, color, gradient, image, tinted image. The default selection for the theme I'm using is image. What I would like to use for my charts is the same image that this theme uses for table headers. It has the same texture as the chart, but a different colour. Using anything but image or tinted image removes the texture from the fill.
    I have found I can do one of two things. I can select tinted image from the fill selections in "inspector > graphic" or I can select 2D Image Fills from "inspector > chart > chart colors". The first choice does not allow me to match the table header colour because it only allows me to apply a tint to the existing colour and adjust its opacity. The existing colour has too much influence on the fill, so I can't find an RGB adjustment that will match the table header colour. The image selections from "inspector > chart > chart colors" do not quite match the colour or the texture. Again, I can try to tint the image, but I still can't get it to match and the texture is not the same anyway.
    The image I want to use obviously exists in the software as it is an attribute of the theme, but for some reason is inaccessible. The other angle I have tried is to edit the theme, but I can't figure out how to do that either.

  • How can I change a color of an image without affecting the texture, but based on a pantone pick?

    Here is an image of a paintbrush stroke that shows the texture of the paint.  I want to change the color to a specific pantone green in order to match a specific color pallet.  Rather than just using hue saturation to "guess" at the color (no pantone number), is there a way I can actually set a base color without losing the texture?

    You can only use the picker values as a guide on an image with many tones.
    I presume you are going to print as cmyk, so find the mix of the target colour and make a 'solid colour' adjustment layer and choose that mix. Then set the adj layer properties to 'hue' which should do it.
    Otherwise, add a 'hue/saturation' layer (and click on colorize in the adj layer palette) and move the slider to suit.
    If you convert to greyscale, you could colorize the pic with the spot colour too.

Maybe you are looking for

  • Photos won't show in movie....

    Hello, Hope somebody can help.... I am creating a new movie. As part of it I want to use some photos/jpegs at certain places. I have inserted them into the project browser no problem, and they show there as expected. I can edit them etc with Inspecto

  • Can't download mobile DVR app for BlackBerry Storm

    Seems like the Verizon download link (m.verizon.com/tv/download) to the mobile DVR app is broken???  Get the terms page, but after hitting "agree" the file transfer fails.  Have tried several times for a day or so... no joy.

  • Installation of Datasource from Business content

    Hi Friends, While Installing Datasource from Business content in SAP R/3 encounter with following error message. Can some one guide me how to transfer the hierarchy with Business Content. Appreciate your help in resolving this problem. Application co

  • Unable to restore backup

    Why does simple thing like backup and restore doesn't work correctly using OVI Suite v2.1.1.1 on 5800XM v50.0.005? for detail please view: /t5/Nseries-Devices-and-S60/5800XM-Restore-Question/m-p/673160 Does your company want your customers manually e

  • Control cycle for KANBAN.

    I want to cosume componenets using my KANBAN BINS. I maintained my supplying areas.  and when coming to the control cycle. Do I have to maintain control cycle for each component that I use in maufacturing against each supply area?  or is it only for