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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? macro_baketextures.mcr

?? 3dmax導出3d模型二次開發插件
?? 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
	(

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品久久99| 91精品国产综合久久福利软件 | 香蕉久久一区二区不卡无毒影院 | 成人av资源在线观看| 亚洲高清免费在线| 亚洲国产精品成人久久综合一区| 欧美日韩成人综合| 色老综合老女人久久久| 国产美女在线精品| 日本中文字幕不卡| 亚洲一二三四久久| 亚洲欧美日韩在线| 国产日韩欧美一区二区三区综合| 欧美一区二区三区在线电影| 在线视频国产一区| av在线播放成人| 91精品国产欧美日韩| 日本成人在线不卡视频| 亚洲综合激情网| 国产精品私房写真福利视频| 亚洲精品一区二区三区福利| 日韩网站在线看片你懂的| 在线亚洲精品福利网址导航| 91麻豆蜜桃一区二区三区| 大尺度一区二区| 福利一区二区在线| 国产综合色精品一区二区三区| 蜜臀av性久久久久蜜臀av麻豆 | 久久电影网站中文字幕| 日韩黄色免费电影| 图片区小说区区亚洲影院| 亚洲精品国产精华液| 日韩毛片精品高清免费| 一区在线播放视频| 亚洲情趣在线观看| 亚洲欧美日韩中文播放| 亚洲激情校园春色| 一区二区三区在线不卡| 亚洲精品免费电影| 亚洲午夜免费视频| 亚洲国产精品视频| 五月综合激情网| 轻轻草成人在线| 麻豆成人免费电影| 国内偷窥港台综合视频在线播放| 国产美女在线观看一区| 国产精品亚洲综合一区在线观看| 国产乱码精品一区二区三区忘忧草 | 美国av一区二区| 久久91精品国产91久久小草| 国产在线精品一区二区夜色| 成人午夜激情片| 日本高清不卡视频| 欧美精品一级二级三级| 91精品国产美女浴室洗澡无遮挡| 日韩丝袜美女视频| 国产喂奶挤奶一区二区三区| 国产精品伦一区| 亚洲激情综合网| 日本一不卡视频| 国产91富婆露脸刺激对白| 一本久久a久久精品亚洲| 在线看不卡av| 欧美v日韩v国产v| 国产精品国产自产拍高清av | 成人国产精品免费观看| 欧美性生活一区| 日韩一区二区三区视频| 国产亚洲成年网址在线观看| 亚洲精品亚洲人成人网在线播放| 无吗不卡中文字幕| 丰满白嫩尤物一区二区| 欧美视频一区在线| 久久免费午夜影院| 一区二区三区在线观看视频| 蜜桃视频一区二区三区 | 欧美精品日韩一本| 国产拍揄自揄精品视频麻豆| 一级女性全黄久久生活片免费| 久久国产日韩欧美精品| 91丨porny丨户外露出| 欧美一区二区免费观在线| 国产欧美日韩另类视频免费观看| 樱桃国产成人精品视频| 激情成人综合网| 欧美午夜精品一区二区三区| 欧美成人性福生活免费看| 日韩毛片高清在线播放| 韩国三级在线一区| 欧美日韩高清一区二区三区| 精品国产制服丝袜高跟| 一片黄亚洲嫩模| 国产99久久久国产精品潘金| 制服.丝袜.亚洲.中文.综合| 日本一区二区成人| 激情综合亚洲精品| 欧美另类久久久品| 亚洲欧美另类小说| 国产精品系列在线播放| 欧美日韩国产123区| 亚洲欧美一区二区不卡| 国产精品1区2区| 制服丝袜激情欧洲亚洲| 亚洲欧美日韩国产手机在线| 国产精品一区免费在线观看| 欧美精品三级日韩久久| 亚洲免费观看高清完整版在线观看熊| 久久99国产精品尤物| 欧美调教femdomvk| 亚洲美女屁股眼交3| 成人sese在线| 国产日韩欧美a| 国产一区二区三区精品视频| 777午夜精品视频在线播放| 亚洲黄网站在线观看| 成人av网站在线| 中文字幕的久久| 精品一区二区三区免费| 日韩一二三区视频| 五月婷婷综合在线| 欧美午夜精品久久久| 一区视频在线播放| av一区二区久久| 日韩精品福利网| 91亚洲精品一区二区乱码| 国产日本欧洲亚洲| 国产精品白丝av| 国产视频在线观看一区二区三区| 久久精品72免费观看| 日韩一区二区麻豆国产| 美女被吸乳得到大胸91| 日韩欧美视频一区| 久久国产乱子精品免费女| 精品久久久三级丝袜| 精品影院一区二区久久久| 欧美精品一级二级三级| 日韩高清在线观看| 欧美一区二区三区视频在线观看| 亚瑟在线精品视频| 日韩三级视频中文字幕| 久久99精品国产麻豆婷婷 | 欧美日韩在线不卡| 五月天激情综合网| 日韩一级免费一区| 激情久久五月天| 国产女人水真多18毛片18精品视频| 国产一区二区三区综合| 久久久99精品免费观看不卡| 国产91色综合久久免费分享| 国产精品动漫网站| 色婷婷av一区| 日韩主播视频在线| 日韩一区二区电影| 国产专区欧美精品| 国产精品久久福利| 欧美日韩高清一区二区| 久久精品免费看| 国产欧美一区二区三区鸳鸯浴| 99精品欧美一区二区蜜桃免费 | 亚洲精选一二三| 欧美精品vⅰdeose4hd| 久久精品国产99国产| 欧美激情综合在线| 欧美视频一区二区| 久久精品国产第一区二区三区| 中文字幕av一区二区三区| 色噜噜狠狠色综合欧洲selulu| 日韩高清不卡在线| 久久精品免费在线观看| 色呦呦日韩精品| 久久99久久99小草精品免视看| 国产精品乱子久久久久| 7777精品伊人久久久大香线蕉最新版| 激情综合网天天干| 亚洲乱码中文字幕| 精品国产百合女同互慰| 欧美在线观看你懂的| 国产最新精品免费| 樱桃国产成人精品视频| 精品国产3级a| 欧美中文字幕亚洲一区二区va在线| 国产中文一区二区三区| 亚洲精品第一国产综合野| 欧美成人精品福利| 色综合天天在线| 久久99久久久久久久久久久| 亚洲视频精选在线| 337p日本欧洲亚洲大胆精品 | www.在线欧美| 久久国产综合精品| 亚洲无人区一区| 亚洲人成网站色在线观看| 337p日本欧洲亚洲大胆精品| 欧美午夜精品久久久久久超碰| 丁香网亚洲国际| 免费成人在线观看| 亚洲一线二线三线久久久| 久久免费午夜影院| 日韩你懂的在线播放| 欧美色中文字幕|