Changing Component Parameters At Runtime
swzone
05 May 2012
Hello,
Is there any way to change component parameter at runtime ? by using code ?
I want to change the Frames parameter of fuse component using code.
also I want to change SegmentAngle of Toroid_segment component using code.
Thanks
Is there any way to change component parameter at runtime ? by using code ?
I want to change the Frames parameter of fuse component using code.
also I want to change SegmentAngle of Toroid_segment component using code.
Thanks
glsmall
05 May 2012
Check the script in Scene_1
fuse.swi (17.36K)
downloads: 27
Edited by glsmall, 05 May 2012 - 09:27 AM.
fuse.swi (17.36K)
downloads: 27
Edited by glsmall, 05 May 2012 - 09:27 AM.
swzone
05 May 2012
Hi glsmall,
Thanks for your code,
Where can I find detail info about component methodes,events and parameters ?
Regards.
Thanks for your code,
Where can I find detail info about component methodes,events and parameters ?
Regards.
swzone
05 May 2012
If there is no direct way to change component parameter at runtime ,
is it possiple to create component at runtime with intilazied paramters ?
is it possiple to create component at runtime with intilazied paramters ?
glsmall
06 May 2012
I guess I don't understand because the example I posted set the Frames parameter at run time. So I guess the simple answer is yes but it may require some scripting. Please explain and give some detail as to what you are trying to achieve.
Also, it would be good if you could post your swi so whomever may work on your request desn't have to create something from scratch.
Also, it would be good if you could post your swi so whomever may work on your request desn't have to create something from scratch.
glsmall
06 May 2012
Oh, and as far as learning about components...
- Using Components - This screencast demonstrates how to place and use components.
- Building Components - Building components is easy. Watch this quick screencast to get you going.
- Scripting with Components - This screencast demonstrates how to setup component parameters and script with
swzone
07 May 2012
Thanks for links and tutorials ,
I can access and read the Frames parameter using fuse.parameters.Frames
But changing Frames value does not refelect to internal script ,
Yes your code is working well, but how about other compenet like SegmentAngle of Toroid_segment ? or any other compenet parameters ?
I dont want to go inside the creating script.
Regards
I can access and read the Frames parameter using fuse.parameters.Frames
But changing Frames value does not refelect to internal script ,
Yes your code is working well, but how about other compenet like SegmentAngle of Toroid_segment ? or any other compenet parameters ?
I dont want to go inside the creating script.
Regards
glsmall
07 May 2012
If the component doesn't have the functionality you need and you don't want to go in and modify the script then it may not be possible. I tend to think of the included components as a good starting point and if I need some functionality that the component isn't designed for I either modify it or design my own. I don't know what else to say. I guess I don't understand why you would not want to modify the script if it would get it to do what you want.
OutCast**NL
07 May 2012
Parameters are basicly just initial values,.. and values can be changed.
The problem here is that some components refer directly to the hardcoded parameters like ie:
instead of storing the parameters value in a var first, like ie:
using the last scenario,
changing value of "myvar" will overwrite the value from the parameters panel.
The problem here is that some components refer directly to the hardcoded parameters like ie:
if (!parameters.Repeat){...
instead of storing the parameters value in a var first, like ie:
myvar = parameters.Repeat;
if (!myvar){...
using the last scenario,
changing value of "myvar" will overwrite the value from the parameters panel.


