Browse Source

- update bundled blender export script for Blender 2.59+

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8241 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 14 years ago
parent
commit
f79ca96ed8

+ 2 - 3
jme3-ogretools/src/com/jme3/gde/ogretools/blender/Bundle.properties

@@ -4,6 +4,5 @@ InstallBlenderExporterPanel.jTextField1.text=jTextField1
 InstallBlenderExporterPanel.jButton1.text=change
 InstallBlenderExporterPanel.jButton2.text=Install Exporter Script
 InstallBlenderExporterPanel.jButton3.text=Cancel
-InstallBlenderExporterPanel.jLabel2.text=Note that you will need Phython 2.6
-InstallBlenderExporterPanel.jLabel3.text=installed on your computer to use this plugin!
-InstallBlenderExporterPanel.jLabel4.text=http://www.python.org/download/releases/2.6/
+InstallBlenderExporterPanel.jLabel2.text=Note that this exporter only works
+InstallBlenderExporterPanel.jLabel3.text=with Blender 2.59+!

+ 1 - 18
jme3-ogretools/src/com/jme3/gde/ogretools/blender/InstallBlenderExporterPanel.form

@@ -38,7 +38,6 @@
                       <Component id="jButton2" min="-2" max="-2" attributes="0"/>
                   </Group>
                   <Component id="jLabel3" alignment="1" pref="341" max="32767" attributes="0"/>
-                  <Component id="jLabel4" alignment="0" pref="341" max="32767" attributes="0"/>
               </Group>
               <EmptySpace max="-2" attributes="0"/>
           </Group>
@@ -58,9 +57,7 @@
               <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
-              <EmptySpace type="unrelated" max="-2" attributes="0"/>
-              <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
-              <EmptySpace pref="15" max="32767" attributes="0"/>
+              <EmptySpace pref="45" max="32767" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
                   <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -134,19 +131,5 @@
         </Property>
       </Properties>
     </Component>
-    <Component class="javax.swing.JLabel" name="jLabel4">
-      <Properties>
-        <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
-          <Color blue="ff" green="33" red="0" type="rgb"/>
-        </Property>
-        <Property name="horizontalAlignment" type="int" value="0"/>
-        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString bundle="com/jme3/gde/ogretools/blender/Bundle.properties" key="InstallBlenderExporterPanel.jLabel4.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
-        </Property>
-      </Properties>
-      <Events>
-        <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="openBrowser"/>
-      </Events>
-    </Component>
   </SubComponents>
 </Form>

+ 64 - 81
jme3-ogretools/src/com/jme3/gde/ogretools/blender/InstallBlenderExporterPanel.java

@@ -47,68 +47,68 @@ public class InstallBlenderExporterPanel extends javax.swing.JDialog {
     }
 
     private String findBlenderFolder() {
-        if (Utilities.isMac()) {
-            File scriptsDir = new File(System.getProperty("user.home") + "/.blender/scripts/");
-            if (!scriptsDir.exists()) {
-                scriptsDir = new File("/Applications/blender.app/Contents/Resources/MacOS/.blender/scripts/");
-                if (!scriptsDir.exists()) {
-                    scriptsDir = new File(System.getProperty("user.home") + "/Applications/blender.app/Contents/Resources/MacOS/.blender/scripts/");
-                    if (!scriptsDir.exists()) {
-                        scriptsDir = new File("/Applications/blender/blender.app/Contents/Resources/MacOS/.blender/scripts/");
-                    }
-                }
-            }
-            if (!scriptsDir.exists()) {
-                FileChooserBuilder builder = new FileChooserBuilder("/Applications/");
-                builder.setDirectoriesOnly(true);
-                builder.setTitle("Select Blender.app Application");
-                File file = builder.showOpenDialog();
-                if (file != null) {
-                    scriptsDir = new File(file.getPath() + "/Contents/Resources/MacOS/.blender/scripts/");
-                }
-                return scriptsDir.getPath();
-            } else {
-                return scriptsDir.getPath();
-            }
-        } else if (Utilities.isUnix()) {
-            File scriptsDir = new File("/usr/share/blender/");
-            if (!scriptsDir.exists()) {
-                scriptsDir = new File("/usr/lib/blender/");
-            }
-            if (!scriptsDir.exists()) {
-                FileChooserBuilder builder = new FileChooserBuilder("");
-                builder.setDirectoriesOnly(true);
-                builder.setTitle("Select Blender Scripts Directory");
-                File file = builder.showOpenDialog();
-                if (file != null) {
-                    scriptsDir = file;
-                }
-                return scriptsDir.getPath();
-            } else {
-                return scriptsDir.getPath();
-            }
-        } else if (Utilities.isWindows()) {
-            File scriptsDir = new File(System.getProperty("user.home") + "\\AppData\\Roaming\\Blender Foundation\\Blender\\scripts\\");
-            if (!scriptsDir.exists()) {
-                scriptsDir = new File(System.getProperty("user.home") + "\\Application Data\\Roaming\\Blender Foundation\\Blender\\scripts\\");
-                if (!scriptsDir.exists()) {
-                    scriptsDir = new File(System.getProperty("user.home") + "C:\\Program Files\\Blender\\.blender\\scripts\\");
-                }
-            }
-            if (!scriptsDir.exists()) {
-                FileChooserBuilder builder = new FileChooserBuilder("");
-                builder.setDirectoriesOnly(true);
-                builder.setTitle("Select Blender Scripts Directory");
-                File file = builder.showOpenDialog();
-                if (file != null) {
-                    scriptsDir = file;
-                }
-                return scriptsDir.getPath();
-            } else {
-                return scriptsDir.getPath();
-            }
-        }
-        return "could not find path";
+//        if (Utilities.isMac()) {
+//            File scriptsDir = new File(System.getProperty("user.home") + "/.blender/scripts/");
+//            if (!scriptsDir.exists()) {
+//                scriptsDir = new File("/Applications/blender.app/Contents/Resources/MacOS/.blender/scripts/");
+//                if (!scriptsDir.exists()) {
+//                    scriptsDir = new File(System.getProperty("user.home") + "/Applications/blender.app/Contents/Resources/MacOS/.blender/scripts/");
+//                    if (!scriptsDir.exists()) {
+//                        scriptsDir = new File("/Applications/blender/blender.app/Contents/Resources/MacOS/.blender/scripts/");
+//                    }
+//                }
+//            }
+//            if (!scriptsDir.exists()) {
+//                FileChooserBuilder builder = new FileChooserBuilder("/Applications/");
+//                builder.setDirectoriesOnly(true);
+//                builder.setTitle("Select Blender.app Application");
+//                File file = builder.showOpenDialog();
+//                if (file != null) {
+//                    scriptsDir = new File(file.getPath() + "/Contents/Resources/MacOS/.blender/scripts/");
+//                }
+//                return scriptsDir.getPath();
+//            } else {
+//                return scriptsDir.getPath();
+//            }
+//        } else if (Utilities.isUnix()) {
+//            File scriptsDir = new File("/usr/share/blender/");
+//            if (!scriptsDir.exists()) {
+//                scriptsDir = new File("/usr/lib/blender/");
+//            }
+//            if (!scriptsDir.exists()) {
+//                FileChooserBuilder builder = new FileChooserBuilder("");
+//                builder.setDirectoriesOnly(true);
+//                builder.setTitle("Select Blender Scripts Directory");
+//                File file = builder.showOpenDialog();
+//                if (file != null) {
+//                    scriptsDir = file;
+//                }
+//                return scriptsDir.getPath();
+//            } else {
+//                return scriptsDir.getPath();
+//            }
+//        } else if (Utilities.isWindows()) {
+//            File scriptsDir = new File(System.getProperty("user.home") + "\\AppData\\Roaming\\Blender Foundation\\Blender\\scripts\\");
+//            if (!scriptsDir.exists()) {
+//                scriptsDir = new File(System.getProperty("user.home") + "\\Application Data\\Roaming\\Blender Foundation\\Blender\\scripts\\");
+//                if (!scriptsDir.exists()) {
+//                    scriptsDir = new File(System.getProperty("user.home") + "C:\\Program Files\\Blender\\.blender\\scripts\\");
+//                }
+//            }
+//            if (!scriptsDir.exists()) {
+//                FileChooserBuilder builder = new FileChooserBuilder("");
+//                builder.setDirectoriesOnly(true);
+//                builder.setTitle("Select Blender Scripts Directory");
+//                File file = builder.showOpenDialog();
+//                if (file != null) {
+//                    scriptsDir = file;
+//                }
+//                return scriptsDir.getPath();
+//            } else {
+//                return scriptsDir.getPath();
+//            }
+//        }
+        return "please set blender scripts folder";
     }
     static final int BUFFER = 2048;
 
@@ -297,7 +297,6 @@ public class InstallBlenderExporterPanel extends javax.swing.JDialog {
         jButton3 = new javax.swing.JButton();
         jLabel2 = new javax.swing.JLabel();
         jLabel3 = new javax.swing.JLabel();
-        jLabel4 = new javax.swing.JLabel();
 
         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
 
@@ -333,15 +332,6 @@ public class InstallBlenderExporterPanel extends javax.swing.JDialog {
         jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
         jLabel3.setText(org.openide.util.NbBundle.getMessage(InstallBlenderExporterPanel.class, "InstallBlenderExporterPanel.jLabel3.text")); // NOI18N
 
-        jLabel4.setForeground(new java.awt.Color(0, 51, 255));
-        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
-        jLabel4.setText(org.openide.util.NbBundle.getMessage(InstallBlenderExporterPanel.class, "InstallBlenderExporterPanel.jLabel4.text")); // NOI18N
-        jLabel4.addMouseListener(new java.awt.event.MouseAdapter() {
-            public void mouseReleased(java.awt.event.MouseEvent evt) {
-                openBrowser(evt);
-            }
-        });
-
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
         getContentPane().setLayout(layout);
         layout.setHorizontalGroup(
@@ -359,8 +349,7 @@ public class InstallBlenderExporterPanel extends javax.swing.JDialog {
                         .addComponent(jButton3)
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                         .addComponent(jButton2))
-                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
-                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE))
+                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE))
                 .addContainerGap())
         );
         layout.setVerticalGroup(
@@ -376,9 +365,7 @@ public class InstallBlenderExporterPanel extends javax.swing.JDialog {
                 .addComponent(jLabel2)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jLabel3)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
-                .addComponent(jLabel4)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(jButton2)
                     .addComponent(jButton3))
@@ -406,9 +393,6 @@ public class InstallBlenderExporterPanel extends javax.swing.JDialog {
         dispose();
     }//GEN-LAST:event_jButton3ActionPerformed
 
-    private void openBrowser(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openBrowser
-        openURL("http://www.python.org/download/releases/2.6/");
-    }//GEN-LAST:event_openBrowser
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JButton jButton1;
     private javax.swing.JButton jButton2;
@@ -416,7 +400,6 @@ public class InstallBlenderExporterPanel extends javax.swing.JDialog {
     private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel2;
     private javax.swing.JLabel jLabel3;
-    private javax.swing.JLabel jLabel4;
     private javax.swing.JTextField jTextField1;
     // End of variables declaration//GEN-END:variables
 }

BIN
jme3-ogretools/src/com/jme3/gde/ogretools/blender/scripts.zip