09-20-2007, 01:09 AM
Hey guys I was sick of creating an object source for each flippin object I needed to have an obj source for... at least sick of it when there were like 20 of them.
Due to some funky array stuff in the way fume handles it's objects and stuff you cannot create an object src with an object listed for the source object. So instead what we have to do is copy it then change it after it's been assigned. What's that mean? You have to first have an object source in the scene with an object assigned in the source object area. In fact it can even say "deleted"...basically it just can't be empty.
So Create an Object Src, pick an object then select any objects you want to be a source object, and run the script. You will be prompted to select which obj src you want to copy, then it should copy the object src, assign it to an object, move it to that object, and also link it to that object.
Special thanks to Eric "the machine" Hulser for helping me out
Due to some funky array stuff in the way fume handles it's objects and stuff you cannot create an object src with an object listed for the source object. So instead what we have to do is copy it then change it after it's been assigned. What's that mean? You have to first have an object source in the scene with an object assigned in the source object area. In fact it can even say "deleted"...basically it just can't be empty.
So Create an Object Src, pick an object then select any objects you want to be a source object, and run the script. You will be prompted to select which obj src you want to copy, then it should copy the object src, assign it to an object, move it to that object, and also link it to that object.
Special thanks to Eric "the machine" Hulser for helping me out
Code:
/*!
\file FumeObjSrcBySelection.ms
\remarks Create a object_src, set its object, and run on a selection of geometry
\author Ian Farnsworth
\author Email: farnsworth@blur.com
\author Company: Blur Studio
\date 09/19/07
*/
(
if (getClassInstances Object_src).count > 0 then (
-- Don't do anything if no objects are selected
if selection.count != 0 then (
messageBox "Select Object Source to be copied"
-- Pick a object source to copy
function filterObjSrc obj = ( classof obj == object_src )
local objSrc = pickobject filter:filterObjSrc
-- If user picks an objectSrc
if objSrc != undefined then (
-- and the object src has 1 object in its list
if objSrc.object.count == 1 then (
-- Go through the selection for all objects that are geometryclass
local success = false
for obj in selection as array where superclassof obj == GeometryClass do (
SrcCopy = copy objSrc
SrcCopy.pos = obj.pos --copy and move object src to source object
SrcCopy.object = #(obj) --selection has to be an array
SrcCopy.parent = obj --parent object src to source object
success = true
) --end i loop
if not success then messageBox "You have to have some Geometry selected for this to work."
)
else messageBox "Your Object Source has to have 1 object in its fucking list."
)
)
else messageBox "You have to have some geometry selected"
)
else messageBox "There are no Object Sources in your scene."
)