Browse Source

Workaround: Don't rely on Engine Deployment but build from source into a local maven repo.

MeFisto94 9 years ago
parent
commit
f517917f96
4 changed files with 107 additions and 3 deletions
  1. 6 3
      .travis.yml
  2. 2 0
      build.gradle
  3. 14 0
      build_engine.sh
  4. 85 0
      patches/FixHWSkinningSerialization.diff

+ 6 - 3
.travis.yml

@@ -16,6 +16,7 @@ addons:
   apt:
   apt:
     packages:
     packages:
     - p7zip-full
     - p7zip-full
+    - maven
 
 
 # branches:
 # branches:
 #   only:
 #   only:
@@ -29,12 +30,14 @@ notifications:
       secure: cOYkCWyBNtM4QiqNbGvhCE2lFxHSnmLfRl1wLJzeDBYEDbg1nOXayRwyH1dQzWCvhDhqv2qWHHASgddE14JwnVB7p56DcaQWAJ5yn/OyY9GzaHuz59Xm6LbFbz5JfabHY7LczuBlRtISlyfz4eHD5BOvfCzx7D3GI44kQX99BCFr1mqDjQEUyTPwhLolFPL5+zx7J669ud2Ba0TywtaWsXeOUvORAXAdlQv1RRAmQvUK9DIYyq0Z3fzr/uXEBaPAz50JFXkMs00Z8Dutdiu9jd/SsRnEv0O+ns75outu6WK2UwS1xHhcdW7bkMuTmRpGoec7XbbjSaz6oYsHSp8kyuPhLEzS2ba2QIxDmOkF/erejeAMdDlsIKwRMpizRCh/8gMZR2nNEzdHQ0gbgEk83PFYgQw+amtlOk61l6THopwLtVpDiiE1Elz5ev7KqSr//qWQgoHBFabQOgE5KjfxmLDmuUNWaZyuJi6JTwsxB04NGAa3zpQ6RKQ7dgGBZF7QIQ+f648oxVlLIK+T3VAdK47s94XKTRJ0CqRoA6nI2MCaLbU9zvS8uAWoLOIKw6ec2qexPaVCE+TO0780+x6tBFSYexwH8fwmEl1nPqBldipYCLIRZV7XbJh3bhfPksXuz2B6poJ/wL5gLtWNAXnBoWyI7Vu/PHbFsn+VhLUkYSU=
       secure: cOYkCWyBNtM4QiqNbGvhCE2lFxHSnmLfRl1wLJzeDBYEDbg1nOXayRwyH1dQzWCvhDhqv2qWHHASgddE14JwnVB7p56DcaQWAJ5yn/OyY9GzaHuz59Xm6LbFbz5JfabHY7LczuBlRtISlyfz4eHD5BOvfCzx7D3GI44kQX99BCFr1mqDjQEUyTPwhLolFPL5+zx7J669ud2Ba0TywtaWsXeOUvORAXAdlQv1RRAmQvUK9DIYyq0Z3fzr/uXEBaPAz50JFXkMs00Z8Dutdiu9jd/SsRnEv0O+ns75outu6WK2UwS1xHhcdW7bkMuTmRpGoec7XbbjSaz6oYsHSp8kyuPhLEzS2ba2QIxDmOkF/erejeAMdDlsIKwRMpizRCh/8gMZR2nNEzdHQ0gbgEk83PFYgQw+amtlOk61l6THopwLtVpDiiE1Elz5ev7KqSr//qWQgoHBFabQOgE5KjfxmLDmuUNWaZyuJi6JTwsxB04NGAa3zpQ6RKQ7dgGBZF7QIQ+f648oxVlLIK+T3VAdK47s94XKTRJ0CqRoA6nI2MCaLbU9zvS8uAWoLOIKw6ec2qexPaVCE+TO0780+x6tBFSYexwH8fwmEl1nPqBldipYCLIRZV7XbJh3bhfPksXuz2B6poJ/wL5gLtWNAXnBoWyI7Vu/PHbFsn+VhLUkYSU=
 
 
 install:
 install:
+  - chmod u+x build_engine.sh
+  - ./build_engine.sh
   - ./gradlew buildSdk
   - ./gradlew buildSdk
   - cd jdks
   - cd jdks
   - ./download-jdks.sh
   - ./download-jdks.sh
   - cd ../
   - cd ../
-  - '[ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && ant -Dstorepass="$NBM_SIGN_PASS" hudson-nightly | awk "{printf(\".\"); fflush(stdout)}" || :'
-  - '[ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && scp -rp -i nbproject/private/www-updater.key build/updates/* [email protected]:/var/www/updates/nightly/3.1/plugins || :'
+  #- '[ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && ant -Dstorepass="$NBM_SIGN_PASS" hudson-nightly | awk "{printf(\".\"); fflush(stdout)}" || :'
+  #- '[ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && scp -rp -i nbproject/private/www-updater.key build/updates/* [email protected]:/var/www/updates/nightly/3.1/plugins || :'
   
   
 #script:
 #script:
 #  - ./gradlew check
 #  - ./gradlew check
@@ -46,7 +49,7 @@ before_deploy:
   - ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version suite.nbms build-installers unset-spec-version | awk '{printf("."); fflush(stdout)}'
   - ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version suite.nbms build-installers unset-spec-version | awk '{printf("."); fflush(stdout)}'
   
   
   # Has to be done before deploy (due to the rm command)
   # Has to be done before deploy (due to the rm command)
-  - scp -rp -i nbproject/private/www-updater.key build/updates/* [email protected]:/var/www/updates/stable/3.1/plugins
+  #- scp -rp -i nbproject/private/www-updater.key build/updates/* [email protected]:/var/www/updates/stable/3.1/plugins
   - rm -rf build/
   - rm -rf build/
 
 
 deploy:
 deploy:

+ 2 - 0
build.gradle

@@ -11,6 +11,7 @@ if (!hasProperty('mainClass')) {
 }
 }
 
 
 repositories {
 repositories {
+    mavenLocal()
     jcenter {
     jcenter {
         url "http://jcenter.bintray.com/"
         url "http://jcenter.bintray.com/"
     }
     }
@@ -24,6 +25,7 @@ repositories {
 }
 }
 
 
 ext.jmeEngineVersion = "3.1.0-beta1" // Specify the Engine Version to be used.
 ext.jmeEngineVersion = "3.1.0-beta1" // Specify the Engine Version to be used.
+ext.jmeEngineVersion = "3.1.0-SNAPSHOT" // Specify the Engine Version to be used.
 
 
 configurations {
 configurations {
     corelibs
     corelibs

+ 14 - 0
build_engine.sh

@@ -0,0 +1,14 @@
+#!/bin/sh
+# This Shell Script will build and use the latest jMonkeyEngine git version, so there might be some undiscovered engine bugs, watch out!
+# Also if you want to revert to releases and bintray builds, you need to uninstall them from your local maven repo...
+echo "Downloading the Engine, this may take some time"
+git clone -b v3.1 --single-branch --depth 1 http://github.com/jMonkeyEngine/jMonkeyEngine/ engine # single-branch requires git > 1.7.10, if you see an error, just leave it out.
+
+cd engine
+echo "Patching the Engine...."
+patch -s -N -p 1 < ../patches/FixHWSkinningSerialization.diff
+
+echo "Building the Engine and installing them to your local maven repo...."
+./gradlew install # Depends on jarJavadoc, jarSourcecode, assemble, dist etc.
+
+cd ../

+ 85 - 0
patches/FixHWSkinningSerialization.diff

@@ -0,0 +1,85 @@
+From 9e187647d01b2994d8ba4eb0c925c3e4522d562a Mon Sep 17 00:00:00 2001
+From: MeFisto94 <[email protected]>
+Date: Wed, 25 May 2016 17:40:00 +0200
+Subject: [PATCH] Fix Hardware Skinning in 3.1 by implementing proper Array
+ Serialization for MatParams and making the Shared Materials Check only a
+ warning (it would pop up once each time you load the j3o and if you really
+ use Shared Materials you have weird animations and some log spamming)
+
+---
+ .../java/com/jme3/animation/SkeletonControl.java   |  3 +-
+ .../src/main/java/com/jme3/material/MatParam.java  | 37 ++++++++++++++++++++++
+ 2 files changed, 39 insertions(+), 1 deletion(-)
+
+diff --git a/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java b/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java
+index b753ad2..1d14fa6 100644
+--- a/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java
++++ b/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java
+@@ -255,7 +255,8 @@ public class SkeletonControl extends AbstractControl implements Cloneable, JmeCl
+                     // is operating on this material, in that case, user
+                     // is sharing materials between models which is NOT allowed
+                     // when hardware skinning used.
+-                    throw new UnsupportedOperationException(
++                    
++                    Logger.getLogger(SkeletonControl.class.getName()).log(Level.SEVERE,
+                             "Material instances cannot be shared when hardware skinning is used. " +
+                             "Ensure all models use unique material instances."
+                     );
+diff --git a/jme3-core/src/main/java/com/jme3/material/MatParam.java b/jme3-core/src/main/java/com/jme3/material/MatParam.java
+index 8d965e3..6c069a1 100644
+--- a/jme3-core/src/main/java/com/jme3/material/MatParam.java
++++ b/jme3-core/src/main/java/com/jme3/material/MatParam.java
+@@ -309,6 +309,8 @@ When arrays can be inserted in J3M files
+         } else if (value instanceof Boolean) {
+             Boolean b = (Boolean) value;
+             oc.write(b.booleanValue(), "value_bool", false);
++        } else if (value.getClass().isArray() && value instanceof Savable[]) {
++            oc.write((Savable[])value, "value_savable_array", null);
+         }
+     }
+ 
+@@ -327,6 +329,41 @@ When arrays can be inserted in J3M files
+             case Int:
+                 value = ic.readInt("value_int", 0);
+                 break;
++            case Vector2Array:
++                Savable[] savableArray = ic.readSavableArray("value_savable_array", null);
++                if (savableArray != null) {
++                    value = new Vector2f[savableArray.length];
++                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
++                }
++                break;
++            case Vector3Array:
++                savableArray = ic.readSavableArray("value_savable_array", null);
++                if (savableArray != null) {
++                    value = new Vector3f[savableArray.length];
++                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
++                }
++                break;
++            case Vector4Array:
++                savableArray = ic.readSavableArray("value_savable_array", null);
++                if (savableArray != null) {
++                    value = new Vector4f[savableArray.length];
++                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
++                }
++                break;
++            case Matrix3Array:
++                savableArray = ic.readSavableArray("value_savable_array", null);
++                if (savableArray != null) {
++                    value = new Matrix3f[savableArray.length];
++                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
++                }
++                break;
++            case Matrix4Array:
++                savableArray = ic.readSavableArray("value_savable_array", null);
++                if (savableArray != null) {
++                    value = new Matrix4f[savableArray.length];
++                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
++                }
++                break;
+             default:
+                 value = ic.readSavable("value_savable", null);
+                 break;
+-- 
+1.8.4
+