View Single Post
# 2 11-02-2017 , 03:20 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Space it out, and it becomes more apparent. There are multiple issues with the nesting of your conditions, as well as semicolons.

Code:
//check if there is rotation in Z
if(R_FK_Shoulder_CTRL.rotateZ != 0)
{
	// if there is rotation in Z, check if there is rotation in X
	if(R_FK_Shoulder_CTRL.rotateX !=0)
	{
		//if there is rotation in X after Z, then ik handle roll = rotateX / -2
		AO_R_BendArm_ikHandle01.Roll = R_FK_Shoulder_CTRL.rotateX /-2
	}
	// if there is no Rotation in X after Z, then Roll = 0
	else
	{
		AO_R_BendArm_ikHandle01.Roll = 0
	}
}
// if there was no rotation in Z in the first place, check if there is rotation in Y
else
{
	if(R_FK_Shoulder_CTRL.rotateY != 0)
	{
		// if there is Rotation in Y, check if there is Rotation in Z after Y
		if(R_FK_Shoulder_CTRL.rotateZ != 0) ;

		// if there is Rotation in Z after Y, Roll = rotateZ / -2
		AO_R_BendArm_ikHandle01.Roll = R_FK_Shoulder_CTRL.rotateZ /-2;

		// if there is no Rotation in Z after Y, Roll = 0
		else
		{
			AO_R_BendArm_ikHandle01.Roll = 0
		}
	};
	// if there was no Rotation in Y in the first place, Roll = 0
	else
	{
		AO_R_BendArm_ikHandle01.Roll = 0
	};
}


Imagination is more important than knowledge.