Skip to content

BodyStream: maximum number of style pushes  #14

@pyropix

Description

@pyropix

In case joints of a tracked body are outside of the tracking area, the following warning is logged to console, in case the BodyStream is drawn:

[warning] ofGraphics: ofPushStyle(): maximum number of style pushes << 32 reached, did you forget to pop somewhere?

The reason I found is the TrackingState check of joint0 and joint1 in Body::drawBone(..), ofxKinect2.cpp. Here there are two return statements in lines 1277 and 1282 without calling ofPopStyle(), first.

I suggest to add calls of ofPopStyle() before each return statement:

if((state0 == TrackingState_NotTracked) || (state1 == TrackingState_NotTracked))
{
	ofPopStyle();
	return;
}

if((state0 == TrackingState_Inferred) && (state1 == TrackingState_Inferred))
{
	ofPopStyle();
	return;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions