Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Commit

Permalink
Sceneform SDK v1.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tpsiaki committed Oct 30, 2019
1 parent 72eb6b3 commit 4a42587
Show file tree
Hide file tree
Showing 25 changed files with 139 additions and 71 deletions.
4 changes: 2 additions & 2 deletions samples/animation/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'

// Sceneform
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.12.0"
implementation "com.google.ar.sceneform:animation:1.12.0"
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0"
implementation "com.google.ar.sceneform:animation:1.13.0"
implementation 'com.android.support:design:28.0.0'
}

Expand Down
16 changes: 11 additions & 5 deletions samples/animation/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.ar.sceneform.samples.animation">
<!-- "AR Required" apps must declare minSdkVersion ≥ 24.
"AR Optional" apps must declare minSdkVersion ≥ 14 -->
<!-- Sceneform requires OpenGLES 3.0 or later. -->
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
<!-- Always needed for AR. -->

<uses-permission android:name="android.permission.CAMERA" />
<!-- This tag indicates that this application requires ARCore. This results in the application
only being visible in the Google Play Store on devices that support ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and results in
the app only being visible in the Google Play Store on devices that support ARCore.
For an "AR Optional" app, remove this tag. -->
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>

<application
Expand All @@ -31,9 +37,9 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="false"
tools:ignore="GoogleAppIndexingWarning">
<!-- This tag indicates that this application requires ARCore. This results in the
application only being visible in the Google Play Store on devices that support
ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and causes
the Google Play Store to download and intall Google Play Services for AR along with
the app. For an "AR Optional" app, specify "optional" instead of "required". -->
<meta-data android:name="com.google.ar.core" android:value="required" />

<activity android:name=".MainActivity"
Expand Down
2 changes: 1 addition & 1 deletion samples/animation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.ar.sceneform:plugin:1.12.0'
classpath 'com.google.ar.sceneform:plugin:1.13.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
4 changes: 2 additions & 2 deletions samples/augmentedfaces/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ android {
dependencies {

// Provides ArFragment, and other Sceneform UX resources:
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.12.0"
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0"

// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
//api project(":sceneformux")

// Alternatively, use ArSceneView without the UX dependency.
//implementation "com.google.ar.sceneform:core:1.12.0"
//implementation "com.google.ar.sceneform:core:1.13.0"

implementation "com.android.support:appcompat-v7:28.0.0"
}
Expand Down
15 changes: 10 additions & 5 deletions samples/augmentedfaces/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.ar.sceneform.samples.augmentedfaces">
<!-- "AR Required" apps must declare minSdkVersion ≥ 24.
"AR Optional" apps must declare minSdkVersion ≥ 14 -->
<!-- Sceneform requires OpenGLES 3.0 or later. -->
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
<!-- Always needed for AR. -->

<uses-permission android:name="android.permission.CAMERA" />
<!-- This tag indicates that this application requires ARCore. This results in the application
only being visible in the Google Play Store on devices that support ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and results in
the app only being visible in the Google Play Store on devices that support ARCore.
For an "AR Optional" app, remove this tag. -->
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>

<application
Expand All @@ -30,9 +35,9 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="false"
tools:ignore="GoogleAppIndexingWarning">
<!-- This tag indicates that this application requires ARCore. This results in the
application only being visible in the Google Play Store on devices that support
ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and causes
the Google Play Store to download and intall Google Play Services for AR along with
the app. For an "AR Optional" app, specify "optional" instead of "required". -->
<meta-data android:name="com.google.ar.core" android:value="required" />

<activity
Expand Down
2 changes: 1 addition & 1 deletion samples/augmentedfaces/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.ar.sceneform:plugin:1.12.0'
classpath 'com.google.ar.sceneform:plugin:1.13.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion samples/augmentedimage/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies {
implementation 'com.android.support:design:28.0.0'

// Use the Sceneform UX Package pre-built from Maven.
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.12.0"
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0"

// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
//api project(":sceneformux")
Expand Down
15 changes: 11 additions & 4 deletions samples/augmentedimage/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.ar.sceneform.samples.augmentedimage">
<!-- "AR Required" apps must declare minSdkVersion ≥ 24.
"AR Optional" apps must declare minSdkVersion ≥ 14 -->
<!-- Sceneform requires OpenGLES 3.0 or later. -->
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
<!-- Always needed for AR. -->

<uses-permission android:name="android.permission.CAMERA"/>
<!-- This tag indicates that this application requires ARCore. This results in the application
only being visible in the Google Play Store on devices that support ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and results in
the app only being visible in the Google Play Store on devices that support ARCore.
For an "AR Optional" app, remove this tag. -->
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>

<application
Expand All @@ -42,8 +48,9 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- This tag indicates that this application requires ARCore. This results in the Google Play
Store downloading and installing ARCore along with the application. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and causes
the Google Play Store to download and intall Google Play Services for AR along with
the app. For an "AR Optional" app, specify "optional" instead of "required". -->
<meta-data android:name="com.google.ar.core" android:value="required" />
</application>
</manifest>
2 changes: 1 addition & 1 deletion samples/augmentedimage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.ar.sceneform:plugin:1.12.0'
classpath 'com.google.ar.sceneform:plugin:1.13.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion samples/chromakeyvideo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {
implementation "com.android.support:design:28.0.0"

// Use the Sceneform UX Package pre-built from Maven.
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.12.0"
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0"

// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
//api project(":sceneformux")
Expand Down
15 changes: 10 additions & 5 deletions samples/chromakeyvideo/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.ar.sceneform.samples.chromakeyvideo">
<!-- "AR Required" apps must declare minSdkVersion ≥ 24.
"AR Optional" apps must declare minSdkVersion ≥ 14 -->
<!-- Sceneform requires OpenGLES 3.0 or later. -->
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
<!-- Always needed for AR. -->

<uses-permission android:name="android.permission.CAMERA" />
<!-- This tag indicates that this application requires ARCore. This results in the application
only being visible in the Google Play Store on devices that support ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and results in
the app only being visible in the Google Play Store on devices that support ARCore.
For an "AR Optional" app, remove this tag. -->
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>

<application
Expand All @@ -30,9 +35,9 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="false"
tools:ignore="GoogleAppIndexingWarning">
<!-- This tag indicates that this application requires ARCore. This results in the
application only being visible in the Google Play Store on devices that support
ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and causes
the Google Play Store to download and intall Google Play Services for AR along with
the app. For an "AR Optional" app, specify "optional" instead of "required". -->
<meta-data android:name="com.google.ar.core" android:value="required" />

<activity
Expand Down
2 changes: 1 addition & 1 deletion samples/chromakeyvideo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.ar.sceneform:plugin:1.12.0'
classpath 'com.google.ar.sceneform:plugin:1.13.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
4 changes: 2 additions & 2 deletions samples/hellosceneform/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ android {
dependencies {

// Provides ArFragment, and other Sceneform UX resources:
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.12.0"
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0"

// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
//api project(":sceneformux")

// Alternatively, use ArSceneView without the UX dependency.
//implementation "com.google.ar.sceneform:core:1.12.0"
//implementation "com.google.ar.sceneform:core:1.13.0"

implementation "com.android.support:appcompat-v7:28.0.0"
}
Expand Down
15 changes: 10 additions & 5 deletions samples/hellosceneform/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.ar.sceneform.samples.hellosceneform">
<!-- "AR Required" apps must declare minSdkVersion ≥ 24.
"AR Optional" apps must declare minSdkVersion ≥ 14 -->
<!-- Always needed for AR. -->

<uses-permission android:name="android.permission.CAMERA" />
<!-- This tag indicates that this application requires ARCore. This results in the application
only being visible in the Google Play Store on devices that support ARCore. -->
<!-- Sceneform requires OpenGLES 3.0 or later. -->
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and results in
the app only being visible in the Google Play Store on devices that support ARCore.
For an "AR Optional" app, remove this tag. -->
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>

<application
Expand All @@ -30,9 +35,9 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="false"
tools:ignore="GoogleAppIndexingWarning">
<!-- This tag indicates that this application requires ARCore. This results in the
application only being visible in the Google Play Store on devices that support
ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and causes
the Google Play Store to download and intall Google Play Services for AR along with
the app. For an "AR Optional" app, specify "optional" instead of "required". -->
<meta-data android:name="com.google.ar.core" android:value="required" />

<activity
Expand Down
2 changes: 1 addition & 1 deletion samples/hellosceneform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.ar.sceneform:plugin:1.12.0'
classpath 'com.google.ar.sceneform:plugin:1.13.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion samples/solarsystem/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ android {
}

dependencies {
implementation "com.google.ar.sceneform:core:1.12.0"
implementation "com.google.ar.sceneform:core:1.13.0"
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:design:28.0.0"
}
Expand Down
15 changes: 10 additions & 5 deletions samples/solarsystem/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.ar.sceneform.samples.solarsystem">
<!-- "AR Required" apps must declare minSdkVersion ≥ 24.
"AR Optional" apps must declare minSdkVersion ≥ 14 -->
<!-- Sceneform requires OpenGLES 3.0 or later. -->
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
<!-- Always needed for AR. -->

<uses-permission android:name="android.permission.CAMERA" />
<!-- This tag indicates that this application requires ARCore. This results in the application
only being visible in the Google Play Store on devices that support ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and results in
the app only being visible in the Google Play Store on devices that support ARCore.
For an "AR Optional" app, remove this tag. -->
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>

<application
Expand All @@ -32,9 +37,9 @@
android:supportsRtl="true"
android:largeHeap="true"
tools:ignore="GoogleAppIndexingWarning">
<!-- This tag indicates that this application requires ARCore. This results in the
application only being visible in the Google Play Store on devices that support
ARCore. -->
<!-- Indicates that this app requires Google Play Services for AR ("AR Required") and causes
the Google Play Store to download and intall Google Play Services for AR along with
the app. For an "AR Optional" app, specify "optional" instead of "required". -->
<meta-data android:name="com.google.ar.core" android:value="required" />

<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,15 @@ public static void displayError(
});
}

/**
* Creates an ARCore session. This checks for the CAMERA permission, and if granted, checks the
* state of the ARCore installation. If there is a problem an exception is thrown. Care must be
* taken to update the installRequested flag as needed to avoid an infinite checking loop. It
* should be set to true if null is returned from this method, and called again when the
* application is resumed.
*
* @param activity - the activity currently active.
* @param installRequested - the indicator for ARCore that when checking the state of ARCore, if
* an installation was already requested. This is true if this method previously returned
* null. and the camera permission has been granted.
*/
public static Session createArSession(Activity activity, boolean installRequested)
private static Session createArSession(
Activity activity, boolean installRequested, Config.LightEstimationMode lightEstimationMode)
throws UnavailableException {
Session session = null;
// if we have the camera permission, create the session
if (hasCameraPermission(activity)) {
switch (ArCoreApk.getInstance().requestInstall(activity, !installRequested)) {
case INSTALL_REQUESTED:
installRequested = true;
return null;
case INSTALLED:
break;
Expand All @@ -104,11 +94,45 @@ public static Session createArSession(Activity activity, boolean installRequeste
// IMPORTANT!!! ArSceneView requires the `LATEST_CAMERA_IMAGE` non-blocking update mode.
Config config = new Config(session);
config.setUpdateMode(Config.UpdateMode.LATEST_CAMERA_IMAGE);
config.setLightEstimationMode(lightEstimationMode);
session.configure(config);
}
return session;
}

/**
* Creates an ARCore session, requesting ARCore installation if necessary. This checks for the
* CAMERA permission, and if granted, checks the state of the ARCore installation and requests
* installation if not already installed. If there is a problem an exception is thrown. Care must
* be taken to update the installRequested flag as needed to avoid an infinite checking loop. It
* should be set to true if null is returned from this method, and called again when the
* application is resumed.
*
* @param activity - the activity currently active.
* @param lightEstimationMode - the light estimation mode to be set on the returned session.
*/
public static Session createArSessionWithInstallRequest(
Activity activity, Config.LightEstimationMode lightEstimationMode)
throws UnavailableException {
return createArSession(activity, true, lightEstimationMode);
}

/**
* Creates an ARCore session, but does not install ARCore even if it is unavailable. This checks
* for the CAMERA permission, and if granted, checks the state of the ARCore installation. If
* there is a problem an exception is thrown. Care must be taken to update the installRequested
* flag as needed to avoid an infinite checking loop. It should be set to true if null is returned
* from this method, and called again when the application is resumed.
*
* @param activity - the activity currently active.
* @param lightEstimationMode - the light estimation mode to be set on the returned session.
*/
public static Session createArSessionNoInstallRequest(
Activity activity, Config.LightEstimationMode lightEstimationMode)
throws UnavailableException {
return createArSession(activity, false, lightEstimationMode);
}

/** Check to see we have the necessary permissions for this app, and ask for them if we don't. */
public static void requestCameraPermission(Activity activity, int requestCode) {
ActivityCompat.requestPermissions(
Expand Down
Loading

0 comments on commit 4a42587

Please sign in to comment.