Sceneform-android-sdk: Remove HandMotionAnimation

Created on 4 Jun 2018  路  10Comments  路  Source: google-ar/sceneform-android-sdk

Hi,
is it possible to start Arcore/sceneform without the HandMotionAnimation? I Can't find an easy way to switch it off.
For example in the hello-arcore app for java.

Best regards and thank you!

question

Most helpful comment

You will want to do something like:
ArFragment.getDiscoveryController().hide();
ArFragment.getDiscoveryController().setInstructionView(null);

if you inherit ArFragment you can call these in your fragment's onCreateView

See more info on DiscoveryController at https://developers.google.com/ar/reference/java/com/google/ar/sceneform/ux/PlaneDiscoveryController

All 10 comments

You will want to do something like:
ArFragment.getDiscoveryController().hide();
ArFragment.getDiscoveryController().setInstructionView(null);

if you inherit ArFragment you can call these in your fragment's onCreateView

See more info on DiscoveryController at https://developers.google.com/ar/reference/java/com/google/ar/sceneform/ux/PlaneDiscoveryController

It worked, Thank you!

@malik-at-work, I have similar question. how can I notice plane detect is done?
is there any callback function?

Currently there is no callback.

PlaneDiscoveryController is driven from onUpdate, so you could add code to trigger your new behavior there as well

@Override
public void onUpdate(FrameTime frameTime) {
super.onUpdate(frameTime);
for (Plane plane : frame.getUpdatedTrackables(Plane.class)) {
if (plane.getTrackingState() == TrackingState.TRACKING) {
// Once there is a tracking plane, plane discovery stops.
// do your callback here.
}
}
}

@malik-at-work, Thanks very much!

@malik-at-work Hello!

I don't want create another issue, but I'd like some help because I feel like it's related.

The question is: how do I also hide rendered plane? (link below)

image

To turn off the plane renderer you should disable planeRenderer - https://developers.google.com/ar/reference/java/com/google/ar/sceneform/rendering/PlaneRenderer.

You can do it by changing arSceneView.getPlaneRenderer().setEnabled to false.

Or use setVisible if you are going to render plane and hide visualization only.

@malik-at-work: also had to do that override for plane detection complete. Would be nice to add an official callback for it 馃檪

Did you change the API for hiding the hand motion? I have an ArFragment and used the getPlaneDiscoveryController() instead because getDiscoveryController() doesn't exist.

When setting instruction view to null, the hand is still shown.

This is my code in onResume:

arFragment = (ArFragment) getChildFragmentManager().findFragmentById(R.id.ar_fragment);
if (arFragment != null) {
            // hiding the plane discovery
            arFragment.getPlaneDiscoveryController().hide();
            arFragment.getPlaneDiscoveryController().setInstructionView(null);
            arFragment.getArSceneView().getPlaneRenderer().setEnabled(false);
}
// setup session etc.

It is some time since you asked that and sure you solved it by now, but for future reference (as this is the first that showed up on Google for me...)

What is needed right now is to call hide() and setInstructionView(null) in this order but within the onResume after super.onResume was executed.

@Override public void onResume() { super.onResume(); getPlaneDiscoveryController().hide(); getPlaneDiscoveryController().setInstructionView(null); }

Then it worked for me

Was this page helpful?
0 / 5 - 0 ratings