Is there a way to do this automatically ? I need to render every element in scene out seperately but in the same position as the original scene. Then I can bring those seperate elements into flash and have control over them…
I’d say the easiest would be using lpm wich is free nowadays, or use the new VRayobjSelect and use any of the MMRE scripts to assign unique IDs to each object.
That would be great if you could…Im asssuming its a simple for and to script that renders every mesh out to a sequenced filename until the loop has gone through all the objects ?!
Yeah, it’s just about that easy. I have to dig up a function to return the tops of groups as well though otherwise you’ll get every object in a group as well. Give me a second to find it.
(
global getObjectsAndGroups
/* FUNCTION: getObjectsAndGroups
PURPOSE: Gets all of the objects in the scene and if they're a part of a group, get the highest group head */
fn getObjectsAndGroups = (
local objs = #()
local par = undefined
for o in objects do (
if not(isGroupMember o) then (
append objs o
) else (
obj = o
par = o.parent
while par != undefined do (
pre = par
par = par.parent
if par == undefined then (
isNotHead = false
append objs pre
)
)
)
)
objs = makeUniqueArray objs
)
/* Unhides the array of objects (objs) */
function unhideObjects objs = (
local nodes = #()
nodes = objs.children
--format "unhideObjects nodes before children added:\n"
--print nodes
-- Now check for group heads and if it is, we need to unhide the children as well
for n in nodes where (isGroupHead n) and (isProperty n #children) do (
for c in n.children do append nodes c
)
unhide nodes
)
clearListener()
-- Gets all of the objects and objects that are parts of groups
objsToSetup = for o in (getObjectsAndGroups()) where not(isKindOf o Light) and not(isKindOf o Camera) collect o
if (local bitmapPath = getSavePath caption:"Select where you want to save these files to") != undefined then (
for o in objsToSetup do (
-- For each of the objects in the scene do the following
-- Hide everything
hide objects
-- Unhide the current object, if it's a group, unhide it's children as well, or else just the object
if (classof o) == Dummy then (
unhideObjects o
) else (
unhide o
)
-- Change .jpg to whatever extension you want, it's just like outputting from the standard Save File dialogue
local bitmapFilename = bitmapPath + "\\" + (o.name as string) + ".jpg"
local bmap = bitmap renderWidth renderHeight filename:bitmapFilename
render to:bmap
save bmap
close bmap
)
)
)
I have a script to render layers already on my site called MPManager (Matte Pass Manager). The setup is a bit tricky because you have to put the functions file on a computer that all of the render nodes can see, but it works for that.