 
     fadeTo = (to, duration) ->
         (text_object) ->
-            current = text_object.children[0].material.uniforms.opacity.value
+            current = if text_object.children[0]?
+                text_object.children[0].material.uniforms.opacity.value
+            else 0
             i = d3.interpolate current, to
             getTransitionPromise(i, duration) text_object
 


            traverse(root)

    getOneWord: (text_object, word) ->
        word_object = new THREE.Object3D()



        # debugger

    animateLines: (root) =>
        _getOneWord = @getOneWord
        traverse = (node) =>
            return if ! node.children?


    LINE_SPACING = 40

    getWordIndex = (line, word) ->
        expression = if word is "—" then word else "\\b#{word}\\b"
        regex = new RegExp expression, "i"
        line.search regex

    alignToNode = (parent) ->
