亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? macro_baketextures.mcr

?? 3dmax導(dǎo)出3d模型二次開發(fā)插件
?? MCR
?? 第 1 頁 / 共 5 頁
字號:
Macroscript BakeDialog
ButtonText:"Render To Texture..."
category:"Render"
internalcategory: "Render" 
toolTip:"Render to Texture..."

---------------------------------------------------------------------------
--
--	Render to Texture Dialog
--	2/06/02
--	Kells Elmquist, discreet3d
--
--
--
(

-- these control behaviour of the dialog, change these statically
local allowControlDisable = false

-- these are the globals
global gTextureBakeDialog			-- the shell holds one instance of each of the other rolloups
global gTextureBakeOverwriteFilesOk	-- 0 == no overWrite, 1 == ok to overwrite, 2 == ok & not again

-- one time init on new session....
if gTextureBakeOverwriteFilesOk == undefined then
	gTextureBakeOverwriteFilesOk = 0

local  commonBakeProps 
local  selectedObjectProps
local  uniqueElementProps		-- constructed for each element w/ unique parameters

-- this will hold the list of objects to bake
local ObjList = #()
local selectedObjects = #()
local selectedElement 
local selectedElementIndex = 0
local allowSelectionUpdates = true 
local commonElements = #( #(), #(), #(), #(), #(), #(), #(), #(), \
							#(), #(), #(), #(), #(), #(), #(), #()  )
local	isCancel = false
local	defaultFileType = ".tga"
local   curFrameString = "0000"			-- filename fragment for sequences
local	curBM = undefined

local	sequenceStart
local   sequenceEnd

local 	overwriteFileName = ""

local	updateFileNames = #()
local	newFileLoaded = false
local   initialRender = true

------------------------------------------------------------------------
--
-- persistant dialog size & position
--
local   pDialogHeight
local   pDialogPos
local   pCommonRolledUp
local   pSelectedRolledUp
local   pUniqueRolledUp

-----------------------------------------------------------------------------------------
--
--	this section allows any generated bake map to be baked to any material map channel
--
local   stdTextures = #( "ambientMap", "diffuseMap",  "specularMap", "diffuseLevelMap", \
				"specularLevelMap", "glossinessMap", "selfIllumMap", "opacityMap", "filterMap", \
				"bumpMap", "reflectionMap", "refractionMap", "displacementMap", "diffuseRoughnessMap", \
				"anisotropyMap", "orientationMap", "glossinessMap2", "anisotropyMap2", "orientationMap2" )
local   pbmTextures = #( "ambientMap", "diffuseMap",  "specularMap", \
				"specularLevelMap", "glossinessMap", "selfIllumMap", "opacityMap", "filterMap", \
				"bumpMap", "reflectionMap", "refractionMap", "displacementMap"  )
local   anisoTextures = #( "ambientMap", "diffuseMap",  "specularMap", "diffuseLevelMap", \
				"specularLevelMap", "glossinessMap", "selfIllumMap", "opacityMap", "filterMap", \
				"bumpMap", "reflectionMap", "refractionMap", "displacementMap", "diffuseRoughnessMap", \
				"anisotropyMap", "orientationMap" )
local   onbTextures = #( "ambientMap", "diffuseMap",  "specularMap", "diffuseLevelMap", \
				"specularLevelMap", "glossinessMap", "selfIllumMap", "opacityMap", "filterMap", \
				"bumpMap", "reflectionMap", "refractionMap", "displacementMap", "diffuseRoughnessMap" )
local   straussTextures = #( "diffuseMap",  "glossinessMap", "metalnessMap", "opacityMap", "filterMap", \
				"bumpMap", "reflectionMap", "refractionMap", "displacementMap" )


-- these are set up by the selected bake material mappings ini file
local   bakeTextures = #( "","","","",  "","","","",  "","","","",  "","","","",  "","","","" )

-- these are the sections of the ini file
local 	numMaxFileMappings = 20
local	fileMappings = #( "", "", "", "", "", "", "" , "", "", "", "" )
local	useShader = "blinn"
local	hwShaders = #( "", "", "" )
local	useHWShader = 0

--------------------------------------------------------------------
--
--	hardware shaders
-- 	change these if the official names of these shaders changes
--
-- local	generalHWShaderName = "Material Shader"
local	generalHWShaderName = "Metal Bump"
local	lightMapHWShaderName = "LightMap"

--------------------------------------------------------------------------
--
--	ini files
--
-- this is the default ini file for the file mappings
local	bakeMtlMappingsIniFile = "$plugcfg/BakeTextureMappings.ini"

-- this is the dialog state ini file, holds persistent dialog state
local 	iniFile = "$plugcfg/BakeTexture.ini"

----------------------------------------------------------------------------

-- this function is used everywhere to determine if an object can be baked
fn objectIsBakable _obj =
(
	local isBakable = (superclassof _obj == geometryClass) \
			and (classof _obj != Spray ) \ 
			and (classof _obj != SuperSpray ) \ 
			and (classof _obj != PCloud ) \ 
			and (classof _obj != PArray ) \ 
			and (classof _obj != Snow ) \ 
			and (classof _obj != Blizzard ) \ 
			and (classof _obj != Targetobject ) \
			and ( _obj.isHidden == false )

	--format "superClass = %, class = %, isBakable = % \n" (superclassof _obj)(classof _obj)(isBakable)
			
	return isBakable
)

-- the unwrapper returns 0 for channel 1 (0,2,3..) for strange historical reasons
fn getMapChannel _unwrapMod =
(
	local n = _unwrapMod.getMapChannel()
	return if( n == 0 ) then 1 else n
)	

-- function to delete the autoFlattener on an object
fn deleteAutoFlatten _obj =
(
	-- test each modifier on the object
	unwrapMod = undefined
	for nMod = 1 to _obj.modifiers.count do
	(
		-- get the next modifier
		unwrapMod = _obj.modifiers[ nMod ]
		
		if (classof unwrapMod as string) == "Unwrap_UVW" then
		(
			-- it's an unwrap modifier, 
			if unwrapMod.name == "Automatic Flatten UVs" then
			(
				--format "removing auto unwrapper: % \n" unwrapMod.name
				deleteModifier( _obj )( unwrapMod )
			)
		) -- end, it's an unwrapper
	) -- end, for each modifier
)

fn deleteBakeMaterial _curObj =
(
		-- if the material is a shell material, lose it
		materialType = (classof _curObj.material as string)
		-- format "material type = %\n" materialType
		
		if (materialType == "Shell_Material") then
		(
			--format "remove bake material on %\n" (curObj as string)
			origMaterial = _curObj.material.originalMaterial 
			_curObj.material.originalMaterial = undefined
			_curObj.material.bakedMaterial = undefined
		
			_curObj.material = origMaterial
			
		) -- end, has shell material
)


---------------------------------------------------------------------------
--
--	Function to auto-flatten the objects from a list
--
function batchFlatten _ObjectList =
(
undo on
(	
	if commonBakeProps.cAutoFlattenOn.checked then
	(
		--format 	"flatten % objects \n" (_ObjectList.count)
		
		-- first put up the progress dialog
		rollout flattenProgress "Progress..." width:183 height:46
		(
			label lbl1 "Flattening UV's..."
				pos:[48,5] width:94 height:21
			progressBar pb1 "" 
				pos:[5,21] width:174 height:17
		)
		createdialog flattenProgress  		-- style:#(#style_border,#style_toolwindow)
		local progressScale = 100 / (_ObjectList.count + 1)
		flattenProgress.pb1.value = progressScale 
	
		-- why is this here? must be in modify mode to use flatten operator
		max modify mode
			
		with redraw off (
		
		-- for each object...
		local nObj = 0
		for curObj in _ObjectList do
		(
			nObj += 1
			local skipObject = false
			if (curObj.effectiveEnable() == false ) or (objectIsBakable( curObj ) == false) then
			(
				--format "ignoring object: % \n" (classof curObj as string)
				continue
			)
			
			restoreToGroup = false
			if isGroupMember( curObj ) then
			(
				setGroupMember( curObj )( false )		
				restoreToGroup = true
			)
			-- select the object to apply flatten operator
			select( curObj )
			
-->>>>>>>>>
			-- get rid of sub-object selections
--			local hasSubObjectSelections = false
			local curClass = (classof curObj as string) 
			--format "object class = % \n" curClass
			
			if (curClass == "Editable_Patch") or ( curClass == "quadPatch") or (curClass == "triPatch") then
				messageBox "Editable patch objects not currently supported for flattening and may produce poor results."
				
--			if (curClass == "Editable_mesh") or (curClass == "Editable_poly") then
--			(
--				objSelections = getFaceSelection( curObj )
--				format "undo subobject selection: % \n"	(objSelections as string)
--				setFaceSelection( curObj )( #() )
--				hasSubObjectSelections = true
--			)
			
			unwrapMod = undefined
			hasModifier = false
			-- test each modifier on the object
			for nMod = 1 to curObj.modifiers.count do
			(
				-- get the next modifier
				unwrapMod = curObj.modifiers[ nMod ]
				
				--format "modifier class = % \n" (classof unwrapMod as string)
				if (classof unwrapMod as string) == "Unwrap_UVW" then
				(
					---format "class Unwrap_UVW\n"
					
					-- it's an unwrap modifier, 
					if unwrapMod.name == "Automatic Flatten UVs" then
					(
						--format "has auto unwrapper: % \n" unwrapMod.name
				
						-- If force re flatten is on and the object has the right modifiers, 
						hasModifier = true
						
						-- compare against previous global settings for changes
						--format "channel= %, angle = %, spacing = %,   normalize = % rotate = %, fill = %, newFile = % \n" \
						--	(unwrapMod.getMapChannel())(unwrapMod.getFlattenAngle())(unwrapMod.getFlattenSpacing()) \
						--	(unwrapMod.getFlattenNormalize())(unwrapMod.getFlattenRotate())(unwrapMod.getFlattenFillHoles())(newFileLoaded)

						--format "mod channel= %, obj channel = %\n" (unwrapMod.getMapChannel())(curObj.bakeChannel)

						-- the baked material has bad uv coords if these dont match
						if ( getMapChannel( unwrapMod ) != curObj.bakeChannel ) then
						(
							deleteBakeMaterial( curObj )
						)

						if ( unwrapMod.getPreventFlattening() == false ) \
							and( newFileLoaded \
							or ( getMapChannel( unwrapMod ) != curObj.bakeChannel )\
							or ( unwrapMod.getFlattenAngle() != commonBakeProps.sThresholdAngle.value ) \
							or ( unwrapMod.getFlattenSpacing() != commonBakeProps.sSpacing.value ) \
							or ( unwrapMod.getFlattenRotate() != commonBakeProps.cRotate.checked ) \
							or ( unwrapMod.getFlattenFillHoles() != commonBakeProps.cFillHoles.checked ) ) then
						(
							--format "Update unwrap_uvw\n"
							
							deleteAutoFlatten( curObj )
							deleteBakeMaterial( curObj )
							hasModifier = false		-- force new modifier
							
							/* update doesnt work when you change channels for some reason. 9/5/02
							format "curChannel= % \n" (unwrapMod.getMapChannel())
							unwrapMod.setMapChannel( curObj.bakeChannel )
							unwrapMod.setFlattenAngle( commonBakeProps.sThresholdAngle.value )
							unwrapMod.setFlattenSpacing( commonBakeProps.sSpacing.value )
							unwrapMod.setFlattenNormalize( true )
							unwrapMod.setFlattenRotate( commonBakeProps.cRotate.checked )
							unwrapMod.setFlattenFillHoles( commonBakeProps.cFillHoles.checked )
							
							unwrapMod.flattenMap \
								commonBakeProps.sThresholdAngle.value \
								#([1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]) \
						    	commonBakeProps.sSpacing.value \
								true \
								2 \
								commonBakeProps.cRotate.checked \
								commonBakeProps.cFillHoles.checked
							*/	
						) -- end, unwrapper not locked
						else (
							--format "no change in object: % \n" (curObj as string)
						)

					) -- end, has autoflatten unwrapper
					else if ( getMapChannel( unwrapMod ) == curObj.bakeChannel ) then
					(
						-- channel match, it's a user unwrapper for this obj, leave it alone
						--format "non-automatic unwrapper found with matching channel\n"
						hasModifier = true
					) else (
						--format "non-automatic unwrapper found with un-matched channel= % \n" (unwrapMod.getMapChannel())
					)	
				) -- end, is unwrap modifier
				else (
					--format "object class = %\n" (classof unwrapMod as string)
					if (classof unwrapMod as string) == "Uvwmap" then
--						or (classof unwrapMod as string) == "UVW_Xform" then
					(
						--format "is uvwmap\n"
						-- potential mapping channel conflict
						mapChan = unwrapMod.mapChannel
						if mapChan == 0 then mapChan = 1
						if( mapChan == curObj.bakeChannel ) then (
							messageBox "Map Channel in UVW_Mapping modifier conflicts with the channel specified for render to texture. Select a different render to texture channel."
							skipObject = true
							curObj.nDilations = if curObj.nDilations == 0 then -100 else -curObj.nDilations
						)
					)
				)

			)-- end, for each modifier
			
			
			-- If the object doesn't have a modifier applied, create one and flatten it
			if (hasModifier == false) and objectIsBakable( curObj ) and (skipObject == false ) then
			(
				-- create a new autoflatten unwrapper
				--format "Create new unwrap_uvw\n"
				unwrapMod = unwrap_UVW()
				
				unwrapMod.setAlwaysEdit ( false )
				unwrapMod.setMapChannel ( curObj.bakeChannel )
				unwrapMod.setFlattenAngle ( commonBakeProps.sThresholdAngle.value )
				unwrapMod.setFlattenSpacing( commonBakeProps.sSpacing.value )
				--unwrapMod.setFlattenNormalize( commonBakeProps.cNormalize.checked )
				unwrapMod.setFlattenNormalize( true )
				unwrapMod.setFlattenRotate( commonBakeProps.cRotate.checked )
				unwrapMod.setFlattenFillHoles( commonBakeProps.cFillHoles.checked )
				unwrapMod.setApplyToWholeObject( true )
				unwrapMod.name = "Automatic Flatten UVs"
				
				-- add it to the object
				-- add directly to the object to avoid groupness
				undo on (
					addModifier( curObj )( unwrapMod )
				)
				
				--	#([1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]) \
				--	#([0,0,1],[0,0,-1]) \
				--		2 \
			-- & flatten things
				unwrapMod.flattenMap \
					commonBakeProps.sThresholdAngle.value \
					#([1,0,0],[-1,0,0], [0,1,0],[0,-1,0], [0,0,1],[0,0,-1]) \
					commonBakeProps.sSpacing.value \
					true \
					2 \
					commonBakeProps.cRotate.checked \
					commonBakeProps.cFillHoles.checked
				-- or use instead of true: commonBakeProps.cNormalize.checked \
				
			) -- end, create new unwrapper
			
			-- if it was in a group put it back
			if restoreToGroup then
				setGroupMember( curObj )( true )
				
--			if( hasSubObjectSelections == true ) then
--				setFaceSelection( curObj )(objSelections)

			-- update the progress bar
			flattenProgress.pb1.value = progressScale * (nObj + 1)
						
		) -- end, for each object
		
		) -- end, with redrawOff
		
		-- Auto Flatten endgame
		destroydialog flattenProgress
		
	) -- end, not already flattenned
	
	-- move to caller: newFileLoaded = false	-- reset the new file switch
)	
) --end, function autoflatten


-----------------------------------------------------------------------
--
--	utility function to find elements by class name, returns index or 0
--
function findByClass	_obj	_className =
(
	for i = 1 to _obj.NumBakeElements() do
	(

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品免费av| 国产盗摄女厕一区二区三区 | 亚洲国产一区视频| 91色视频在线| 最新国产精品久久精品| 91久久精品网| 日韩激情在线观看| 日韩一区二区在线播放| 天堂影院一区二区| 久久九九久久九九| 99久久精品国产导航| 夜夜嗨av一区二区三区中文字幕| 在线不卡一区二区| 国产自产视频一区二区三区| 久久蜜桃香蕉精品一区二区三区| 色伊人久久综合中文字幕| 久久精品国产精品亚洲精品| 国产亚洲福利社区一区| 欧美在线观看一区| 国产精品一色哟哟哟| 亚洲色图在线看| 欧美日韩视频在线观看一区二区三区| 日日夜夜免费精品视频| 国产精品一区二区果冻传媒| 亚洲综合一区在线| 国产精品欧美经典| 欧美日韩成人综合| 色综合久久久久综合体| 国产成人综合网| 日韩亚洲国产中文字幕欧美| 欧亚洲嫩模精品一区三区| 高清不卡一二三区| 夜夜揉揉日日人人青青一国产精品 | 亚洲欧美日韩在线不卡| 精品国精品国产| 欧美视频日韩视频| 91蝌蚪porny九色| 国产91丝袜在线播放九色| 一区二区三区蜜桃网| 国产精品另类一区| 欧美激情在线看| 精品卡一卡二卡三卡四在线| 欧美二区三区的天堂| 91国偷自产一区二区使用方法| 成人免费毛片a| 国产精品伊人色| 国产suv一区二区三区88区| 国产综合久久久久久鬼色| 日韩精品成人一区二区三区| 日韩中文字幕区一区有砖一区 | 欧美三级韩国三级日本一级| 色久综合一二码| 欧美色图12p| 精品视频123区在线观看| 欧美日韩亚洲另类| 日韩视频在线你懂得| 4hu四虎永久在线影院成人| 欧美高清www午色夜在线视频| 欧美日韩二区三区| 国产精品一区三区| 99久久99久久精品免费看蜜桃| 91一区在线观看| 精品一二三四在线| 韩国av一区二区三区四区| 福利91精品一区二区三区| aaa欧美日韩| 欧美精品亚洲二区| 久久综合色天天久久综合图片| 国产精品丝袜在线| 亚洲国产日韩一区二区| 美女视频网站久久| www.日韩大片| 欧美日韩一二区| 国产拍欧美日韩视频二区| 中文字幕av一区二区三区免费看| 日本一区二区在线不卡| 亚洲乱码国产乱码精品精小说| 一区二区三区产品免费精品久久75| 亚洲高清不卡在线观看| 麻豆精品一区二区综合av| 99麻豆久久久国产精品免费优播| 欧美日韩免费一区二区三区| 久久伊人中文字幕| 亚洲h在线观看| 99久久99久久免费精品蜜臀| 久久精品亚洲乱码伦伦中文| 亚洲午夜免费视频| 国产高清不卡一区| 欧美日韩国产小视频在线观看| 国产亚洲短视频| 三级欧美韩日大片在线看| 91污片在线观看| 26uuu另类欧美| 久久精品国产在热久久| 欧美三区在线观看| 有坂深雪av一区二区精品| 国产精品99久久久久久久vr| 3d动漫精品啪啪| 一区二区三区在线观看国产| 国产综合久久久久久鬼色 | 日韩精品在线网站| 日韩电影在线免费| 欧美日韩你懂得| 一区二区三区.www| 91色在线porny| 亚洲精品视频自拍| 一本一道久久a久久精品 | 亚洲精品成人悠悠色影视| 成人性生交大合| 中文字幕在线观看不卡视频| 成人午夜精品在线| 亚洲婷婷国产精品电影人久久| 成人黄色电影在线| 7777女厕盗摄久久久| 日精品一区二区| 日韩一级高清毛片| 国产精品视频在线看| 成人国产精品免费观看视频| 国产精品国产三级国产普通话99| 成人高清av在线| 日韩美女啊v在线免费观看| 成人午夜在线播放| 亚洲欧美一区二区三区国产精品| 91免费在线视频观看| 亚洲成av人片| 精品久久五月天| 国产乱国产乱300精品| 中文字幕一区二区三区乱码在线| 在线欧美一区二区| 蜜桃一区二区三区在线观看| 99久久er热在这里只有精品66| 亚洲成人资源在线| 日韩一本二本av| 91污片在线观看| 日日摸夜夜添夜夜添亚洲女人| 欧美国产一区二区在线观看| 欧美在线一区二区三区| 国产成人精品三级| 精品国产一区二区精华| 色综合色狠狠综合色| 日本欧美在线观看| 亚洲日本中文字幕区| 精品少妇一区二区三区| 精品视频在线看| 色综合久久综合中文综合网| 色婷婷久久99综合精品jk白丝 | 国产亚洲精品aa午夜观看| 日韩欧美一区二区不卡| 欧美疯狂做受xxxx富婆| 欧洲一区在线电影| 成人18视频在线播放| 裸体歌舞表演一区二区| 蜜臀av国产精品久久久久| 日本一不卡视频| 伊人婷婷欧美激情| 欧美视频一区二区在线观看| 色先锋资源久久综合| 国产suv精品一区二区883| 国产成人高清在线| 国产精品资源在线观看| 91视频xxxx| 成人永久免费视频| 国产美女精品人人做人人爽| 免费人成黄页网站在线一区二区| www国产精品av| 精品999在线播放| 精品国内二区三区| 中文字幕乱码久久午夜不卡| 亚洲色图欧洲色图婷婷| 国产精品短视频| 香蕉久久夜色精品国产使用方法| 免费看欧美女人艹b| 国产乱理伦片在线观看夜一区| 亚洲一区二区三区自拍| 天天综合网天天综合色| 久久国产乱子精品免费女| 国产精品一二三在| 欧洲一区在线观看| 日韩精品影音先锋| 久久婷婷成人综合色| 国产精品免费观看视频| 一区二区不卡在线播放| 性欧美疯狂xxxxbbbb| 精品中文av资源站在线观看| 欧美一区二区大片| 欧美白人最猛性xxxxx69交| 欧美精品一区二区三区在线播放 | 亚洲特级片在线| 免费高清在线视频一区·| 国产suv精品一区二区6| 精品视频999| 国产精品理伦片| 免费在线观看一区| 99精品久久免费看蜜臀剧情介绍| 日本高清无吗v一区| 精品国产免费一区二区三区香蕉| 亚洲柠檬福利资源导航| 韩国理伦片一区二区三区在线播放 | 国产成人av影院| 欧美丝袜丝交足nylons|