We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Menu options ony work first time

Home Forums Puzzles Menu options ony work first time

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #66196
    vision
    Customer

    My menu consists of 3 textures replacements on the object.
    Which texture is the current one (and should be replaced) is kept in a variable “current_texture”.

    But my logic only works the first time when a texture is replaced, after that all options don’t work no more.

    Any ideas?

    Attachments:
    You must be logged in to view attached files.
    #66204
    xeon
    Customer

    OK so you can actually do this with textures. Keep the original texture name in the replace texture puzzle. Do not change that with the variable you have now.

    • This reply was modified 8 months, 2 weeks ago by xeon.
    • This reply was modified 8 months, 2 weeks ago by xeon.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #66206
    kdv
    Participant

    Texture names remain unchanged after any replacement. No need to use variables in this case.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #66217
    vision
    Customer

    Texture names remain unchanged after any replacement. No need to use variables in this case.

    The variable is used for keeping track of which texture (or material) needs to be replaced.
    Since the outcome of the last selected option in menu material is the one that needs to be replaced.

    Is there a way to use a puzzle to replace a texture (or material) without the name of the texture-to-replace being known/used in the puzzle?

    #66218
    kdv
    Participant

    Once again: names of textures remain unchanged. In you case it was enough to use this construction

    Texture’s images will be replaced, texture’s names will remain the same.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #66223
    vision
    Customer

    And in case of the replace material puzzle? When a color is chozen for the object, it needs to replace the previous material that was chosen.
    It can not me a static material in the replace texture slot, because it depends on the last material chosen.

    #66224
    kdv
    Participant

    because it depends on the last material chosen.

    In you example you used the same material. For different materials logic will be different. Think. Test.

    You could easily modify materials of your multi-material cube without replacing materials, just by replacing textures in materials. Or you could split you cube in Blender “one mesh – one material”. But you’ve chosen to replace materials. Ok. But why do you need to replace textures in replaced materials? :scratch:

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #66233
    vision
    Customer

    yes, I see that my questions are a little fragmented/confusing.

    The full info for my AR-app:
    I have a cube which I want to show in 20 colors and 10 textures.
    I think it is better for load times if there are only 2 materials (instead of 30), and I make adjustments within those 2 materials.

    Materials:
    The textures setup consists of 3 materials, assigned to respectively: top-bottom, left-right, front-rear of cube.
    The color setup is BSDF of which I change the RGB values via puzzles, assigned to all of cube.

    Changes:
    So when loading texture material, next step is to load the specific texture.
    And when loading color material, next step is RGB vaules are changed for the specific color.

    Problems:
    But when changing from a texture to a color material I think the assignment information is lost. So in the next change to a texture material there is assignment info for top-bottom, left-right, front-rear face assignment.

    I have already tested some options, of colors and textures setup, but because of AR/glTF2.0 requirements, the flexibility options (automate via shader, etc) are limited.

    #66235
    xeon
    Customer

    Is your cube a single object or is it 6 individual planes?
    If its a single object are you using one UV map or multiple?

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #66236
    vision
    Customer

    Is your cube a single object or is it 6 individual planes?

    cube is single object

    If its a single object are you using one UV map or multiple?

    Not using uv although it has 1 uv map, BUT am using texture coordinate object mapping (blender). I need this for my object.

    #66239
    kdv
    Participant

    BUT am using texture coordinate object mapping (blender)

    But it’s not supported by standard materials required for AR in iOS. USDZ exporter supports PBR materials and UV coordanates only. PBR materials (aka gltf 2.0 compatible or standard materials) also support only UV coordinates.

    I think it is better for load times if there are only 2 materials

    2 materials are not enough for an object with three sub-meshes. You need 3 color materials and three texture materials. And two puzzles: “set color” and “replace texture”. That’s enough to get any combination of colors/textures on the cube’s sides.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #66249
    vision
    Customer

    ok, thxs for the response, it is working now!

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.