View Single Post
  #1  
Old 06-03-2014, 02:50 PM
Marco Marco is offline
Member
 
Join Date: Apr 2014
Posts: 5
Weird confusion with node.visible() and node.alpha()

Hi everyone,

I got a mainscript controlling some subscripts. I'm changing in between my subscripts, controlled via my mainscript... having objects preloaded before... via resource contexts... viz.sendEvent(CHANGE_SCRIPT) to switch in between... and so on... cheers to masaki and paul this way

Everything seems to be working correctly there... no worries... really checked it several times!!! So this part shouldn't produce a problem!

Just recognized some strange things happening in one subscript using commands like node.visible() and node.alpha() in that specific script.

Via this subscripts I'm preloading an IVE-model, that I'm hiding from the scene until a function is called, making the model visible. That easy, normally.

Nothing is declared to do something with that model neither in my mainscript nor in any of the subs... except the one regarded, of course...

While using node.alpha(0) nothing is happening. My object is visible from the beginning. It seems to be ignored...
But using node.visible(0), the object will be hidden until the function will be called. Ok, here we go.

Moreon, as I'm trying to use viztask.waitTime(2) within that process, it just isn't scheduled... no error given to me...

Here's the rough version of what's going on in the subscript:

import viz
import vizact
import vizshape
import viztask

viz.setMultiSample(8)
viz.fov(60)
viz.go(viz.FULLSCREEN)

# Load stuff and make it invisible at the beginning

obj = viz.add('someObject.ive')
obj.visible(0)
#obj.alpha(0)

def someFunc():

# Fade in objects one by one
# fadeIn = vizact.fadeTo(1,begin=0,time=.5)

while True:

# yield viztask.waitTime(2)
# obj.add(fadeIn)
obj.visible(1)

viz.callback(EVENT_EVENT, someFunc)

I'll provide more code for sure, if necessary. Did I miss something really stupid? What could provocate that? Thanks in advance guys!

Marco
Reply With Quote