Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,

I'm trying to animate my model that has taken the place of the main model for renderplayer. And as usual, where I am learning to mod, trouble follows. In this test, I've created a simple animation using LLibrary ModelAnimator. Specifically, using keyframes. I attempted the walk() method, however, it does the same thing. Nothing happens, and I know I'm at fault. I used the eclipse debugger and it showed that the method animate() in render has no return value. I'm not sure this is the right place for this inquiry. If it isn't then I will be more than willing to change over to another support forum. 

 

Here's what I have.

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { 
    	EntityTwoPlayer twoplayer = (EntityTwoPlayer) entity;
    	animate(twoplayer, f, f1, f2, f3, f4, f5);
    	
        GlStateManager.pushMatrix();
        GlStateManager.translate(this.Head.offsetX, this.Head.offsetY, this.Head.offsetZ);
        GlStateManager.translate(this.Head.rotationPointX * f5, this.Head.rotationPointY * f5, this.Head.rotationPointZ * f5);
        GlStateManager.scale(0.68D, 0.81D, 0.81D);
        GlStateManager.translate(-this.Head.offsetX, -this.Head.offsetY, -this.Head.offsetZ);
        GlStateManager.translate(-this.Head.rotationPointX * f5, -this.Head.rotationPointY * f5, -this.Head.rotationPointZ * f5);
        this.Head.render(f5);
        GlStateManager.popMatrix();
    }
    /**
     * This is a helper function from Tabula to set the rotation of model parts
     */
	@Override
	public void setRotationAngles(TabulaModel model, EntityTwoPlayer entity, float f, float f1, float f2,
			float f3, float f4, float f5) {
			super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
			resetToDefaultPose();

	}
	
	 public void animate(IAnimatedEntity entity, float f, float f1, float f2, float f3, float f4, float f5) {
		 EntityTwoPlayer twoplayer = (EntityTwoPlayer) entity;
		 animator.update(twoplayer);
		 setRotationAngles(f5, f, f1, f2, f3, f4, twoplayer);
		 float frame = twoplayer.ticksExisted + LLibrary.PROXY.getPartialTicks();
		 
		 if (twoplayer.getAnimation() == EntityTwoPlayer.WALK_ANIMATION) {
			 animator.setAnimation(EntityTwoPlayer.WALK_ANIMATION);
			 if(twoplayer.isSprinting()) {
				 animator.startKeyframe(8);
				 animator.rotate(Thigh1, 15.5f, 0, 0);
				 animator.endKeyframe();
				 animator.setStaticKeyframe(2);
				 animator.startKeyframe(8);
				 animator.rotate(Thigh1, -10f, 0, 0);
				 animator.endKeyframe();
				 animator.setStaticKeyframe(2);
				 animator.resetKeyframe(10);
			 }
		 }
	 }

Any help is greatly appreciated.

Edited by LittleOne

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.