Some 3DS import operations, including the items not included in the modifier,

Source: Internet
Author: User

-- Utility threedeeesimporter "Import 3DS sequence"

Rolout rol_uvrandomrotate "UV rotate" --- borrow the header
(
--- Import the 3DS format.
 
--- How to import warrants
 
Bitmap logo filename: "mondolabs.bmp" -- the image shows nothing. It's just an explanation.
Local objbasename = "3 dsobj" -- display the name.
Button doit "import"
On doit pressed do
(
Objlist = for o in objects collect o -- the current collection is for future deletion.

If objlist! = # () Then
(
Queryresult = querybox "this process will clear your current scene. \ Ndo you want to continue? "Title:" Are you sure? "
)
If queryresult then
(
Delete objlist
Loadfilename = getopenfilename caption: "Import 3DS sequence" types: "3DS (*. 3DS) | *. 3DS"
--- Return a pick-up path. The main UI structure is above this.


If (loadfilename! = Undefined) then
(
-- If it is good, it is to import some information.

Local morphlist = #()
Mypath = (getfilenamepath loadfilename) ---- receiving path
Basename = (getfilenamefile loadfilename) -- receive the name
Basename = substring basename 1 (basename. Count-5 )--? What are some unreasonable characters to intercept ??
Filelist = getfiles (mypath + basename + "*. *") ---- finds all paths globally.
--- In fact, I used to have

Importfile filelist [1] # noprompt --- D is to import this file.
Local objectcount = 1
Local nongeometrylist = #()

---- Do things in the imported file.
For o in objects do
(
If (iskindof o geometryclass) then -- (iskindof o geometryclass) determines whether a node is a class.
-- Very important.
(
O. Name = objbasename + (objectcount as string) -- batch name.
Morphlist = append morphlist (createmorphobject O)
--- I don't know why.
--- Neither //?? In research

-- Add the array in a loop, but it's good not to loop to the following. Otherwise, it's always bad for me to get morphlist.
Objectcount + = 1
) Else
(
Nongeometrylist = append nongeometrylist o --- add a nongeometrylist directly if it is not a ry.
)
)
Delete nongeometrylist --- delete a thing that is not a ry. -- What is this/
For I = 2 to filelist. Count do
(
Nongeometrylist = #()
Local newobjects = #()
Importfile filelist [I] # noprompt
For o in objects do
(
If (findstring O. Name objbasename) = undefined then
(
If (iskindof o geometryclass) then
(
Newobjects = append newobjects o
) Else
(
Nongeometrylist = append nongeometrylist o
)
)
)
Delete nongeometrylist
Objectcount = 1
For o in newobjects do
(
If (morphlist. Count> 0) then
(
At time I
(
Animate on (morphlist [objectcount]. Transform = O. Transform)
)
Addmorphtarget morphlist [objectcount]. Morph O 3
Objectcount + = 1
)
)
) -- If there is only one, this will not be executed at all.




For I = 1 to filelist. Count do --- what are the three loops. ---- It seems that the material is automatically assigned.
(
For o in objects do
(
If (iskindof o geometryclass) then
(
Addnewkey O. morph I
For j = 1 to I do
(
If J = I then
Setmkweight (O. Morph. Keys [I]) J 100 true --- this effect is set to display % better than the effect.
Else
Setmkweight (O. Morph. Keys [I]) j 0 true
)
)
)
)
)
)
)
)

--- Delete the imported 3DS format if it is not a collection class. Some are not displayed.

Createdialog rol_uvrandomrotate

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.