BGE Material Creator (BGE-MC) #40334

Closed
opened 2014-05-24 05:53:18 +02:00 by Oren Titane · 41 comments

Show case
Wiki

BGE-MC aims at simplifying the blender material creation and workflow by ridding the user of having to manually load all the required textures.

The add-on is located in the tools shelf. When choosing to add a new texture, a file path chooser appears and the image is loaded as one of the following texture maps: diffuse, normal, specular, emission, reflection and glow.

[Show case ](https://dl.dropboxusercontent.com/u/11171255/Rikuto/www/content/bge-mc/showcase/intro.png) [Wiki ](http://rikutogame.dnsd.info/bge_material_creator) BGE-MC aims at simplifying the blender material creation and workflow by ridding the user of having to manually load all the required textures. The add-on is located in the tools shelf. When choosing to add a new texture, a file path chooser appears and the image is loaded as one of the following texture maps: diffuse, normal, specular, emission, reflection and glow.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Oren Titane self-assigned this 2014-05-24 05:53:19 +02:00
Author

Added subscriber: @Genome36

Added subscriber: @Genome36
Author

fixed properties location (from bpy.types.Scene to bpy.types.WindowManager).

fixed properties location (from bpy.types.Scene to bpy.types.WindowManager).

Added subscriber: @raco

Added subscriber: @raco

I like this initiative very much, but I have several remarks:

  • Change name to Material Creator. 'Loader' would imply to load template materials, which isn't the case here.
  • Locate the Material Creator in the Tools Shelf. It's a tool anyway and this would resolve some other problems too. For instance, no option to add a Plane unless an object with a mesh is selected first. However I think it would be best to leave that option out.
  • Add button 'Use Alpha' (boolean) beneath 'Reflection'. If checked add Diffuse Alpha with 'Diffuse' only.
  • With 'Specular' enable Specular Color too (not only Intensity).
  • Remove 'Height' (not working and probably not used often anyway).
  • Only two execution buttons in Object Options: 'Create Material', 'Clear'.
  • Only print to the Console to report that what is executed
  • Add option to export and import templates.
I like this initiative very much, but I have several remarks: - Change name to Material Creator. 'Loader' would imply to load template materials, which isn't the case here. - Locate the Material Creator in the Tools Shelf. It's a tool anyway and this would resolve some other problems too. For instance, no option to add a Plane unless an object with a mesh is selected first. However I think it would be best to leave that option out. - Add button 'Use Alpha' (boolean) beneath 'Reflection'. If checked add Diffuse Alpha with 'Diffuse' only. - With 'Specular' enable Specular Color too (not only Intensity). - Remove 'Height' (not working and probably not used often anyway). - Only two execution buttons in Object Options: 'Create Material', 'Clear'. - Only print to the Console to report that what is executed - Add option to export and import templates.
Author
  1. Done.
  2. Done, plane creation and apply to object boolean have been left out.
  3. Done.
  4. Done.
  5. Leaving option for rare cases, including me for my projects which sometimes requires height maps.
  6. Done.
  7. Cannot seem to find what method is used to print to console. If you know the command could you tell me what it is ?
  8. Considering the idea.
1. Done. 2. Done, plane creation and apply to object boolean have been left out. 3. Done. 4. Done. 5. Leaving option for rare cases, including me for my projects which sometimes requires height maps. 6. Done. 7. Cannot seem to find what method is used to print to console. If you know the command could you tell me what it is ? 8. Considering the idea.

Looks very nice, Genome36. However, I can't seem to make it work. When I click on the 'Create' button a material is added, but it contains no textures. And I get an error message in the Console: 'name booleans is not defined'.

Looks very nice, Genome36. However, I can't seem to make it work. When I click on the 'Create' button a material is added, but it contains no textures. And I get an error message in the Console: 'name booleans is not defined'.
Author

oh, i forgot to say that when choosing a texture you need to turn of the relative path on the left when the file chooser appears. I am still searching on a way to auto deactivate when the file chooser is appearing.

EDIT
Here is the method:
http://www.blender.org/documentation/blender_python_api_2_70a_release/bpy.ops.buttons.html?highlight=file_browser#bpy.ops.buttons.file_browse

I'll try to implement it today.

oh, i forgot to say that when choosing a texture you need to turn of the relative path on the left when the file chooser appears. I am still searching on a way to auto deactivate when the file chooser is appearing. **EDIT** Here is the method: http://www.blender.org/documentation/blender_python_api_2_70a_release/bpy.ops.buttons.html?highlight=file_browser#bpy.ops.buttons.file_browse I'll try to implement it today.
Author

Rectified "name booleans is not defined" bug, i've forgot to include "booleans" in the method "prepare_material" arguments.

Rectified "name booleans is not defined" bug, i've forgot to include "booleans" in the method "prepare_material" arguments.

Works. Nice Job!

Works. Nice Job!
Author

Thanks, I will try to implement the auto-deactivation of the relative path when the file chooser appears and the console print, as soon as possible.

Thanks, I will try to implement the auto-deactivation of the relative path when the file chooser appears and the console print, as soon as possible.
Oren Titane changed title from BGE material loader to BGE Material Creator (BGE-MC) 2014-05-28 18:56:59 +02:00
Author

Fixed typo "Relfection"to"Reflection", picked up by codemanx.

Fixed typo **"Relfection"**to**"Reflection"**, picked up by **codemanx**.
Author

Show case file upload.

Show case file upload.
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Author

Added better support for glow maps [ enabled alpha channel and rgb to intensity option / alpha doesn't disrupt the glow map if it is on a black background ]

Added better support for glow maps [ enabled alpha channel and rgb to intensity option / alpha doesn't disrupt the glow map if it is on a black background ]
Author

Fixed empty material bug [ added a statement to verify that at least one image submitted to the add-on exists before creating a material ]

Fixed empty material bug [ added a statement to verify that at least one image submitted to the add-on exists before creating a material ]
Author

Changed aspect of the addon in the tool shelf for a more compact view (about half the width of the previous version).

Changed aspect of the addon in the tool shelf for a more compact view (about half the width of the previous version).

Nice job! Just a personal preference. It would be nice if following channels would be editable: Diffuse: Intensity, Color; Specular: Intensity, Color, Hardness.

And to have the option to name each texture. Instead of one block then you would have two blocks stacked on each other. The top block for selecting the image (displaying the name of that image), and the bottom block for naming the texture.

If this doesn't sound good to you, I'll probably try and make these customizations myself. I'll be using this for sure. It's a time saver!

Nice job! Just a personal preference. It would be nice if following channels would be editable: Diffuse: Intensity, Color; Specular: Intensity, Color, Hardness. And to have the option to name each texture. Instead of one block then you would have two blocks stacked on each other. The top block for selecting the image (displaying the name of that image), and the bottom block for naming the texture. If this doesn't sound good to you, I'll probably try and make these customizations myself. I'll be using this for sure. It's a time saver!
Author

Added a drop-down menu for setting texture coordonates of all maps except reflection [ values: GLOBAL, OBJECT, GENERATED, UV ]

Added a drop-down menu for setting **texture coordonates** of all maps **except reflection** [ values: GLOBAL, OBJECT, GENERATED, UV ]
Author

Changed the button Clear to Reset [ Button used to only reset maps file paths, now it resets to default value all the add-on ]

Changed the button **Clear** to **Reset** [ Button used to only reset maps file paths, now it resets to default value all the add-on ]
Author

Added raco double bpy.props.stingproperty suggestion [ top being the name & bottom being the image file path ]

Added **raco** double bpy.props.stingproperty suggestion [ top being the name & bottom being the image file path ]

Added subscriber: @mahalin

Added subscriber: @mahalin
Author

Fixed bug when unregistering add-on custom properties [ bpy.types.WindowManager.material_creator ]

Fixed bug when unregistering add-on custom properties [ bpy.types.WindowManager.material_creator ]
Author

fixed website

fixed website
Author

Added raco editable channels suggestion [ Diffuse: Intensity, Color | Specular: Intensity, Color, Hardness ]

Added **raco** editable channels suggestion [ Diffuse: Intensity, Color | Specular: Intensity, Color, Hardness ]
Author

Planning an advanced feature for multiple texture maps customizable channels.

Planning an **advanced** feature for multiple texture maps customizable channels.
Author

Added facilitating methods and values to reduce code length or repetitive strings formats.

Added **facilitating methods and values** to reduce code length or repetitive strings formats.
Author

Added texture node Influences [ such as "intensity", "color", "alpha", "hardness", "normal" and "displacement" ]

Added **texture node Influences** [ such as "intensity", "color", "alpha", "hardness", "normal" and "displacement" ]
Author

Added EnumProperties for "Texture coords", "projection" and "blend type".

Added **EnumProperties** for "Texture coords", "projection" and "blend type".
Author

Reworking add-on internals to include multi node advanced options, into the textures slots creation class.

Reworking add-on internals to include multi node advanced options, into the textures slots creation class.
Author

I am proud to announce the final release candidate of the add-on Material Creator (BGE-MC).
For information about it's functionalities and initial setup, please follow this link: http://rikutogame.dnsd.me/bge_material_creator.

I am proud to announce the final release candidate of the add-on **Material Creator (BGE-MC)**. For information about it's functionalities and initial setup, please follow this link: http://rikutogame.dnsd.me/bge_material_creator.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Quick review:

  • Why does the user have to disable relative paths?
  • Why is there try/except around unregister? (this shouldnt fail)
  • Best not name variable dict
  • Names like reflection_advanced_row_tex_coords seem a bit overfly verbose? - either call col, or if chance of conflicting names move into own function?
Quick review: - Why does the user have to disable relative paths? - Why is there try/except around unregister? (this shouldnt fail) - Best not name variable `dict` - Names like `reflection_advanced_row_tex_coords` seem a bit overfly verbose? - either call `col`, or if chance of conflicting names move into own function?
Author

Hello campbellbarton

1] [email]
"Hello,
For some reason "os.path.exists()" requires an absolute path to function unless I'm mistaking, thus needing relative path to be disabled for now, until I find a way to fix it. I would like to know how I could add a file selector just like the one in [ properties > texture > image ] https://dl.dropboxusercontent.com/u/11171255/Material%20Creator/image_selector.png".
It would fix this same issue.

2] try/except is to ensure that all the custom properties get deleted before recreating them, in case some are not necessary any more and to prevent conflicts.

3] variable now named data_collection

4] I'll try to make my script PEP8 compliant and follow these guidelines http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Layouts.

Hello campbellbarton 1] **[email]** "Hello, For some reason "os.path.exists()" requires an absolute path to function unless I'm mistaking, thus needing relative path to be disabled for now, until I find a way to fix it. I would like to know how I could add a file selector just like the one in [ properties > texture > image ] https://dl.dropboxusercontent.com/u/11171255/Material%20Creator/image_selector.png". It would fix this same issue. 2] **try/except** is to ensure that all the custom properties get deleted before recreating them, in case some are not necessary any more and to prevent conflicts. 3] variable now named **data_collection** 4] I'll try to make my script **PEP8 compliant** and follow these guidelines http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Layouts.
Author

Added support for relative paths using campbellbarton "bpy.path.abspath" suggestion.

Added support for **relative paths** using **campbellbarton** "bpy.path.abspath" suggestion.
Author

Changed modules import method to only load necessary modules for the add-on [ from module import submodule ]

Changed modules **import method** to only load necessary modules for the add-on [ from **module** import **submodule** ]
Author
Completed add-on **wiki** [ http://rikutogame.dnsd.me/bge_material_creator ]

Looks mostly fine.

blender_material_creator This doesn't even need to be a class?

Theres a bunch of unnecessary double lookups.

      if "diffuse_intensity" in addon_properties:
          slot.use_map_diffuse, slot.diffuse_factor = addon_properties["diffuse_intensity"]

Can be:

      data = addon_properties.get("diffuse_intensity")
      if data is not None:
          slot.use_map_diffuse, slot.diffuse_factor = data

More Pythonic then...

  if True in map_present:

Would be...

  if any(map_present):
Looks mostly fine. `blender_material_creator` This doesn't even need to be a class? Theres a bunch of unnecessary double lookups. ``` if "diffuse_intensity" in addon_properties: slot.use_map_diffuse, slot.diffuse_factor = addon_properties["diffuse_intensity"] ``` Can be: ``` data = addon_properties.get("diffuse_intensity") if data is not None: slot.use_map_diffuse, slot.diffuse_factor = data ``` More Pythonic then... ``` if True in map_present: ``` Would be... ``` if any(map_present): ```

Added subscriber: @mont29

Added subscriber: @mont29

Removed subscriber: @mahalin

Removed subscriber: @mahalin
Author

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#40334
No description provided.