Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2006-12-11 11:57:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2006-12-11 11:57:39 +0300
commit9c3cacd283008c9ac698d8f8f444c733b0fe61ac (patch)
treed5a634ea73ab974c0030f149c2bff36ebda2e27d /release/scripts/3ds_import.py
parentb42d1fe5447c6789361fd7e85d04180854ea6e1f (diff)
added the flag group_exclusive to material
added restrictDraw/Select/Render to objects in python updated group and scene docs for last commit made 3ds import use new scn.objects rather then Object.New() - (removed import as instance for now) fixes off import error from this report http://blenderartists.org/forum/showthread.php?t=84182
Diffstat (limited to 'release/scripts/3ds_import.py')
-rw-r--r--release/scripts/3ds_import.py34
1 files changed, 22 insertions, 12 deletions
diff --git a/release/scripts/3ds_import.py b/release/scripts/3ds_import.py
index 23826e64c82..b8e91234987 100644
--- a/release/scripts/3ds_import.py
+++ b/release/scripts/3ds_import.py
@@ -130,8 +130,13 @@ try:
except:
from sets import Set as set
+#global SCN_OBJECTS
+#SCN_OBJECTS = None
BOUNDS_3DS= []
+
+
+
#this script imports uvcoords as sticky vertex coords
#this parameter enables copying these to face uv coords
#which shold be more useful.
@@ -392,8 +397,10 @@ def process_next_chunk(file, previous_chunk, importedObjects):
tempName= '%s_%s' % (contextObName, matName) # matName may be None.
bmesh.name= tempName
- ob = Object.New('Mesh', tempName)
- ob.link(bmesh)
+ # ob = Object.New('Mesh', tempName)
+ # ob.link(bmesh)
+ ob = SCN_OBJECTS.new(bmesh, tempName)
+
####ob.setMatrix(contextMatrix)
importedObjects.append(ob)
@@ -739,15 +746,15 @@ def process_next_chunk(file, previous_chunk, importedObjects):
putContextMesh(contextMesh_vertls, contextMesh_facels, contextMeshMaterials)
def load_3ds(filename, PREF_UI= True):
+ global FILENAME, SCN_OBJECTS
if BPyMessages.Error_NoFile(filename):
return
- print '\n\nImporting "%s" "%s"' % (filename, Blender.sys.expandpath(filename))
+ print '\n\nImporting 3DS: "%s"' % (Blender.sys.expandpath(filename))
time1= Blender.sys.time()
- global FILENAME
FILENAME=filename
current_chunk=chunk()
@@ -768,7 +775,7 @@ def load_3ds(filename, PREF_UI= True):
# Get USER Options
pup_block= [\
('Size Constraint:', IMPORT_CONSTRAIN_BOUNDS, 0.0, 1000.0, 'Scale the model by 10 until it reacehs the size constraint. Zero Disables.'),\
- ('Group Instance', IMPORT_AS_INSTANCE, 'Import objects into a new scene and group, creating an instance in the current scene.'),\
+ #('Group Instance', IMPORT_AS_INSTANCE, 'Import objects into a new scene and group, creating an instance in the current scene.'),\
]
if PREF_UI:
@@ -782,16 +789,18 @@ def load_3ds(filename, PREF_UI= True):
BOUNDS_3DS[:]= [1<<30, 1<<30, 1<<30, -1<<30, -1<<30, -1<<30]
else:
BOUNDS_3DS[:]= []
-
- importedObjects= [] # Fill this list with objects
- process_next_chunk(file, current_chunk, importedObjects)
scn= Scene.GetCurrent()
- for ob in scn.getChildren():
+ SCN_OBJECTS = scn.objects
+ for ob in SCN_OBJECTS:
ob.sel= 0
+ importedObjects= [] # Fill this list with objects
+ process_next_chunk(file, current_chunk, importedObjects)
+
+
# Link the objects into this scene.
- Layers= scn.Layers
+ # Layers= scn.Layers
# REMOVE DUMMYVERT, - remove this in the next release when blenders internal are fixed.
for ob in importedObjects:
@@ -799,7 +808,7 @@ def load_3ds(filename, PREF_UI= True):
me= ob.getData(mesh=1)
me.verts.delete([me.verts[0],])
# Done DUMMYVERT
-
+ """
if IMPORT_AS_INSTANCE:
name= filename.split('\\')[-1].split('/')[-1]
# Create a group for this import.
@@ -822,6 +831,7 @@ def load_3ds(filename, PREF_UI= True):
scn.link(ob)
ob.Layers= Layers
ob.sel= 1
+ """
if IMPORT_CONSTRAIN_BOUNDS!=0.0:
# Set bounds from objecyt bounding box
@@ -838,7 +848,7 @@ def load_3ds(filename, PREF_UI= True):
# Get the max axis x/y/z
max_axis= max(BOUNDS_3DS[3]-BOUNDS_3DS[0], BOUNDS_3DS[4]-BOUNDS_3DS[1], BOUNDS_3DS[5]-BOUNDS_3DS[2])
- print max_axis
+ # print max_axis
if max_axis < 1<<30: # Should never be false but just make sure.
# Get a new scale factor if set as an option