Results 1 to 2 of 2

Thread: plugin material and collada export are not friend...

  1. #1
    Junior Member
    Join Date
    Dec 2005
    Posts
    2

    plugin material and collada export are not friend...

    Hello,

    I have to write a plugin material in maxscript, to enhance the compatibility for our development kit called shiva.
    In fact, i have just to reduce the number on functionality of the standard shader. Only change Ambient, diffuse and specular color.
    Bitmap texture for the diffusemap... and it's the problem.
    When i try to export a cube with my material, i have my color (ambient specular ans diffuse ) but not the texture...
    If someone have an idea to help me...

    thanks a lot and sorry for my english..

    here is my material plugin :

    Code :
    plugin material StonShader
    name:"ShiVa Material"
    classID:#(0x6af60f92, 0x377a3735)
    extends:Standard
    replaceUI:true
    version:0.1
    (
       parameters main rollout:params
       (
          SpecularC type:#color default:gray ui:SpecularC
          AmbientC type:#color default:gray ui:AmbientC
          DiffuseC type:#color default:gray ui:DiffuseC
          EffectMapTexture type:#textureMap
          EffectMap0 type:#bitmap
          ColorBackup type:#color default:gray
          DiffuseType type:#radiobtnIndex default:2 ui:diffusechooser
    	  istga type:#boolean default:false
       )
     
       rollout params "Colors" width:332 height:216
       (
       	  imgTag uiBar "" bitmap: (openBitMap "$scripts\ST\ST_bar.bmp") pos:[0,1] width:325      
    	  colorPicker SpecularC "Specular :" pos:[43,76] width:104 height:20
          colorPicker AmbientC "Ambient :" pos:[46,40] width:101 height:20
          colorPicker DiffuseC "" pos:[101,160] width:55 height:20
          GroupBox grp1 "Tips" pos:[185,18] width:126 height:193
          button EffectMap0Chooser "None" pos:[34,159] width:53 height:20 enabled:false         
          radiobuttons diffusechooser "Diffuse :" pos:[27,123] width:145 height:30 labels:#("Texture    ", "Color") default:2 columns:2
          GroupBox grp13 "Color" pos:[17,18] width:157 height:193
          label lbl3 "Use 32bits tga file to use alpha as opacity map..." pos:[191,44] width:112 height:45
          label lbl12 "For opacity level, normal and specular map, add it directly under shiva..." pos:[192,102] width:112 height:71
          checkbox transparencycheck "See transparency" pos:[35,185] width:114 height:17 enabled:false
     
          on SpecularC changed col do
          (
             delegate.specular = col
          )
          on AmbientC changed col do
          (
             delegate.ambient = col
          )
          on DiffuseC changed col do
          (
             delegate.diffuse = col
          )
     
          on EffectMap0Chooser pressed do
          (
             try (
     
                EffectMap0 = selectbitmap caption: "Diffuse Texture"
                if(EffectMap0 != undefined) do
                (
                   delegate.diffuseMap = BitmapTexture filename:EffectMap0.filename 
    			   delegate.opacityMap = BitmapTexture filename:EffectMap0.filename monoOutput:1
                   delegate.diffuseMap.coords.mapping = 0
                   delegate.diffuseMap.coords.mappingType = 0
    			   delegate.diffuseMapEnable = true
    			   delegate.opacityMapEnable = false
                   EffectMap0Chooser.caption = "Defined"
     
    				 fileType = substring EffectMap0.filename (EffectMap0.filename.count-2) 3
    		   		 if (fileType== "tga")
    		   		 then ( 
    				 		transparencycheck.enabled=true
    						istga= true
    					  ) 
    				 else (
    				 		transparencycheck.enabled=false
    						istga=false
    					)
     
                )
             )
             catch( MessageBox "erreur")
          )
     
       	on transparencycheck changed state do
       (
     
    			if ( state )
    				then
    				(
    				delegate.opacityMapEnable = true
       	      		)
    	   	      else
    	   	      (  
    	        	delegate.opacityMapEnable = false
    	   	      )
     
     
       	)
     
          on diffusechooser changed state do
          (
             case state of
             (
                2:
                (   
                   delegate.diffuseMapEnable = false
    			   delegate.opacityMapEnable = false
    			   EffectMap0Chooser.enabled=false
    			   transparencycheck.enabled=false
    			   transparencycheck.state=false			   
                   EffectMap0Chooser.caption = "None"
     
                   DiffuseC.enabled=true
                   DiffuseC.color=ColorBackup
                   delegate.diffuse=ColorBackup
                )
     
                1:
                (
                   EffectMap0Chooser.enabled=true
                   DiffuseC.enabled=false
                   ColorBackup=DiffuseC.color
                   DiffuseC.color = color 128 128 128
                   delegate.diffuse= color 128 128 128
     
                   if (EffectMap0 != undefined) do
                   (
    			   	  transparencycheck.enabled=istga	
                      delegate.diffuseMapEnable=true
                      EffectMap0Chooser.caption = "Defined"
    				  delegate.opacityMapEnable = false
     
     
                   )           
                )
             )
          )
     
     
          on params open do
          (
             if diffusechooser.state == 2 then
             (
                EffectMap0Chooser.enabled = false
                EffectMap0Chooser.caption = "None"
    			DiffuseC.enabled=true
    			transparencycheck.enabled=false
     
             )
             else if EffectMap0 != undefined then
    		         (
    		            EffectMap0Chooser.enabled = true
    		            EffectMap0Chooser.caption = "Defined"
    					delegate.diffuseMapEnable=true
    					delegate.opacityMapEnable=false
    					DiffuseC.enabled=false
    					transparencycheck.enabled=istga
    		         )
    				 else 
    				 (
    				 	EffectMap0Chooser.enabled = true
    		            EffectMap0Chooser.caption = "None"
    					DiffuseC.enabled=false
    					transparencycheck.enabled=false
    				)
     
          )
       )   
       	  rollout params2 "Stonetrip" width:312 height:305 rolledup:true
    		(
    			imgTag uiBar "" bitmap: (openBitMap "$scripts\ST\ST_bar.bmp") pos:[5,1] width:332
    			imgTag bmp1 "" bitmap: (openBitMap "$scripts\ST\shiva.jpg") pos:[56,18]
    			HyperLink developer "developer.stonetrip.com" color:(color 86 34 105) pos:[193,222] width:117 height:18 address:"http://developer.stonetrip.com"
    			HyperLink lbl6 "stonetrip" color:(color 86 34 105) pos:[135,283] width:42 height:18 address:"www.stonetrip.com"
    		)
     
     
       on create do
       (
          delegate.specular = color 128 128 128
          delegate.diffuse = color 128 128 128
          delegate.ambient = color 128 128 128
          delegate.adLock = off
          delegate.specularLevel = 57
          delegate.Glossiness = 10
       )
    )

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    ColladaMax is made by Feeling Software. I'm not sure how they handle custom material parameters. There are a couple things you could try:
    (a) Post your question on their forums. Someone should be able to help you.
    (b) Download the ColladaMax source code (available from Feeling's website) and see try to figure out what's going wrong.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •