فهرست منبع

Merge branch 'dev' into patch-1

Conflicts:
	utils/converters/obj/convert_obj_three.py
Ted Cipicchio 11 سال پیش
والد
کامیت
d1dca3d0e2
4فایلهای تغییر یافته به همراه38 افزوده شده و 2 حذف شده
  1. 10 0
      src/core/Object3D.js
  2. 7 0
      utils/build/build.js
  3. 7 2
      utils/build/build.py
  4. 14 0
      utils/converters/obj/convert_obj_three.py

+ 10 - 0
src/core/Object3D.js

@@ -353,6 +353,16 @@ THREE.Object3D.prototype = {
 
 
 	remove: function ( object ) {
 	remove: function ( object ) {
 
 
+		if ( arguments.length > 1 ) {
+
+			for ( var i = 0; i < arguments.length; i++ ) {
+
+				this.remove( arguments[ i ] );
+
+			}
+
+		};
+
 		var index = this.children.indexOf( object );
 		var index = this.children.indexOf( object );
 
 
 		if ( index !== - 1 ) {
 		if ( index !== - 1 ) {

+ 7 - 0
utils/build/build.js

@@ -34,6 +34,9 @@ function main() {
 
 
 	var buffer = [];
 	var buffer = [];
 	var sources = [];
 	var sources = [];
+		
+	buffer.push('// You shouldn\'t edit this build file. \n');
+	buffer.push('// The following source code is build from the src folder. \n');
 	
 	
 	if ( args.amd ){
 	if ( args.amd ){
 		buffer.push('function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( [ \'exports\' ], factory );\n\n\t} else if ( typeof exports === \'object\' ) {\n\n\t\tfactory( exports );\n\n\t} else {\n\n\t\tfactory( root );\n\n\t}\n\n}( this, function ( exports ) {\n\n');
 		buffer.push('function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( [ \'exports\' ], factory );\n\n\t} else if ( typeof exports === \'object\' ) {\n\n\t\tfactory( exports );\n\n\t} else {\n\n\t\tfactory( root );\n\n\t}\n\n}( this, function ( exports ) {\n\n');
@@ -47,8 +50,12 @@ function main() {
 		for ( var j = 0; j < files.length; j ++ ){
 		for ( var j = 0; j < files.length; j ++ ){
 
 
 			var file = '../../' + files[ j ];
 			var file = '../../' + files[ j ];
+			
 			sources.push( file );
 			sources.push( file );
+			buffer.push('// File:' + files[ j ]);
+			buffer.push('\n\n');
 			buffer.push( fs.readFileSync( file, 'utf8' ) );
 			buffer.push( fs.readFileSync( file, 'utf8' ) );
+			buffer.push('\n');
 
 
 		}
 		}
 
 

+ 7 - 2
utils/build/build.py

@@ -5,7 +5,7 @@ import sys
 if sys.version_info < (2, 7):
 if sys.version_info < (2, 7):
 	print("This script requires at least Python 2.7.")
 	print("This script requires at least Python 2.7.")
 	print("Please, update to a newer version: http://www.python.org/download/releases/")
 	print("Please, update to a newer version: http://www.python.org/download/releases/")
-	exit()
+#	exit()
 
 
 import argparse
 import argparse
 import json
 import json
@@ -44,7 +44,10 @@ def main(argv=None):
 	fd, path = tempfile.mkstemp()
 	fd, path = tempfile.mkstemp()
 	tmp = open(path, 'w')
 	tmp = open(path, 'w')
 	sources = []
 	sources = []
-
+	
+	tmp.write('// You shouldn\'t edit this build file. \n')
+	tmp.write('// The following source code is build from the src folder. \n')
+	
 	if args.amd:
 	if args.amd:
 		tmp.write('( function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( [ \'exports\' ], factory );\n\n\t} else if ( typeof exports === \'object\' ) {\n\n\t\tfactory( exports );\n\n\t} else {\n\n\t\tfactory( root );\n\n\t}\n\n}( this, function ( exports ) {\n\n')
 		tmp.write('( function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( [ \'exports\' ], factory );\n\n\t} else if ( typeof exports === \'object\' ) {\n\n\t\tfactory( exports );\n\n\t} else {\n\n\t\tfactory( root );\n\n\t}\n\n}( this, function ( exports ) {\n\n')
 
 
@@ -52,6 +55,8 @@ def main(argv=None):
 		with open('includes/' + include + '.json','r') as f:
 		with open('includes/' + include + '.json','r') as f:
 			files = json.load(f)
 			files = json.load(f)
 		for filename in files:
 		for filename in files:
+			tmp.write('// File:' + filename)
+			tmp.write('\n\n')
 			filename = '../../' + filename;
 			filename = '../../' + filename;
 			sources.append(filename)
 			sources.append(filename)
 			with open(filename, 'r') as f:
 			with open(filename, 'r') as f:

+ 14 - 0
utils/converters/obj/convert_obj_three.py

@@ -362,7 +362,14 @@ def parse_mtl(fname):
 
 
     materials = {}
     materials = {}
 
 
+    previous_line = ""
     for line in fileinput.input(fname):
     for line in fileinput.input(fname):
+        line = previous_line + line
+        if line[-2:-1] == '\\':
+            previous_line = line[:-2]
+            continue
+        previous_line = ""
+
         # Only split once initially for single-parameter tags that might have additional spaces in
         # Only split once initially for single-parameter tags that might have additional spaces in
         # their values (i.e. "newmtl Material with spaces").
         # their values (i.e. "newmtl Material with spaces").
         chunks = line.split(None, 1)
         chunks = line.split(None, 1)
@@ -514,7 +521,14 @@ def parse_obj(fname):
     object = 0
     object = 0
     smooth = 0
     smooth = 0
 
 
+    previous_line = ""
     for line in fileinput.input(fname):
     for line in fileinput.input(fname):
+        line = previous_line + line
+        if line[-2:-1] == '\\':
+            previous_line = line[:-2]
+            continue
+        previous_line = ""
+
         # Only split once initially for single-parameter tags that might have additional spaces in
         # Only split once initially for single-parameter tags that might have additional spaces in
         # their values (i.e. "usemtl Material with spaces").
         # their values (i.e. "usemtl Material with spaces").
         chunks = line.split(None, 1)
         chunks = line.split(None, 1)