By JDHill
#351175
Could you please be more specific regarding how you are importing the MXM? I am checking various methods of doing so, but not yet seeing what you describe. I see one possible case, where you:
  1. open the material editor
  2. create a new material
  3. delete all of its layers
  4. browse to set its MXM Link path
  5. are asked whether you want to link to the MXM
If you answer No here, the only thing that will happen is that the link path is set. I you answer Yes, the chosen MXM is read, and the link is enabled. But this sounds like a different scenario than the one you are describing.
User avatar
By jc4d
#351179
I tried your method and if my answer is no the path is set but nothing is showing in the material editor and if I remember correctly this behavior didn´t happen with previous versions.

My steps are almost the same:
- From Material Manager create a new Maxwell Material.
- From Attributes browse any MXM.
- Answer No when the question for linking the material is prompted.
- Double click in the material that is in the Material Manager and there is nothing just the basic layer.

Your method and mine are giving the same result.

Cheers
JC
By JDHill
#351181
Yes, that is the correct behavior; when you click the browse button, you are not reading the MXM, you are only setting the MXM path. That is why it asks you if you want to link or not -- if you do, then the existing material structure is overwritten with that of the target MXM, otherwise, the only thing that happens is that the MXM Link path is set.

I was confused, because when you wrote the material was empty, I thought you mean that the operation was somehow damaging an existing material structure, which is something that should not happen. An existing material should not be destroyed by the sequence: browse for MXM Link > answer No to the linking question; only in the case that you answer Yes, should the material be modified. The reason for that is so that if you should later open the Cinema file on a machine where the linked MXM does not exist, the embedded material definition will match that of the missing MXM file, having been read when the MXM was originally linked.
User avatar
By jc4d
#351182
But don´t you think that if the answer is no the material editor should read all the attributes of that MXM? I guess it should work in the same way when you uncheck Link To, from material editor.

I was reporting this as a bug because I remember that in previous version of the plugin, when the answer was no the material editor read all the attributes of that loaded MXM without be linked.

Cheers
JC
By JDHill
#351183
It is possible that it worked differently before (I have not checked), but that would have been a wrong behavior. Reading the MXM file is destructive to the existing material structure (in this case, just a default material), so I only do it when you explicitly say Yes to that dialog box. Here are two sequences which are equal to each other:
  1. browse for MXM file, answer Yes.
  2. browse for MXM file, answer No, check the "Link to" box.
It should work this way both in the AM, and in the plugin material editor. Un-checking the "Link to" box doesn't do anything at all, except tell the plugin to ignore the MXM path, if there is one.
User avatar
By jc4d
#351214
I understand that linking the material is destructive, but from my point of view, what is the advantage or "point" to have just the path set in the material if there is no use for it at least until the material is linked?

My workflow is this:
- Create new material.
- Import a MXM as a base.
- Edit it inside Cinema material editor for that specific project without overwriting the original MXM.
JDHill wrote: Un-checking the "Link to" box doesn't do anything at all, except tell the plugin to ignore the MXM path, if there is one.
The advantage of un-checking the Link to is edit the material inside Cinema without overwriting the original MXM that was imported.

Cheers
JC

PS. Maybe I have this idea fixed in my head only, would be nice to hear what others C4D plugin users think about this.
By JDHill
#351234
The linking confirmation dialog is only shown for pre-existing materials. If, on the other hand, your intention is not to link, and you therefore have Preferences > Enable MXM Linking on MXM import un-checked, then an easier workflow might be: open the material editor, then click menu > Create > From MXM. You could also just drag MXMs from the Content Browser, or the MXED Browser. In any of those cases, you should obtain the same result as using the steps you wrote above, but with just one step.
User avatar
By jc4d
#351235
I see now, thanks :)
JDHill wrote:open the material editor, then click menu > Create > From MXM
Would be difficult to have this option directly from the material manager?
Could be something like this:

Material Manager:
File -- Maxwell Material
-- New Material
-- Import Material (what is called From MXM)

Having those two options in a sub-menu.

Cheers
JC
By JDHill
#351236
I don't think we can do that. I could add another command for this to the plugin menu & toolbar though, so you'd have Material, and Material (from MXM) commands.

So, is this a known issue?