Smart Vray Proxy
4 posters
:: Resources :: Free Stuff
Page 1 of 1
Smart Vray Proxy
Magandang araw po sa lahat.Share ko lang tong Script Below to make a Vray Proxy fast.
Just copy and paste to notepad and saveas to SmartVrayConverter.mcr
1. Run the script
2. Open the 3ds Max and go to Customize
3. Pick Customize User Interface
4. Pick Toolbars
5. Pick New on left to make new toolbars and named it
6. Pick Category
7. Look for Cooper Script and then Pick
8. Then drag the VrmeshConverter to the new toolbar
9. Finished
Thanks To Cooper....Sana po makatulong...
macroScript SmartVrmeshConverter
category:"Cooper"
(
disablesceneredraw()
max create mode
projectPath = maxFilePath
scenepath = projectPath
vrmeshPath = (scenepath + "Vrmesh")
makeDir vrmeshPath
origObjArray = #()
convertedObjArray = #()
InstArray = #()
uniqueObjects = #()
selectedObjects = selection as array
for i in selectedObjects where superclassof i == geometryclass do
(
if finditem InstArray i == 0 then
(
InstanceMgr.GetInstances i &Instances
InstArray = InstArray + Instances
append uniqueObjects i
)
)
for g in uniqueObjects do if isgrouphead g do setGroupOpen g true
ObjCount = uniqueObjects.count
max select none
progressStart ("Converting " + ObjCount as string + " objects")
iter = 0
for i in uniqueObjects do
(
undo off
(
iter = iter + 1
-- i = selection[1]
origObj = i
if classof origObj != Vrayproxy then
(
if getUserProp origObj "VrmeshPath" == undefined then
(
vrmeshName = vrmeshPath + "\" + origObj.name + ".vrmesh"
originalName = vrmeshPath + "\" + origObj.name + ".max"
saveNodes origObj (vrmeshPath + "\" + origObj.name + ".max")
InstanceMgr.GetInstances origObj &TempInst
for g in TempInst do setUserProp g "VrmeshPath" vrmeshName
for g in TempInst do setUserProp g "OriginalPath" originalName
select origObj
vraymeshexport meshFile: vrmeshName display:0
convertedObj = VRayProxy filename: vrmeshName
)
else
(
vrmeshName = getUserProp origObj "VrmeshPath"
convertedObj = VRayProxy filename: vrmeshName
)
append origObjArray origObj
append convertedObjArray convertedObj
)
else
(
revertname = getFilenameFile i.filename
mergemaxfile (vrmeshPath + "\" + revertname + ".max") #(revertname) #select #noRedraw #mergeDups #useSceneMtlDups #neverReparent
append origObjArray origObj
append convertedObjArray selection[1]
)
)
progressUpdate (100 * iter / (ObjCount + 1) )
)
for q = 1 to origObjArray.count do instancereplace origObjArray[q] convertedObjArray[q]
for f in convertedObjArray do delete f
for g in uniqueObjects do if isgrouphead g do setGroupOpen g false
select selectedObjects
progressEnd()
enablesceneredraw()
completeredraw()
gc()
)
Just copy and paste to notepad and saveas to SmartVrayConverter.mcr
1. Run the script
2. Open the 3ds Max and go to Customize
3. Pick Customize User Interface
4. Pick Toolbars
5. Pick New on left to make new toolbars and named it
6. Pick Category
7. Look for Cooper Script and then Pick
8. Then drag the VrmeshConverter to the new toolbar
9. Finished
Thanks To Cooper....Sana po makatulong...
macroScript SmartVrmeshConverter
category:"Cooper"
(
disablesceneredraw()
max create mode
projectPath = maxFilePath
scenepath = projectPath
vrmeshPath = (scenepath + "Vrmesh")
makeDir vrmeshPath
origObjArray = #()
convertedObjArray = #()
InstArray = #()
uniqueObjects = #()
selectedObjects = selection as array
for i in selectedObjects where superclassof i == geometryclass do
(
if finditem InstArray i == 0 then
(
InstanceMgr.GetInstances i &Instances
InstArray = InstArray + Instances
append uniqueObjects i
)
)
for g in uniqueObjects do if isgrouphead g do setGroupOpen g true
ObjCount = uniqueObjects.count
max select none
progressStart ("Converting " + ObjCount as string + " objects")
iter = 0
for i in uniqueObjects do
(
undo off
(
iter = iter + 1
-- i = selection[1]
origObj = i
if classof origObj != Vrayproxy then
(
if getUserProp origObj "VrmeshPath" == undefined then
(
vrmeshName = vrmeshPath + "\" + origObj.name + ".vrmesh"
originalName = vrmeshPath + "\" + origObj.name + ".max"
saveNodes origObj (vrmeshPath + "\" + origObj.name + ".max")
InstanceMgr.GetInstances origObj &TempInst
for g in TempInst do setUserProp g "VrmeshPath" vrmeshName
for g in TempInst do setUserProp g "OriginalPath" originalName
select origObj
vraymeshexport meshFile: vrmeshName display:0
convertedObj = VRayProxy filename: vrmeshName
)
else
(
vrmeshName = getUserProp origObj "VrmeshPath"
convertedObj = VRayProxy filename: vrmeshName
)
append origObjArray origObj
append convertedObjArray convertedObj
)
else
(
revertname = getFilenameFile i.filename
mergemaxfile (vrmeshPath + "\" + revertname + ".max") #(revertname) #select #noRedraw #mergeDups #useSceneMtlDups #neverReparent
append origObjArray origObj
append convertedObjArray selection[1]
)
)
progressUpdate (100 * iter / (ObjCount + 1) )
)
for q = 1 to origObjArray.count do instancereplace origObjArray[q] convertedObjArray[q]
for f in convertedObjArray do delete f
for g in uniqueObjects do if isgrouphead g do setGroupOpen g false
select selectedObjects
progressEnd()
enablesceneredraw()
completeredraw()
gc()
)
Chokobim- CGP Newbie
- Number of posts : 86
Age : 60
Location : Laguna/Tokyo
Registration date : 13/11/2009
Re: Smart Vray Proxy
thanks for sharing sir!
mez- CGP Expert
- Number of posts : 2692
Location : dxb
Registration date : 24/07/2010
Re: Smart Vray Proxy
anong ginagawa nito sir chokobim?
lukdoberder- CGP Newbie
- Number of posts : 117
Age : 85
Location : Cainta, Rizal
Registration date : 14/01/2010
Re: Smart Vray Proxy
lukdoberder wrote:anong ginagawa nito sir chokobim?
It is the shortcut for makng a Vray Proxy..
Chokobim- CGP Newbie
- Number of posts : 86
Age : 60
Location : Laguna/Tokyo
Registration date : 13/11/2009
lukdoberder- CGP Newbie
- Number of posts : 117
Age : 85
Location : Cainta, Rizal
Registration date : 14/01/2010
Re: Smart Vray Proxy
thank you sir!
JMO- CGP Newbie
- Number of posts : 41
Age : 43
Location : DasmariƱas Ctiy, Cavite
Registration date : 01/04/2011
:: Resources :: Free Stuff
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|