Create a scene.setactive message
19125
def scene_active(sequence_number, scene_id):
        """"""
        return MessageWriter().string("scene.setactive").uint64(sequence_number).uint32(scene_id).get()
1270070
def add_message(self, text, type=None):
        """"""
        key = self._msg_key
        self.setdefault(key, [])
        self[key].append(message(type, text))
        self.save()
930758
def set_splash(self, message):
        """"""
        if self.splash is None:
            return
        if message:
            logger.info(message)
        self.splash.show()
        self.splash.showMessage(message, Qt.AlignBottom | Qt.AlignCenter |
                                Qt.AlignAbsolute, QColor(Qt.white))
        QApplication.processEvents()
62109
function () {
    var cameraEls;
    var newActiveCameraEl;
    cameraEls = this.sceneEl.querySelectorAll('[camera]');
    newActiveCameraEl = cameraEls[cameraEls.length - 1];
    newActiveCameraEl.setAttribute('camera', 'active', true);
  }
36281
def set_message_for(exception, env)
      session = env[ActionDispatch::Request::Session::ENV_SESSION_KEY] || {}
      env[ActionDispatch::Flash::KEY] ||= ActionDispatch::Flash::FlashHash.from_session_value session['flash']
      flash = env[ActionDispatch::Flash::KEY]
      flash[:alert] = exception.message
    end
443297
function () {

			if ( 'GlobalSettings' in fbxTree && 'AmbientColor' in fbxTree.GlobalSettings ) {

				var ambientColor = fbxTree.GlobalSettings.AmbientColor.value;
				var r = ambientColor[ 0 ];
				var g = ambientColor[ 1 ];
				var b = ambientColor[ 2 ];

				if ( r !== 0 || g !== 0 || b !== 0 ) {

					var color = new THREE.Color( r, g, b );
					sceneGraph.add( new THREE.AmbientLight( color, 1 ) );

				}

			}

		}
317432
def scene_add(sequence_number, scene_id, animation_id, name, color, velocity, config):
        """"""
        (red, green, blue) = (int(color[0]*255), int(color[1]*255), int(color[2]*255))
        return MessageWriter().string("scene.add").uint64(sequence_number).uint32(scene_id).uint32(animation_id).string(name) \
                              .uint8_3(red, green, blue).uint32(int(velocity * 1000)).string(config).get()
39911
def set_scenemode(self, scenemode='auto'):
        
        if scenemode not in self.available_settings['scenemode']:
            _LOGGER.debug('%s is not a valid scenemode', scenemode)
            return False
        return self.change_setting('scenemode', scenemode)
583723
function ( deltaTime ) {

		deltaTime *= this.timeScale;

		var actions = this._actions,
			nActions = this._nActiveActions,

			time = this.time += deltaTime,
			timeDirection = Math.sign( deltaTime ),

			accuIndex = this._accuIndex ^= 1;

		// run active actions

		for ( var i = 0; i !== nActions; ++ i ) {

			var action = actions[ i ];

			action._update( time, deltaTime, timeDirection, accuIndex );

		}

		// update scene graph

		var bindings = this._bindings,
			nBindings = this._nActiveBindings;

		for ( var i = 0; i !== nBindings; ++ i ) {

			bindings[ i ].apply( accuIndex );

		}

		return this;

	}
539813
def message(self, message, source, point, ln):
        """"""
        message += " (disable --strict to dismiss)"
        return super(CoconutStyleError, self).message(message, source, point, ln)
1140172
def scene_config(sequence_number, scene_id, config):
        """"""
        return MessageWriter().string("scene.config").uint64(sequence_number).uint32(scene_id).string(config).get()
547380
def create_message_dialog(self, text, buttons=Gtk.ButtonsType.CLOSE, icon=Gtk.MessageType.WARNING):
        
        dialog = Gtk.MessageDialog(None,
                                   Gtk.DialogFlags.DESTROY_WITH_PARENT,
                                   icon,
                                   buttons,
                                   text
        )
        return dialog
850601
def reset(self):
        
        self.scene = cocos.scene.Scene()
        self.z = 0

        palette = config.settings['view']['palette']
        #Player.palette = palette
        r, g, b = palette['bg']
        self.scene.add(cocos.layer.ColorLayer(r, g, b, 255), z=self.z)
        self.z += 1
        message_layer = MessageLayer()
        self.scene.add(message_layer, z=self.z)
        self.z += 1
        self.world_layer = WorldLayer(self.mode_id, fn_show_message=message_layer.show_message)
        self.scene.add(self.world_layer, z=self.z)
        self.z += 1

        self.director._set_scene(self.scene)

        # Step once to refresh before `act`
        self.step()

        # TODO: Reset to `ones`?
        return self.world_layer.get_state()
153503
def message(self, text):
        """"""
        line = 0
        # Iterate through each character.
        for char in text:
            # Advance to next line if character is a new line.
            if char == '\n':
                line += 1
                # Move to left or right side depending on text direction.
                col = 0 if self.displaymode & LCD_ENTRYLEFT > 0 else self._cols-1
                self.set_cursor(col, line)
            # Write the character to the display.
            else:
                self.write8(ord(char), True)
951591
def scene_off(self):
        """"""
        user_data = Userdata({'d1': self._group,
                              'd2': 0x00,
                              'd3': 0x00,
                              'd4': 0x13,
                              'd5': 0x00,
                              'd6': 0x00})
        self._set_sent_property(DIMMABLE_KEYPAD_SCENE_ON_LEVEL, 0x00)
        cmd = ExtendedSend(self._address,
                           COMMAND_EXTENDED_TRIGGER_ALL_LINK_0X30_0X00,
                           user_data)
        cmd.set_checksum()
        self._send_method(cmd, self._received_scene_triggered)
424652
def set_scene_color(self, scene_id, color):
        """"""
        if not scene_id in self.state.scenes: # does that scene_id exist?
            err_msg = "Requested to recolor scene {sceneNum}, which does not exist".format(sceneNum=scene_id)
            logging.info(err_msg)
            return(False, 0, err_msg)
        self.state.scenes[scene_id] = self.state.scenes[scene_id]._replace(color=color)
        sequence_number = self.zmq_publisher.publish_scene_color(scene_id, color)
        logging.debug("Recolored scene {sceneNum}".format(sceneNum=scene_id))
        if scene_id == self.state.activeSceneId:
            self.state.activeAnimation.set_color(color)
            self._do_next_frame() # TODO: make it more sensible, e.g. call only if static scene
        return (True, sequence_number, "OK")
890913
def add_scene(self, animation_id, name, color, velocity, config):
        """"""
        # check arguments
        if animation_id < 0 or animation_id >= len(self.state.animationClasses):
            err_msg = "Requested to register scene with invalid Animation ID. Out of range."
            logging.info(err_msg)
            return(False, 0, err_msg)
        if self.state.animationClasses[animation_id].check_config(config) is False:
            err_msg = "Requested to register scene with invalid configuration."
            logging.info(err_msg)
            return(False, 0, err_msg)
        self.state.sceneIdCtr += 1
        self.state.scenes[self.state.sceneIdCtr] = Scene(animation_id, name, color, velocity, config)
        sequence_number = self.zmq_publisher.publish_scene_add(self.state.sceneIdCtr, animation_id, name, color, velocity, config)
        logging.debug("Registered new scene.")

        # set this scene as active scene if none is configured yet
        if self.state.activeSceneId is None:
            self.set_scene_active(self.state.sceneIdCtr)
        return (True, sequence_number, "OK")