3D Canvas Community
3D Canvas Discussion Forums
Plug-In Development and Scripting
Script or Plugin|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
Hi All,
First let me say that I have no clue about how to write scripts or plugins, so I don't know if this would even be possible, but I will ask again anyway. Would it be possible for one of you very talented folks to write a script or plugin that would seperate(break up) an object at irregular points or intervals? Here are a couple of things it might need to do; 1) Allow the user to designate an area, or multiple areas of the object where the irregular separation(s) would occur. 2) Once the separation has been accomplished, designate each part or piece of the original object as a separate object so that rotation or other effects can be applied for animation purposes. Note: Irregular separations would allow for a much more realistic look to explosion animations and would also allow for secondary explosions within the different objects. This could be used for buildings, airplanes, automobiles, spacecraft, and more. I'm hoping this will be just the sort of challenge that would spark someones interest, but if not then just tell me to shut up and I'll be quiet..... ;D Thanks guys, Les |
||
|
Member![]() |
Hi Les.
I like it. Trying to shot off parts of a ship without blowing the whole thing up with the burst/swirl ? KB |
|||
|
|
Member |
Or maybe a ship slowly falling apart as it hurtles through space? With its engines blowing apart as they drift behind??
|
|||
|
|
Member |
Hi
All this sounds very very very good James |
|||
|
|
Member |
Hi
All this sounds very very very good. James |
|||
|
|
Member |
very fun.
first problem is you can't make multiple selections of one object. Easiest way I see to do it is to manually break up your object into many objects. Then you can assign a component script to each object defining the way it flies away. That would be fairly easy. Or you can have one object and a script that breaks it into objects somehow - perhaps by material definition.( but then you'd have to pre-assign the materials so same as first way really). Or you have two scripts - the first is a modelling script that parses the object and makes "bits" of it. These could be defined in a file. Then your component script reads that file for the animation. The hardest bit would be defining your irrecgular bits. Try this - say you have an object with 100 faces. Break it into 10 pieces. say faces 1-20, 21-29,....91-99. Would still be best to make a new object of the peices so your component script could just move the objects. Make sense? Hope someone thinks of an easy way. George |
|||
|
|
Member |
Hi Guys,
Thanks for all the replies. Separating an object can be done at the modeling stage, but its a tedious task getting every part or component to be just right. Then I have to copy/paste the different parts into a new scene as separate objects, and reassemble them, which is another very tedious task......hehehe. Was hoping for an easier way out....... ;D Let me know if you get any ideas?....... ;D Les |
|||
|
|
Member |
hi,
my thoughts aswell, easy way out. James |
|||
|
Member![]() |
A challenge! I like challenges
You can select multiple faces in a single object before running a plugin, and these could be converted into new objects (see my Face Split plugin) These new objects could also be split further by adding random points. You would then just need to apply the burst operation to create an explosive effect. Something to ponder.... |
|||
|
Member![]() |
3rd try
Hi Paul, Would a script be posible with adjustable parameters for the burst, swirl, adjust operations, that could be applied to the resulting seperate objects? In the same way PSP8 lets one run frequently used tasks. I tried inserting a picture of PSP8's script but keep getting a server error. KB |
|||
|
|
Member |
well I wrote half a script that don't work but I've come to this conclusion - at least I've come to how I would do this.
first - write a normal script to break your object into pieces. Create a new group and put the pieces as objects in that group. I did this by breaking the object into an array of 10 fragments which contain faces with contiguous numbers. If you use random number of faces in each fragment, the result might look like a blown up object. Maybe second - write a group script to animate the pieces. a bang wouldn't be too hard if the pieces leave the scene with constant velocity and a random angle. gotta go |
|||
|
Member![]() |
On the other hand, it doesn't seem to be possible to run a script or plugin in animation mode. :-/
KB |
|||
|
|
Member |
sure you can. You can assign a script to a group.
For example (and this was quicker to write than doing the poxy attached animation tanj tanj :-|) Language = VBScript Sub AnimateGroup (Time, CanvasGroup) Kids=CanvasGroup.GetChildCount for siblings=0 to Kids-1 set KidGroup=CanvasGroup.GetChild(siblings) KidGroup.GetPosition Nothing,x,y,z KidGroup.SetPosition _ Nothing,Time,x+(cos(siblings)*Time)/10, _ y+(sin(siblings)*Time)/10,z+(cos(siblings)*Time)/10 next End Sub To do this animation several objects in the scene, each in its own group. Then make a head group to put all the little groups in. Then right click on the main group in the heirarchy and open a group script. Put in the code and press the animate button. Clear? |
|||
|
|
Member |
for some reason I can't post the poxy animation
try this file if you want to see http://users.skynet.be/gj/canvas/scripts/groupout.zip |
|||
|
Member![]() |
Thats wild, George. I was tring to run a script from other than 0 in the time line. Can a delay be inserted into the script?
Another question-When I saved the script into the "run script" drop down I get "The script does not include the required "Main". Edit the script.? I get the same error with another script [flair extrude, I think] any ideas? I'm sure you've been asked this before but where would one get his/her feet wet in scripting? I've done some HTML and thought it was fun. Or does it just hasten ones way to the funny farm? Thanks, KB. The other script was "textureAnimation", not "FlairExtrude". |
|||
|
|
Member |
Thanks George,
I'll check it all out tomorrow or first chance......got to go to work very very early.....LOL Thanks again, Les |
|||
|
|
Member |
funny farm, KB? That explains the food.
As far as I know component and group scripts are only saved with the objects they affect during animation. This is a nuisance if you want to copy and paste them, but I don't use them enought to complain. Normal modelling scripts need different first statements as you've discovered. Read the first page of the help file if this doesn't make sense. I wrote some tutorials once, and I think the link is still on Amabalis site. Been meaning to update it... To delay the start you could change the Setposition statement to include a different formula, or put it inside if Time>15 SetPosition.... make sense George |
|||
|
Member![]() |
Yes, it does make sense-that worries me- ;D
Thanks, George. KB |
|||
|
|
Member |
REVENGE!!!!
On Les for distracting me http://users.skynet.be/gj/canvas/scripts/fragment.htm Voila my solution. Note problems I know about: The copy of the model isn't correct. Only works for 10 fragments. Things for you lot to improve: Add the normals to the copy: Make the fragment sizes different - at the moment they are just equal fractions of the whole object Now where's my drink? |
|||
|
|
Member |
George,
Thanks a million...... ;D I owe you more than a drink for that one. Looks like maybe its just what I needed. Thanks again, Les ;D ;D |
|||
|
| Previous Topic | Next Topic | powered by eve community | Page 1 2 |
| Please Wait. Your request is being processed... |
|

