Message 1 of 3
Replace referenced objects to instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am not a scripter so I asked chatGpt to help writing a script which change the selected referenced objects and replace them to instenced. But I have got a syntax error.
here is the script by chatgpt:
for obj in selection do (
if isvalidnode(obj) then (
local source = getreference obj -- Get the referenced object
if source != undefined then (
local instance = instance source -- Create an instance of the source
instance.pos = obj.pos -- Match position
instance.rotation = obj.rotation -- Match rotation
instance.scale = obj.scale -- Match scale
delete obj -- Remove the original object
)
)
)
and the error:
-- Syntax error: at ), expected <factor>
-- In line: )
I think I have eqal opening and closing brackets so I dont have a clue.
Please help me someone!