2005-07-15 11:11 AM
=mat2
mat2
=mat1
ELSE
mat2
=holdmat
ENDIF
NEXT P
ENDIF
In the above modpar is a variable derived from 'GLOB_MODPAR_NAME'. samemat is an on/off parameter where the user chooses whether all the objects are the same material or whether the components have alternating materials. There may be more that one array, but only two possible materials in each of the arrays. All the arrays are correctly declared and defined in the object
The intent of the script steps above is as follows: if the material is to be the same throughout, make all the materials the same, and place the second material in a 'holding array'. If the materials are to differ then retrieve the stored data from hold mat and use it as the second material.
I have tried this in the Master script, and in the Parameters script (with the addition of a PARAMETERS directive where necessary). The result from the Parameter script is not good, so I have been trying to make this work in the Master script. The result from the Master script is that the materials change in the UI that I have created, but the materials in the object itself do not update. In fact the model seems to think that all elements in the mat2
array are the 'General' material.
It works in one direction: i.e when materials differ and are changed to become the same, the process works, but when changing from one material to two, the process doesn't work.
I can only deduce that the Master script is telling the UI that the materials have been updated, but the 3D script is ignorant of this change.
Mike
2005-07-15 12:08 PM
! ### 3D-Script: FOR P=1 TO num IF samemat=1 THEN SET MATERIAL mat1If you don't want to see the individual materials in the UI or parameter list you can hide them by the same IF ... THEN construction and additional LOCK and HIDEPARAMETER.! or simply ! SET MATERIAL mat1 ! if there's only one material for all ELSE SET MATERIAL mat2
ENDIF ! here come the objects defining statements, CALLs etc. NEXT P
2005-07-15 07:06 PM