seasick / 3mf-color-changer

web app for chaning colors of meshes in 3MF files
https://seasick.github.io/3mf-color-changer/
5 stars 2 forks source link

Mentioned about Blender plugin/script, any information #39

Open CptJackieSparrow opened 4 months ago

CptJackieSparrow commented 4 months ago

Is your feature request related to a problem? Please describe. Import 3mf to blender color data (preferable vertex color)

Describe the solution you'd like Import 3mf to blender color data (preferable vertex color)

Describe alternatives you've considered Checking internet for over week, no solution found. This post might help: https://github.com/bambulab/BambuStudio/issues/1892

Additional context Hope you can manage it! Trying to render +500 3mf files i've colored in bambu slicer in blender.

seasick commented 4 months ago

I'm unsure what I can do for your issue ... creating a blender plugin or script is definitely out of scope for this project. You could use this project to render your 3mfs, but for 500+ files it might be quite time consuming, which you could automate with tools like Puppeteer or other browser automation tools. But I might be misunderstanding what you are communicating - please give more details to your issue

CptJackieSparrow commented 4 months ago

So basicly what i'm searching all internet for the past week is: I want to import 3mf files created by Bambu Slicer which i've already painted. As far as I can see, the face/triangle/vertex color values are protected.

<?xml version="1.0" encoding="UTF-8"?>
<model unit="millimeter" xml:lang="en-US" xmlns="http://schemas.microsoft.com/3dmanufacturing/core/2015/02" xmlns:slic3rpe="http://schemas.slic3r.org/3mf/2017/06" xmlns:p="http://schemas.microsoft.com/3dmanufacturing/production/2015/06" requiredextensions="p">
 <metadata name="BambuStudio:3mfVersion">1</metadata>
 <resources>
  <object id="1" p:UUID="0000000b-81cb-4c03-9d28-80fed5dfa1dc" type="model">
   <mesh>
    <vertices>
     <vertex x="29.9669991" y="2.79296017" z="-9.76902199"/>
     <vertex x="29.9669991" y="2.78096008" z="-9.61702156"/>
     <vertex x="30.5289993" y="2.83696008" z="-9.76502132"/>
     <vertex x="30.4090004" y="2.82696009" z="-9.76702118"/>
     <vertex x="30.4109993" y="2.82496023" z="-9.72302151"/>
     <vertex x="30.4090004" y="2.82896018" z="-9.77702141"/>
     <vertex x="29.9669991" y="2.69096017" z="-9.00902176"/>
     <vertex x="30.4389992" y="2.72696018" z="-9.0070219"/>
     <vertex x="30.3009987" y="-8.57903957" z="-23.7430019"/>
    </vertices>
    <triangles>
     <triangle v1="0" v2="1" v3="2" paint_color="0C"/>
     <triangle v1="3" v2="4" v3="1"/>
     <triangle v1="3" v2="0" v3="5"/>
     <triangle v1="6" v2="7" v3="8"/>
     <triangle v1="9" v2="10" v3="11"/>
     <triangle v1="12" v2="13" v3="14"/>
     <triangle v1="15" v2="16" v3="12"/>
     <triangle v1="17" v2="18" v3="19" paint_color="0C"/>
     <triangle v1="19" v2="20" v3="17" paint_color="0C"/>
     ...
     <triangle v1="1923" v2="1924" v3="19281"/>
     <triangle v1="19364" v2="2260" v3="2255"/>
     <triangle v1="19364" v2="2255" v3="2256"/>
     <triangle v1="2399" v2="2401" v3="19419" paint_color="0C"/>
     <triangle v1="19420" v2="19421" v3="19419" paint_color="0C"/>
     <triangle v1="19422" v2="19423" v3="19421" paint_color="0C"/>
     <triangle v1="19424" v2="19425" v3="19426" paint_color="0C"/>
     <triangle v1="19423" v2="19426" v3="19425" paint_color="0C"/>
     <triangle v1="19424" v2="19427" v3="19425" paint_color="0C"/>
     <triangle v1="19428" v2="19429" v3="19430" paint_color="0C"/>
     ...
          <triangle v1="30169" v2="27754" v3="27753" paint_color="4C"/>
     <triangle v1="30169" v2="30168" v3="27754" paint_color="4C"/>
     <triangle v1="74559" v2="30090" v3="27775" paint_color="4C"/>
    </triangles>
   </mesh>
  </object>
 </resources>
 <build/>
</model>

I want to see if it's possible to control that paint_color values to convert into vertex color/faceset data basicly. Maybe i can continue from there with the automation.

I've tried to understand x3d, wrl, ply (xml basicly), but couldn't figured that out as i'm not a programmer. Just a hobbyist! Thanks for your reply by the way!

Edit: And maybe dividing same "paint_color" faces into vertex groups could be possible with a smallish script?