Announcement

Collapse
No announcement yet.

Remove Color Correct from scene mats.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remove Color Correct from scene mats.

    Anyone know of a script that will remove the colorcorrect script from all scene mats? Until that plugin gets fixed, we've had to stop using it, but its wreaking havoc with out model library.
    ____________________________________

    "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."


  • #2
    Agreed, running into the same, but haven't had a chance to make/find anything yet!
    Dave Buchhofer. // Vsaiwrk

    Comment


    • #3
      maybe I've had my head in a cloud - whats the problem with colour correct?
      chris
      www.arc-media.co.uk

      Comment


      • #4
        the cc2010 beta hangs max; it still remains in memory as a running process even if you close the app
        Alessandro

        Comment


        • #5
          oh right didnt know that. We are currently using it with max2009, is there any issues with that version I dont know about?

          cheers
          chris
          www.arc-media.co.uk

          Comment


          • #6
            Not sure if it'll behave for ya but try this:

            Code:
            macroScript ColourCorrect category:"John O'Connell Tools"
            
            (
            
            	/*
            	
            	This script is provded as is and is in no way to be considered a bug free utility.
            	Any loss of time or information as a result of using this script is not the responsibility
            	of John O'Connell so use it at your own risk!
            	
            	To be done:
            	
            	1. Add in support for the vray override and light materials
            	2. Make function based cos it's smarter
            	3. Maybe look at adding in an averaging function for materials
            
            	
            	The latest version of this should always be available in the stuff section of 
            	http://www.joconnell.com so check back often
            	
            	*/
            	
            	
            	Rollout ColourCorrect "Learn to spell colour properly!"
            	
            	( -- Begin Rollout
            	
            		Spinner cc_gamma "Colour Correct gamma" type:#float align:#right range:[0.0,10.0, 2.2]
            		button applyCC "Apply Colour Correct" width:200 align:#right
            		button removeCC "Remove Colour Correct" width:200 align:#right
            		
            		on applyCC pressed do
            		
            		(
            	
            			temp_sel = selection as array
            			
            			for i = 1 to temp_sel.count do
            			(
            				
            				if temp_sel[i].material != undefined then  -- If the object doesnt have a multi sub mat material
            				(
            					mat_subs = getNumSubMtls temp_sel[i].material
            					
            					if mat_subs == 0 then
            					(
            						temp_mat = temp_sel[i].material
            
            						if (classof temp_mat == VRayMtl) then
            						(
            						
            							if (classof temp_mat.texmap_diffuse != ColorCorrect) then
            							(
            								diffuse_tex = temp_mat.texmap_diffuse
            								diffuse_colour = temp_mat.diffuse
            								cc = ColorCorrect()
            								temp_mat.texmap_diffuse = copy cc
            								temp_mat.texmap_diffuse.src_tex = diffuse_tex
            								temp_mat.texmap_diffuse.gamma = cc_gamma.value
            								temp_mat.texmap_diffuse.src_color = diffuse_colour
            							) else (
            								temp_mat.texmap_diffuse.gamma = cc_gamma.value
            							)
            							
            							
            						) else (
            						
            							if (classof temp_mat.diffuseMap != ColorCorrect) then
            							(
            								diffuse_tex = temp_mat.diffuseMap
            								diffuse_colour = temp_mat.diffuse
            								cc = ColorCorrect ()
            								temp_mat.diffuseMap = copy cc
            								temp_mat.diffuseMap.src_tex = diffuse_tex
            								temp_mat.diffuseMap.src_color = diffuse_colour
            								temp_mat.diffuseMap.gamma = cc_gamma.value
            							) else (
            								temp_mat.diffuseMap.gamma = cc_gamma.value
            							)
            							
            						)
            						
            					) else ( -- If the object has a multi sub mat material
            				
            						for m = 1 to mat_subs do
            						(
            						
            							temp_mat = temp_sel[i].material.materialList[m]
            							
            							if (classof temp_mat == VRayMtl) then
            							(
            								if (classof temp_mat.texmap_diffuse != ColorCorrect) then
            								(
            									diffuse_tex = temp_mat.texmap_diffuse
            									diffuse_colour = temp_mat.diffuse
            									cc = ColorCorrect ()
            									temp_mat.texmap_diffuse = copy cc
            									temp_mat.texmap_diffuse.src_tex = diffuse_tex
            									temp_mat.texmap_diffuse.src_color = diffuse_colour
            									temp_mat.texmap_diffuse.gamma = cc_gamma.value
            								) else (
            									temp_mat.texmap_diffuse.gamma = cc_gamma.value
            								)
            							) else (		
            								if (classof temp_mat.diffuseMap != ColorCorrect) then
            								(
            									diffuse_tex = temp_mat.diffuseMap
            									diffuse_colour = temp_mat.diffuse
            									cc = ColorCorrect ()
            									temp_mat.diffuseMap = copy cc
            									temp_mat.diffuseMap.src_tex = diffuse_tex
            									temp_mat.diffuseMap.src_color = diffuse_colour
            									temp_mat.diffuseMap.gamma = cc_gamma.value
            								) else (
            									temp_mat.diffuseMap.gamma = cc_gamma.value
            								)
            							)
            						)
            					) -- end else
            					
            				)
            			)
            		)
            		
            		on removeCC pressed do 
            		(
            		
            			temp_sel = selection as array
            			
            			for i = 1 to temp_sel.count do
            			(
            				
            				if temp_sel[i].material != undefined then  -- If the object doesnt have a multi sub mat material
            				(
            					mat_subs = getNumSubMtls temp_sel[i].material
            					
            					if mat_subs == 0 then
            					(
            						temp_mat = temp_sel[i].material
            
            						if (classof temp_mat == VRayMtl) then
            						(
            						
            							if (classof temp_mat.texmap_diffuse == ColorCorrect) then
            							(	
            								
            								if (temp_mat.texmap_diffuse.src_color != (color 255 0 0)) then
            								(
            									temp_mat.diffuse = temp_mat.texmap_diffuse.src_color
            								)
            								
            								temp_mat.texmap_diffuse = temp_mat.texmap_diffuse.src_tex								
            							)
            							
            						) else (
            						
            							if (classof temp_mat.diffuseMap == ColorCorrect) then
            							(
            							
            								if (temp_mat.diffuseMap.src_color != (color 255 0 0)) then
            								(
            									temp_mat.diffuse = temp_mat.diffuseMap.src_color
            								)
            								
            								temp_mat.diffuseMap = temp_mat.diffuseMap.src_tex
            							)
            							
            						)
            						
            					) else ( -- If the object has a multi sub mat material
            				
            						for m = 1 to mat_subs do
            						(
            						
            							temp_mat = temp_sel[i].material.materialList[m]
            							
            							if (classof temp_mat == VRayMtl) then
            							(
            							
            								if (classof temp_mat.texmap_diffuse == ColorCorrect) then
            								(
            									temp_mat.diffuse = temp_mat.texmap_diffuse.src_color
            									temp_mat.texmap_diffuse = temp_mat.texmap_diffuse.src_tex
            								)
            								
            							) else (
            							
            								if (classof temp_mat.diffuseMap == ColorCorrect) then
            								(
            									temp_mat.diffuse = temp_mat.diffuseMap.src_color
            									temp_mat.diffuseMap = temp_mat.diffuseMap.src_tex
            								)
            								
            							)
            						)
            					) -- end else
            					
            				)
            			)
            
            
            		
            		)
            		
            		
            	)
            	
            	CreateDialog ColourCorrect width:300
            
            )

            Comment


            • #7
              cool, ill give that a try. ya for those using max 2010, colorcorrect is currently a dealbreaker.
              ____________________________________

              "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

              Comment


              • #8
                color correct

                Yep... I had to uninstall it too.
                Bobby Parker
                www.bobby-parker.com
                e-mail: info@bobby-parker.com
                phone: 2188206812

                My current hardware setup:
                • Ryzen 9 5900x CPU
                • 128gb Vengeance RGB Pro RAM
                • NVIDIA GeForce RTX 4090
                • ​Windows 11 Pro

                Comment


                • #9
                  Doesn't look like it works. I'm guessing you have to have the script installed to have it find the script and remove it. Also doesn't appear to work in blends? Not sure on that one.
                  ____________________________________

                  "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

                  Comment


                  • #10
                    I've been working on a conversion script, give it a try:

                    Code:
                    /* 
                    CC converter - V0.1
                    
                    Conversion tool betwen Cuneyt Ozdas "ColorCorrect" plugin and 3DSMax native "Color Correction" plugin.
                    Use it at your own risk
                    
                    Script by Enric Saumell
                    */
                    
                    roll_cc_converter
                    
                    try(destroyDialog roll_cc_converter)catch()
                    
                    rollout roll_cc_converter "CC converter" (
                        
                        button btn_cc_to_ccn "ColorCorrect to Color Correction"
                        button btn_ccn_to_cc "Color Correction to ColorCorrect"
                        checkbox chk_only_selected "Only Material Editor selection" checked:false
                    
                        
                        fn cc_to_ccn only_sel = (
                            
                            if (only_sel) then (
                                cc_instances = getClassInstances ColorCorrect target:MeditMaterials[activeMeditSlot]
                            )
                            else cc_instances = getClassInstances ColorCorrect
                            
                            for cc_map in cc_instances do (
                                
                                ccn_map = Color_Correction()
                    
                                ccn_map.name = cc_map.name
                                ccn_map.color = cc_map.src_color
                                ccn_map.map = cc_map.src_tex
                    
                                ccn_map.lightnessMode = 1
                                ccn_map.gammaRGB = 1.0 / cc_map.gamma            
                                
                                ccn_map.hueShift = 0.0
                                if cc_map.hsl_on do ccn_map.hueShift += (mod (cc_map.hsl_hue_off + cc_map.hsl_hue_gain + 180.0) 360.0) - 180.0
                                if cc_map.hsv_on do ccn_map.hueShift += (mod (cc_map.hsv_hue_off + cc_map.hsv_hue_gain + 180.0) 360.0) - 180.0
                                
                                replaceInstances cc_map ccn_map
                            )
                        )
                        
                        
                        fn ccn_to_cc only_sel = (
                            
                            if (only_sel) then (
                                ccn_instances = getClassInstances Color_Correction target:MeditMaterials[activeMeditSlot ]
                            )
                            else ccn_instances = getClassInstances Color_Correction
                            
                            for ccn_map in ccn_instances do (
                                
                                cc_map = ColorCorrect()
                                cc_map.src_color = ccn_map.color
                                cc_map.src_tex = ccn_map.map
                                cc_map.name = ccn_map.name
                                
                                cc_map.gamma = 1.0 / ccn_map.gammaRGB
                                replaceInstances ccn_map cc_map            
                                
                                if (not close_enough ccn_map.hueShift 0.0 10) do (
                                    cc_map.hsl_on = true
                                    cc_map.hsl_hue_off = ccn_map.hueShift
                                )
                            )
                        )
                        
                        on btn_cc_to_ccn pressed do cc_to_ccn chk_only_selected.checked
                        on btn_ccn_to_cc pressed do ccn_to_cc chk_only_selected.checked
                    )
                    
                    CreateDialog roll_cc_converter width:200 height:80 pos:(point2 10 120)
                    (Select this code and drag to the toolbar to install)

                    Notice it only converts the following parameters:
                    - Color
                    - Texture (e.g. used bitmap)
                    - Gamma
                    - and Hue

                    Still havent found a good way to translate the rest of ColorCorrect parameters, it has a lot more options than MAX Color Correction, and those that are in both don't behave the same way. If someone finds a way to translate them feel free to enhance the script (but please tell me how you've done it )

                    As far as I know, there is no way to retrieve information from a missing plugin through MaxScript, so you need to have ColorCorrect plugin installed in a machine to use it. I guess that, at most, I could write a script to blindly replace missing map plugins with something else, but you would lose all the plugin data.
                    Last edited by Codi; 22-10-2009, 12:46 PM. Reason: Some comma here and there can't hurt

                    Comment


                    • #11
                      Originally posted by percydaman View Post
                      Doesn't look like it works. I'm guessing you have to have the script installed to have it find the script and remove it. Also doesn't appear to work in blends? Not sure on that one.
                      Yep - it's only written for standard, vray and multi sub mats unfortunately and it needs colour correct to be installed since it needs to find the material by name - no CC means it doesn't have the right name.

                      Comment

                      Working...
                      X