RailClone > RailClone Pro (*)

missing XRef material

(1/1)

harumscarum:
it actually is not RC issue, but maybe you may help me - I use startup script to assign default material on object creation. it works fine, but when RailClone object is created (from Library) I get XRef material which cause error then. is any way to exclude RC object from this script?



iToo:
You would add a conditional clause as "Classoff node != RailClone_Pro".

harumscarum:
thank you! unfortunately i'm not very strong in maxscript - could you please let me know where exactly in code must be this line

--- Code: ---fn defaultmat=(
 global dmat
 (

 dmat=VRayMtl Name:"default" Diffuse:(color 100 103 110) Reflection:(color 110 110 101) reflection_subdivs:8 reflection_fresnel:on   effectsChannel:15
 
 )
)

calbScr="node=callbacks.notificationParam()\n"
calbScr+="dmat=sceneMaterials[\"default\"]\n"
calbScr+="if dmat==undefined or (classof dmat != VRayMtl) do defaultmat()\n"
calbScr+="if (superClassOf node != shape and node.material==undefined) do (\n"
calbScr+="node.material=dmat\n"
calbScr+=")\n"
calbScr+="

 (
 case superClassOf node of
  (
   (GeometryClass):
   (
  node.wirecolor=(color 22 22 22)
   )
   (shape):
   (
    node.wirecolor=(color 225 198 87);
   )
  (Camera):
  (
  node.wirecolor=(color 133 161 197)
  )
  (Light):
  (
  node.wirecolor=(color 245 158 35)
  )
 )
 )\n"

callbacks.removeScripts id:#VGCreate
callbacks.addScript #filePostOpen "dmat=sceneMaterials[\"default\"];if dmat==undefined do defaultmat()" id:#VGCreate
callbacks.addScript #nodeCreated calbScr id:#VGCreate
callbacks.addScript #sceneNodeAdded calbScr id:#VGCreate




global CamOrLigthAdded
fn CamOrLigthAdded = (
lastNode = objects[objects.count]
if superclassof lastNode == Camera do (
serchLN = LayerManager.getLayerFromName "x cameras"
newL = if serchLN != undefined then serchLN else LayerManager.newLayerFromName "x cameras"
newL.addnode lastNode
)
)
callbacks.removeScripts id:#ecximer
callbacks.addScript #sceneNodeAdded "CamOrLigthAdded()" id:#ecximer
--- End code ---

iToo:
I think that changing this line should be enough:

calbScr+="if (superClassOf node != shape and classOf node != RailClone_Pro and node.material==undefined) do (\n"

Navigation

[0] Message Index

Go to full version