Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
I changed the group to "Scene" and that worked.
Thank You
I am not using the "abc" parameter at the moment.
As a test I changed the color of "BaseWhite" using a "material color inst" plugIt and have seen the expected color change
I have modified the function:
fun TestColor(string)=
_showconsole;
let (V3DgetSessionView c3dXsession) -> viewstr in
let V3DgetDefaultSession viewstr -> sessionstr in
let SO3SceneGetMaterial (V3DgetSession sessionstr) "V3DdefaultResources" "BaseWhite" -> mat in
if mat == nil then
(
_fooS "material not found";
0;
)
else
(
_fooS "action";
SO3MaterialSetAmbient mat (make_rgba 0 0 255 0);
SO3MaterialSetDiffuse mat (make_rgba 0 0 255 0);
SO3MaterialSetSelfIllumination mat (make_rgba 0 0 255 0);
0;
);;
The log shows
> Action : Scene.Test Color.Run with param : abc and reply param : Scene.Key_3
The console shows:
loading tmp/tmp3891288.pkg ...
typechecking
fun TestColor : fun [u0] I
Generating bytescodes for 'TestColor' ...
167 bytes generated (for a total of 15632)
Loading Complete
> exec: TestColor "abc"
material not found
I am attempting to change a material color within a addsourcecode script and am having some trouble
getting the handle of a material. What follows is my test code.
fun TestColor(string)=
let (V3DgetSessionView c3dXsession) -> viewstr in
let V3DgetDefaultSession viewstr -> sessionstr in
let SO3SceneGetMaterial (V3DgetSession sessionstr) "V3DdefaultResources" "BaseWhite" -> mat in
if mat == nil then nil else
(
SO3MaterialSetAmbient mat (make_rgba 0 0 255 0);
SO3MaterialSetDiffuse mat (make_rgba 0 0 255 0);
SO3MaterialSetSelfIllumination mat (make_rgba 0 0 255 0);
);
0;;
I have been trying to figure out the OS3D structure for this kind of access and have not made a lot of progress.
Pages: 1