Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

If you have any questions, reports, suggestions, or requests about Live2D, please send them to this community.
※We cannot guarantee statements or answers from Live2D staff. Thank you for your understanding in advance.
 
Live2D Cubism
Cubism Products and Downloads
Cubism product manuals and tutorials
Cubism Editor Manual    Cubism Editor Tutorial    Cubism SDK Manual    Cubism SDK Tutorial
Live2D user has created a tutorial video(unoffilcial) in English. SEE ALSO.
Thank you, brian_tsui!
[Live2D Tutorial 2020] Introduction to Tools and Technical Concepts
[NOTICE]
About the support for Mac models
Cubism Editor is not supported with Apple M1 processors.
Please refer to System Requirements for details.
We will not respond to any related inquiries with this message.

Question - Display part of the Live2D Model | Cubism | JS

Is there a way to display only part of a live2d model? (eg: displaying only the head)

Thanks in advance)

Comments

  • edited February 2016
    Hi, Rus .
    I have to display some of the parts in the following code .
    
    // Define Live2D model
    var MODEL_PATH = "assets/haru/";
    var MODEL_DEFINE = {
        "type":"Live2D Model Setting",
        "name":"haru",
        "model": MODEL_PATH + "haru.moc",
        "textures":[
            MODEL_PATH + "haru.1024/texture_00.png",
            MODEL_PATH + "haru.1024/texture_01.png",
            MODEL_PATH + "haru.1024/texture_02.png",
        ],
        "motions":[
            MODEL_PATH + "motions/idle_00.mtn",
            MODEL_PATH + "motions/tapBody_06.mtn",
            MODEL_PATH + "motions/tapBody_09.mtn",
        ],
        "parts":[
            "PARTS_01_FACE_001", "PARTS_01_HOHO_001", "PARTS_01_EYE_001",
            "PARTS_01_EYE_BALL_001", "PARTS_01_BROW_001", "PARTS_01_MOUTH_001",
            "PARTS_01_NOSE_001", "PARTS_01_EAR_001", "PARTS_01_HAIR_FRONT_001",
            "PARTS_01_HAIR_BACK_001", "PARTS_01_HAIR_SIDE_001", "PARTS_01_NECK_001",
            "PARTS_01_BODY_001", "PARTS_01_ARM_L_A_001", "PARTS_01_ARM_R_A_001",
        ],
    };
    .
    .
    .
    // Hide all the parts
    for(var j = 0; j < MODEL_DEFINE.parts.length; j++){
        live2DModel.setPartsOpacity(MODEL_DEFINE.parts[j], 0.0);
    }
    
    // Display only back hair
    that.live2DModel.setPartsOpacity("PARTS_01_HAIR_BACK_001", 1.0);
    
    // Live2D Draw
    that.live2DModel.draw();
    
  • I had it here and it worked. Thank you.
    
    draw = function(gl){	
        ...
        live2DModel.setPartsOpacity("PARTS_ ... ", 0);	
        motionMgr.updateParam(live2DModel);
        live2DModel.update(); 
        live2DModel.draw();	
    }
    
  • A related question.

    If I have a live2d model, consisting of a head and a body. But I only want to load and display the head, and ignoring the body completely (ie: not load and hence not display the body). How do I do that?

    Thanks in advance)
Sign In or Register to comment.