Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

176
Visualizações
How to access child properties in other modules in native JavaScript?

in module 1 I have:

   `setMaterial()
   {
         this.material = new THREE.ShaderMaterial({
         transparent: true,
         uniforms:
          {
          uAlpha: { value: 0}
          },
         //wireframe: true,
         vertexShader: 
         void main()
             {
             gl_Position = vec4(position, 1.0);
             }
              ,
         fragmentShader: 
         uniform float uAlpha;
         void main()
         {
             gl_FragColor = vec4(0.0, 0.0, 0.0, uAlpha);
         }
    
       })

     }

in a second module I have:

my instance

    this.material = new Loading()

and the gsap I want to recive the property:

 setLoaders()
  {
     const loadingManager = new THREE.LoadingManager(
        // Loaded
  () =>
  {
   
    gsap.to(this.material.uniforms.uAlpha, { duration: 3, value:  0})
  },

if I add anymore child properties on the instance it e.g.

   this.material.uniforms = new Loading()

I am given a ERROR:

  `Cannot set properties of undefined (setting 'uniforms')
   `

how do I get the Uniforms then the uAlpha?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda