Save Project with Assets not updating the maxon::Url of node textures in R26 and 2023
-
Hello colleagues,
There is a custom node space and there is a bitmap node with a the filepath of the type Url. The image drag&drop to nodes area is working from windows expolrer, everyting his working except for "Save project with Assets".
So the bitmap files are copied to the specified location, but the file strings are not updated in the custom bitmap node. None of them.
This code links C4D logic with the custom file path as described in the C++ API:spaceData.Set(maxon::nodes::NODESPACE::IMAGENODEASSETID, mynodes::NODE::BITMAP::GetId()) iferr_return; maxon::nodes::NODESPACE::ImageNodePortTuple imageTuple; imageTuple.first = maxon::NodePath::Create(maxon::ToSingletonBlock<maxon::InternedId>(mynodes::NODE::BITMAP::RESULT)) iferr_return; imageTuple.second = maxon::NodePath::Create(maxon::ToSingletonBlock<maxon::InternedId>(mynodes::NODE::BITMAP::FILENAME)) iferr_return; imageTuple.third = maxon::NodePath::Create(maxon::ToSingletonBlock<maxon::InternedId>(mynodes::NODE::BITMAP::FRAME_START)) iferr_return; imageTuple.fourth = maxon::NodePath::Create(maxon::ToSingletonBlock<maxon::InternedId>(mynodes::NODE::BITMAP::FRAME_END)) iferr_return; spaceData.Set(maxon::nodes::NODESPACE::IMAGENODEPORTS, std::move(imageTuple)) iferr_return;
Also the Asset Inspector relink doesn't actually change the file strings on the node.
This functionality is not working in R26 and 2023.
But it is working in R21-R25 nicely! The bitmap related code is the same.
I also can't open the Resource Editor in 2023.1.3. I am using the options to launch the Cinema:"C:\Program Files\Maxon Cinema 4D 2023\Cinema 4D.exe" g_applicationRepositoryWritable=true g_developerNodeEditorFunctions=true g_descriptionEditorDeveloperMode=true
Then click Resource Edit in the node editor and nothing happens.
Cinema version is 2023.1.3. The compiled SDK for node space was 2023.0.0.Please help me to fix this
-
Hi,
sorry i am a bit lost with your questions and i need a bit of clarification on some aspect.
If i understand correctly, you are implementing your own node space with your own texture node and the url is note updated when you use "save project with asset' i need more investigation time on that sorry.
About the Asset Inspector, if i am correct, this was a bug but fixed for a coming release. What i do not understand is that you are saying that the bitmap related code is the same but working in r21-25. If i am correct, the Node Api was not available for public with r21. So i am confused here, what code are you talking about?
g_developerNodeEditorFunctions
have been removed and nothing is replacing it. TheEdit Resource...
command will be available only for groups. It will also be displayed when you right click on the node editor itself (the root) but will do nothing as the root is not supposed to be edited.Cheers,
Manuel -
@Manuel Hi Manuel, I am Kirill from CentiLeo project. I have written a question here because it seems there is more life on the public forum and the nodes api is now public.
The issue performs as I have described. So there is a custom bitmap that is described with ImageTupple for Cinema insideMAXON_METHOD maxon::Result<void> NodeSpaceExample::Init(maxon::DataDictionary spaceData) { .. }
Then when I try to save "Project with Assets" I get the new project file where the filenames defined as maxon::Url in the resource editor are not updated to local file paths such as tex/texturename.jpg and they remain old in attrib manager. But in fact the files are copied to the specified project folder together with images. Only manual change can fix them. Also the asset inspector doesn't change the filenames.
The node structure was defined in the resource editor of the older Cinema R21.
The issue is on R26 and still on R2023. It works well for older Cinema versions.
I thought there is some new property appeared on resource editor that prevents from Url modification (something like ownership or perfmission) or maybe some little API feature that intervene into the process.
The other issue is that I still can't open resource editor in R2023. Cinema was launched with a cmd line"C:\Program Files\Maxon Cinema 4D 2023\Cinema 4D.exe" g_applicationRepositoryWritable=true g_descriptionEditorDeveloperMode=true
-
Hi @Aaron, we had similar problem, but I didn't notice that it even worked in earlier versions. I'm writing just to note that the node material does get the
MSG_RENAMETEXTURES
message and you can implement the renaming there. -
hi,
sorry for the delay.
thanks a lot for your help here @Deyan i do not think @Aaron is implementing its own material.
After looking in our code, i can confirm that the node system will receivedMSG_MULTI_CLEARSUGGESTEDFOLDER
andMSG_RENAMETEXTURES
and for both doing the same thing.It looks into all the ports inside the node system and check if the DataType of the port is
Url
. Whatever the node is.
Now i am wondering if you set the datatype correctly of you texture node and did not used a string instead?What you can try is to include the "Import Data' node inside your material setup and see if this node url will be renamed when you save the project with assets. That way we will know if the problem is your node or not.
you can no longer open the resource editor with a right click.
g_developerNodeEditorFunctions
has been removed.Cheers,
Manuel -
@Deyan thank you, in our case nodespace nodes (e.g. bitmap) didn't require too much message handling. All I did was making node layout in Resource Editor, and then describing this layout data access inside the code and the parse it. Message handling was used in the previous material system using BaseMaterial / BaseShader concept.
@Manuel thanks for investigation! This is my screenshot from bitmap layout in resource editor. Url type is used. But I have opened it in R25. Still can't open resource editor in 2023 even removing the option you mentioned.
How can I include Import Data node for tests? Btw, it can be easy to test it with CentiLeo plugin, I mean the nodespace & bitmap. No registration is required https://centileo.com/download/
-
@Aaron said in Save Project with Assets not updating the maxon::Url of node textures in R26 and 2023:
I am Kirill from CentiLeo project. I have written a question here because it seems there is more life on the public forum and the nodes api is now public.
By the way i hope you have access to our beta forum. There is a thread from 2021 in our gallery, a small test of Centileo. Now I remember the time you asked questions about our node API, in our old beta forum, answered by Sebastian and Ole. If you do not have access to our new forum or are not a registered developer, you can join us at sdk_support at maxon.net so we can talk about it.
I could test the pluging and, first, amazing job, now i understand how much effort you put on that project and why it looks so great. Sorry for not remembering immediately, it is sometime hard to follow everybody's project.
About the issue, i tested it with 2023.1.3 and could reproduce the issue but not with 2023.2. In 2023.2, it is working as expected. Our standard/physical nodespace is also working with 2023.3.1 so it is not a global bug.
The Project Asset Inspector have been improved in 2023.2 and texture renaming should work now.In your implementation of
maxon::nodes::NodeSystemClassInterface
SupportsImpl, you can define what node are supported in your nodespace.const maxon::Id& id = templ.GetId(); const maxon::String idString = id.ToString(); if (idString.StartsWith("net.maxon"_s)) return true;
After that you should be able to instantiate any of our nodes inside your graph and test if ImportData url is renamed or not. It is just to see if it is a node issue (that would be surprising now) or an issue with your nodespace.
On my side, i will compile 2023.1.3 today and have a look, from what i see in the code there is no reason to not work. I will also have to ask our developers if they have an idea.
Cheers,
Manuel -
Hi @Manuel, thanks a lot! It's very good that things work in 2023.1.2, I will check it. Also there was an issue in S26.000
Btw I am on beta forum too and I can duplicate a topic there.
Will return to the topic on Tuesday because need to travel -
Hi @Manuel I have checked the new update 2023.2.0 and the feature works just fine with custom bitmaps without any change from my side. Congrats with a very quick bugfix! This is very cool!
Also it's great the half-year version 2023.2 doesn't need 3rd party plugin rebuild and recompile as in S24, S26. Thanks for this!