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.

v3d.js:132 v3d.PropertyBinding: Can not bind to objectName of node undefined.

Home Forums Programming v3d.js:132 v3d.PropertyBinding: Can not bind to objectName of node undefined.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #48526
    rowger
    Participant
    
    <template color="green">
        <dummy>
            <label>绘制一条线段:</label>
            <label>名称为:</label>
            <text name="name">myLine</text>
    
            <label>起点位置</label>
            <label>X:</label>
            <number name="startX"></number>
            <label>y:</label>
            <number name="startY"></number>
            <label>z:</label>
            <number name="startZ"></number>
    
            <label>终点为:</label>
             <label>X:</label>
            <number name="endX"></number>
             <label>y:</label>
            <number name="endY"></number>
             <label>z:</label>
            <number name="endZ"></number>
             <label>颜色为:</label>
            <color  name="myColor"></color>
    
        </dummy>
    </template>
    
    <script>
    function code(block) {
         const startX = <code>'${block.getFieldValue('startX')}'</code>;
         const startY = <code>'${block.getFieldValue('startY')}'</code>;
         const startZ = <code>'${block.getFieldValue('startZ')}'</code>;
    
         const endX = <code>'${block.getFieldValue('endX')}'</code>;
         const endY = <code>'${block.getFieldValue('endY')}'</code>;
         const endZ = <code>'${block.getFieldValue('endZ')}'</code>;
    
         const myColor = <code>'${block.getFieldValue('myColor')||'#660000'}'</code>;
         
    
        const fun = Plug.provide('myFunction1', function(startX, myColor,) {
          
            var times = [0, 10];
    
            var position_x = [0, 0, 0, 100, 0, 0];
    
            var pos1_Keyframe = new v3d.KeyframeTrack('.mesh[car].position', times, position_x);
    
            var duration = 10;
    
            var clip = new v3d.AnimationClip('boxAnimation', duration, [
                pos1_Keyframe
            ]);
       
    
            var mixer = new THREE.AnimationMixer(app.scene);
            var action = mixer.clipAction(clip);
            app.actions.push(action);
            console.log("====================app.actions")
            console.log(app.actions);
         
    
        
    
        });
        return <code>${fun}(${startX}, ${myColor});</code>;        
    }
    </script>
    

    I want create my Animation,How can I binding the mesh “car” with Animation?I sure ,the “car” is mesh in app.scene

    #48527
    rowger
    Participant

    console.log(app)

    Attachments:
    You must be logged in to view attached files.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.