AndrewVK Posted December 10, 2005 Share Posted December 10, 2005 Is it possible to: 1. get object bounds 2. delete object from within HScript? Quote Link to comment Share on other sites More sharing options...
sibarrick Posted December 10, 2005 Share Posted December 10, 2005 oprm /obj/foo set bboxX = `bbox("/obj/foo",0)` echo $bboxX Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted December 12, 2005 Author Share Posted December 12, 2005 Wow... oprm Thanks Simon! Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted December 13, 2005 Author Share Posted December 13, 2005 Is it possible to copy ALL parameters of object (transforms, light mask, rendering properties etc) and paste it to newly created object ? Like: set name = $arg1 set prm = COPY ALL ... ... for tx = $BBXmin to $BBXmax step $stepX for ty = $BBYmin to $BBYmax step $stepY for tz = $BBZmin to $BBZmax step $stepZ ... ... opadd -n geo $cellname PASTE ALL to $cellname end end end Quote Link to comment Share on other sites More sharing options...
sibarrick Posted December 13, 2005 Share Posted December 13, 2005 You can use opscript -g to create a script with a variable as a argument so you can recreate the object with any name, does that help? Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted December 13, 2005 Author Share Posted December 13, 2005 Unfortunately objects should be inside of subnet Objects created with this script appears at the same level as "source". Quote Link to comment Share on other sites More sharing options...
edward Posted December 13, 2005 Share Posted December 13, 2005 Then opcf to the right level first? Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted December 13, 2005 Author Share Posted December 13, 2005 Have no idea how to do this # Get source name set name = $arg1 # Save source as empty template opscript -g `$name` > $TEMP/temp.cmd # Jump to /obj/ level opcf /obj # Create container for hundreds empty objects set subnetname = `execute("optype -N $name") + "_subnet"` opadd -n subnet $subnetname # Dive in opcf $subnetname # Now we are inside of subnet # Call template script with new object name source $TEMP/temp.cmd $cellname Fail!!! $cellname created at $name level because of this (part of temp.cmd): if ( "$argc" != 2 ) then echo -n Usage: $arg0 op_name1 exit endif set saved_path = `execute("oppwf")` opcf /obj :banned: :tumbleweed: I cant edit temp.cmd because my script is used as pre-frame script I want to keep created objects inside of subnet because i need to delete subnet quickly from post-frame script I just want to force "copy sop" and mantra to generate and render 1.000.000 objects as quick as possible Here http://www.cgtalk.ru/forum/attachment.php?...07&d=1134435693 500.000 copies generated in 14 minutes and rendered in 20 seconds at my home XP1800+ 1Gb Quote Link to comment Share on other sites More sharing options...
sibarrick Posted December 14, 2005 Share Posted December 14, 2005 Nice image... If this is all done during the render I don't see any problem with creating them at object level and deleteing them at object level too, I don't think there is much performance difference between deleting a subnet and deleteing all the individual objects, or are you not finding that to be the case? Also, if all the parameters are the same why not just use instancing to render them? Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted December 14, 2005 Author Share Posted December 14, 2005 Dont know why...but instancing is VERY slow. Time to prepare 50.000 objects approximately few hours or memory overflow in worst case Time to prepare 1.000.000 objects with script is 36 minutes. And i can control almost everything with stamping Why i want to keep objects inside of subnet?...hmmm Sometimes i need to just generate objects. Just one click on subnet display flag to hide hundreds of objects from mantra. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted December 14, 2005 Share Posted December 14, 2005 Just one click on subnet display flag to hide hundreds of objects from mantra. 23249[/snapback] Sorry I thought you were doing this on the fly during the render only. How about createing all the objects at object level and then collapsing them into a subnet? Opcollapse does this, only in H8 though, seems to be missing from H7. Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted December 14, 2005 Author Share Posted December 14, 2005 Hey Simon! I found another one methods:) Presets!!! oppresetsavefile $name $TEMP/temp.preset oppresetloadfile $cellname $TEMP/temp.preset Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.