Comments (8)
Hello,
Well, I'm not sure to see a problem in what you describe, but I may not fully understand your point.
Just to make things clear, I've written a small script you can copy/paste in the console:
import Render
doc = App.newDocument()
# Create a part
cube = doc.addObject("Part::Box","Box")
cube.Label = "Cube"
# Create a link
link = doc.addObject('App::Link','Link')
link.setLink(cube)
link.Label = "CubeLink"
link.Placement.translate(App.Vector(15, 0, 0))
doc.recompute()
# Place point of view
Gui.activeView().viewDefaultOrientation()
Gui.runCommand('Std_PerspectiveCamera', 1)
# Create a Render Project (select your own renderer)
proj, _, _ = Render.Project.create(doc, renderer="Ospray", template="ospray_studio_light.sg")
# proj, _, _ = Render.Project.create(doc, renderer="Povray", template="povray_studio_light.pov")
# proj, _, _ = Render.Project.create(doc, renderer="Cycles", template="cycles_studio_light.xml")
# Add views
proj.add_view(cube)
proj.add_view(link)
# Render
proj.render()
Do we agree that, with such a script, we expect to see 2 cubes in the rendering (the original and the link)?
from freecad-render.
There is not one „std part“ in your example at all, so this script does not produce the problem. Try this:
import Render
doc = App.newDocument()
# Create a std part
part = doc.addObject('App::Part','Part')
part.Label = "std part"
cube = doc.addObject("Part::Box","Box")
cube.Label = "Cube"
part.addObject(cube)
# Create a link
link = doc.addObject('App::Link','Link')
link.setLink(part)
link.Label = "std part link"
link.Placement.translate(App.Vector(15, 0, 0))
doc.recompute()
# Place point of view
Gui.activeView().viewDefaultOrientation()
Gui.runCommand('Std_PerspectiveCamera', 1)
# Create a Render Project (select your own renderer)
# proj, _, _ = Render.Project.create(doc, renderer="Ospray", template="ospray_studio_light.sg")
# proj, _, _ = Render.Project.create(doc, renderer="Povray", template="povray_studio_light.pov")
proj, _, _ = Render.Project.create(doc, renderer="Cycles", template="cycles_studio_light.xml")
# Add views
proj.add_view(part)
proj.add_view(link)
# Render
proj.render()
from freecad-render.
OK, thank you, this is clearer, I'm gonna investigate.
from freecad-render.
Fine.
To get the second problem, comment the proj.add_view(part)
out. The part is rendered even it has not been added…
from freecad-render.
Yes, you're right. Actually, the 'std part link' object has got a Group
property, pointing to the underlying Cube. In such case, it is not clear for me how to handle it precisely: create views for all components + container, or for container only (I've already encountered both cases...).
Seems that 'links to App::part' should follow the second behaviour (container only), whereas they are currently defaulted to first one. I'm gonna fix it...
from freecad-render.
Hello,
#322 should fix the problem, could you please confirm?
from freecad-render.
Seems to work.
Thanks.
from freecad-render.
Fine, thank you! I close the issue.
from freecad-render.
Related Issues (20)
- Cycles renderer - skip_meshing and lights HOT 4
- LuxCore renderer does not accept AreaLight HOT 5
- Doc: detail renderer installations for Ubuntu and Windows HOT 8
- Doc: provide a test function for renderer installation HOT 1
- Cycles templates are strange HOT 5
- Cycles needing to be compiled standalone should be made more clear. HOT 29
- Adding materials seems to be broken in latest dev! HOT 15
- [Contest] HOT 5
- File name too long HOT 3
- [feature request] Add emmision material/shader HOT 9
- AttributeError: module 'Material' has no attribute 'MaterialManager' HOT 2
- Render.view.ViewProviderView not JSON serializable HOT 4
- [macOS] ImportError: No module named site HOT 1
- Cycles say: Color management disabled HOT 8
- make_material can't be caller with alpha in color HOT 1
- Editing Material try error HOT 1
- Using ArchMaterial beaks rendering
- appleseed don't render HOT 3
- Merge #358 breaks workbench (init needs to be updated too to reflect removal of set_a2p) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freecad-render.